Package com.adaptris.core.services.cache
Class CacheServiceImpl
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.services.cache.CacheServiceImpl
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,ConnectedService
,MessageEventGenerator
,Service
,StateManagedComponent
- Direct Known Subclasses:
CacheServiceBase
,ClearCacheService
,SingleKeyCacheService
public abstract class CacheServiceImpl extends ServiceImp implements ConnectedService
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description CacheServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeService()
AdaptrisConnection
getConnection()
Returns theAdaptrisConnection
to use.void
initService()
void
prepare()
Prepare for initialisation.protected Cache
retrieveCache()
void
setConnection(AdaptrisConnection cacheConnection)
Set the connection associated with this cache service.void
start()
Starts the component.void
stop()
Stop the component<T extends CacheServiceImpl>
TwithConnection(AdaptrisConnection c)
-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueId
-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init
-
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createName, createQualifier, isTrackingEndpoint
-
Methods inherited from interface com.adaptris.core.Service
continueOnFailure, doService, isBranching, setUniqueId
-
Methods inherited from interface com.adaptris.core.StateManagedComponent
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
-
-
-
-
Method Detail
-
prepare
public void prepare() throws CoreException
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Specified by:
prepare
in interfaceComponentLifecycleExtension
- Throws:
CoreException
-
closeService
public void closeService()
- Specified by:
closeService
in classServiceImp
-
initService
public void initService() throws CoreException
- Specified by:
initService
in classServiceImp
- Throws:
CoreException
-
start
public void start() throws CoreException
Description copied from interface:ComponentLifecycle
Starts the component.Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling start will begin message delivery.- Specified by:
start
in interfaceComponentLifecycle
- Overrides:
start
in classServiceImp
- Throws:
CoreException
- wrapping any underlyingException
s
-
stop
public void stop()
Description copied from interface:ComponentLifecycle
Stop the componentA stopped component is not expected to be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling stop will pause message delivery. Throwing aRuntimeException
may cause unintended consequences- Specified by:
stop
in interfaceComponentLifecycle
- Overrides:
stop
in classServiceImp
-
retrieveCache
protected Cache retrieveCache()
-
getConnection
public AdaptrisConnection getConnection()
Description copied from interface:ConnectedService
Returns theAdaptrisConnection
to use.- Specified by:
getConnection
in interfaceConnectedService
- Returns:
- the
AdaptrisConnection
-
setConnection
public void setConnection(AdaptrisConnection cacheConnection)
Set the connection associated with this cache service.- Specified by:
setConnection
in interfaceConnectedService
- Parameters:
cacheConnection
- theAdaptrisConnection
to use- See Also:
CacheConnection
,SharedConnection
-
withConnection
public <T extends CacheServiceImpl> T withConnection(AdaptrisConnection c)
-
-