public class NullCacheImplementation extends java.lang.Object implements Cache
Cache
that does nothing.
This class is included for completeness, all methods are stubs and it is simply designed to provide default behaviour in the event of misconfiguration.
In the adapter configuration file this class is aliased as null-cache-implementation which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
NullCacheImplementation() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all entries from the cache
|
void |
close()
Closes the component.
|
java.lang.Object |
get(java.lang.String key)
Retrieves an object from the cache
|
java.util.List<java.lang.String> |
getKeys()
Retrieves a List of all the keys in the cache
|
void |
init()
Initialises the component.
|
void |
put(java.lang.String key,
java.lang.Object value)
Puts any object into the cache.
|
void |
put(java.lang.String key,
java.io.Serializable value)
Puts a serializable object into the cache.
|
void |
remove(java.lang.String key)
Removes an object from the cache.
|
int |
size() |
void |
start()
Starts the component.
|
void |
stop()
Stop the component
|
public void init() throws CoreException
ComponentLifecycle
Component initialisation includes config verification, creation of connections etc.
init
in interface Cache
init
in interface ComponentLifecycle
CoreException
- wrapping any underlying Exception
spublic void start() throws CoreException
ComponentLifecycle
Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling start will begin message delivery.
start
in interface Cache
start
in interface ComponentLifecycle
CoreException
- wrapping any underlying Exception
spublic void stop()
ComponentLifecycle
A stopped component is not expected to be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling stop will pause message delivery. Throwing a
RuntimeException
may cause unintended consequences
stop
in interface Cache
stop
in interface ComponentLifecycle
public void close()
ComponentLifecycle
A closed component should release any connections it uses, etc. and clean up completely.
Throwing a RuntimeException
may cause unintended consequences
close
in interface Cache
close
in interface ComponentLifecycle
public void put(java.lang.String key, java.io.Serializable value)
Cache
public void put(java.lang.String key, java.lang.Object value)
Cache
Not guaranteed to be supported by all cache implementations as some persistent caches require serialization.
public java.lang.Object get(java.lang.String key)
Cache
public void remove(java.lang.String key)
Cache
public java.util.List<java.lang.String> getKeys()
Cache
public void clear()
Cache