public abstract class MarshallingItemCache extends InlineItemCache
InlineItemCache
that stores the procssed items to disk.
The items are stored and to disk upon close() and save() respectively; Items are only read from disk upon init(). If multiple instances of this class point to the same persistentStore then results are undefined.
cache, logR
Constructor and Description |
---|
MarshallingItemCache()
Default Constructor
PersistentStore = System.getProperty("user.dir")+ "/uniqueid"
|
MarshallingItemCache(java.lang.String store) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the component.
|
java.lang.String |
getPersistentStore() |
void |
init()
Initialises the component.
|
protected abstract AdaptrisMarshaller |
initMarshaller() |
void |
save()
Explicitly save the state of the cache.
|
void |
setPersistentStore(java.lang.String filename) |
clear, contains, evict, get, getAgeBeforeEviction, setAgeBeforeEviction, size, start, stop, update, update
public MarshallingItemCache() throws java.lang.Exception
java.lang.Exception
public MarshallingItemCache(java.lang.String store) throws java.lang.Exception
java.lang.Exception
protected abstract AdaptrisMarshaller initMarshaller() throws java.lang.Exception
java.lang.Exception
public void init() throws CoreException
ComponentLifecycle
Component initialisation includes config verification, creation of connections etc.
init
in interface ComponentLifecycle
init
in class InlineItemCache
CoreException
- wrapping any underlying Exception
spublic 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 ComponentLifecycle
close
in class InlineItemCache
public void save()
ProcessedItemCache
save
in interface ProcessedItemCache
save
in class InlineItemCache
public java.lang.String getPersistentStore()
public void setPersistentStore(java.lang.String filename)
filename
- the file where to store cached items.