A - The type of the action.R - The type of the result.public class CachingInterceptor<A,R> extends AbstractCachingRpcInterceptor<A,R>
AbstractCachingRpcInterceptor. It supports action caching| Constructor and Description |
|---|
CachingInterceptor(Class<A> actionType,
Cache cache) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
postfetch(A action,
R result)
Override this method to perform an action after the call to the server returns successfully or not.
|
protected R |
prefetch(A action)
Override this method to perform an action before the call is sent to the server.
|
canExecute, execute, getCache, undogetActionTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetActionTypeprotected void postfetch(A action, R result)
AbstractCachingRpcInterceptornull will be passed in the result parameter.
You can use this method to add the result to cache, if it is null you should remove the action
from the cache.postfetch in class AbstractCachingRpcInterceptor<A,R>action - The action that just finished execution on the server.result - The result after the server call, or null if the server call failed.protected R prefetch(A action)
AbstractCachingRpcInterceptornull result then the action is never executed on the server and the returned value is used. If the
call returns null then the action is executed on the server.
You can use this method to fetch the action from the cache.prefetch in class AbstractCachingRpcInterceptor<A,R>action - The action to be prefetchednull.Copyright © 2010–2017 Arcbees. All rights reserved.