public class TextFileObjectStore extends InMemoryObjectStore
InMemoryObjectStore.StoredObject
Modifier and Type | Field and Description |
---|---|
protected String |
directory |
protected String |
encoding |
protected File |
fileStore |
store
context, entryTTL, expirationInterval, logger, maxEntries, name, scheduler
PHASE_NAME
PHASE_NAME
Constructor and Description |
---|
TextFileObjectStore() |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
A lifecycle method where implementor should free up any resources.
|
String |
getDirectory() |
String |
getEncoding() |
void |
initialise()
Method used to perform any initialisation work.
|
protected void |
loadFromStore() |
void |
setDirectory(String directory) |
void |
setEncoding(String encoding) |
boolean |
storeObject(String id,
Object item)
Store the given Object.
|
containsObject, expire, removeObject, retrieveObject
getEntryTTL, getExpirationInterval, getMaxEntries, getName, getScheduler, run, setEntryTTL, setExpirationInterval, setMaxEntries, setMuleContext, setName, setScheduler
protected File fileStore
protected String directory
protected String encoding
public void initialise() throws InitialisationException
Initialisable
InitialisationException
should be thrown,
causing the Mule instance to shutdown. If the error is recoverable, say by
retrying to connect, a RecoverableException
should be thrown.
There is no guarantee that by throwing a Recoverable exception that the Mule
instance will not shut down.initialise
in interface Initialisable
initialise
in class AbstractMonitoredObjectStore
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdownRecoverableException
- if an error occurs that can be recovered frompublic boolean storeObject(String id, Object item) throws Exception
storeObject
in interface ObjectStore
storeObject
in class InMemoryObjectStore
id
- the ID to storeitem
- the Object to store with the idtrue
if the ID was stored properly, or false
if it already existedIllegalArgumentException
- if the given ID cannot be stored or is
null
Exception
- if the store is not available or any other
implementation-specific error occuredpublic String getDirectory()
public void setDirectory(String directory)
public String getEncoding()
public void setEncoding(String encoding)
public void dispose()
AbstractMonitoredObjectStore
dispose
in interface Disposable
dispose
in class AbstractMonitoredObjectStore
Copyright © 2003–2013 MuleSource, Inc.. All rights reserved.