public class DependentCacheInvalidationService
extends neo.xredsys.api.services.AsyncEventListenerService
GenericService.StartCommand, GenericService.StopCommand
mLogger, state
Constructor and Description |
---|
DependentCacheInvalidationService() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
accept(IOEvent pEvent)
This method is called synchronously, so it is recommended that you only do initial filtering that are fast to execute in this method.
|
Cache<Object,DependentCache> |
getCache() |
IOHashKey[] |
getKeysFromEvent(IOEvent e) |
int |
getPostponeTime()
Time delay in milliseconds before the object is actually expired.
|
protected void |
handle(IOEvent pEvent)
This method is called from
AsyncEventListenerService.handleEvent(IOEvent) to let an IOEventListener respond to an IOEvent . |
void |
setCache(Cache<Object,DependentCache> cache) |
void |
setPostponeTime(int pPostponeTime)
Time delay in milliseconds before the object is actually expired.
|
protected void |
startEventListener()
Template method: A no operation implementation that is called from
AsyncEventListenerService.startService() before it has registered itself with the AsyncEventListenerService.getEventManager() . |
String |
toString() |
acceptEvent, getBacklog, getCollector, getEventManager, getService, handleEvent, isLocalOnly, setCollector, setEventManager, startService, stopEventListener, stopService
doStartService, doStopService, stopIdleService
assertServiceRunning, getServiceDescription, getServiceMessage, getServiceState, isServiceEnabled, isServiceFailed, isServiceIdle, isServiceRunning, isServiceShutdownFailed, isServiceStopped, setServiceDescription, setServiceEnabled, start, stop, validateIsTrue, validateNotNull
public void setCache(Cache<Object,DependentCache> cache)
cache
- the cache to setpublic Cache<Object,DependentCache> getCache()
protected void startEventListener() throws IllegalStateException, IllegalArgumentException, Exception
neo.xredsys.api.services.AsyncEventListenerService
Template method: A no operation implementation that is called from AsyncEventListenerService.startService()
before it has registered itself with the AsyncEventListenerService.getEventManager()
.
Subclasses might override this to do their own start up logic, by example validation of configuration.
startEventListener
in class neo.xredsys.api.services.AsyncEventListenerService
IllegalStateException
- when this IOEventListener
is in the wrong state for startup. Used to signal to AbstractNurseryService.doStartService()
that it is OK to try to starting
this service
later. GenericService.isServiceRunning()
returns false
and GenericService.isServiceIdle()
returns
true
.IllegalArgumentException
- when the configuration of the service
is invalid. GenericService.isServiceRunning()
will return false
and
GenericService.isServiceFailed()
will return true
.Exception
- when something goes wrong during startup. GenericService.isServiceRunning()
will return false
and GenericService.isServiceFailed()
will return
true
.AsyncEventListenerService.startService()
protected void handle(IOEvent pEvent) throws Exception
neo.xredsys.api.services.AsyncEventListenerService
This method is called from AsyncEventListenerService.handleEvent(IOEvent)
to let an IOEventListener
respond to an IOEvent
. The IOEventListener
may throw any type of exception; these
exceptions will be logged by AsyncEventListenerService.handleEvent(IOEvent)
.
Only called from AsyncEventListenerService.handleEvent(IOEvent)
when GenericService.isServiceRunning()
returns true
.
handle
in class neo.xredsys.api.services.AsyncEventListenerService
pEvent
- the eventException
- when any unknown error happenspublic int getPostponeTime()
public void setPostponeTime(int pPostponeTime)
pPostponeTime
- the new postpone time to useprotected boolean accept(IOEvent pEvent) throws Exception
neo.xredsys.api.services.AsyncEventListenerService
This method is called synchronously, so it is recommended that you only do initial filtering that are fast to execute in this method.
accept
in class neo.xredsys.api.services.AsyncEventListenerService
pEvent
- the event to accepttrue
if the event is to be accepted, false
otherwiseException
- when any unknown error happens© 1998- 2018 Stibo DX