public class TextFileObjectStore extends InMemoryObjectStore<String>
InMemoryObjectStore.StoredObject<T>
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 |
clear()
Removes all items of this store without disposing it, meaning that after
performing a clear(), you should still be able perform other operations.
|
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.
|
boolean |
isPersistent()
Is this store persistent?
|
protected void |
loadFromStore() |
void |
setDirectory(String directory) |
void |
setEncoding(String encoding) |
void |
store(Serializable id,
String item)
Store the given Object.
|
contains, expire, remove, retrieve, toString
getEntryTTL, getExpirationInterval, getMaxEntries, getMuleContext, getName, getScheduler, run, setEntryTTL, setExpirationInterval, setMaxEntries, setMuleContext, setName, setScheduler
protected File fileStore
protected String directory
protected String encoding
public boolean isPersistent()
isPersistent
in interface ObjectStore<String>
isPersistent
in class InMemoryObjectStore<String>
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<String>
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdownRecoverableException
- if an error occurs that can be recovered frompublic void store(Serializable id, String item) throws ObjectStoreException
ObjectStore
store
in interface ObjectStore<String>
store
in class InMemoryObjectStore<String>
id
- the identifier for value
item
- the Object to store with key
ObjectStoreException
- if the given key cannot be stored or is
null
.ObjectStoreNotAvaliableException
- if the store is not available or any
other implementation-specific error occured.ObjectAlreadyExistsException
- if an attempt is made to store an object
for a key that already has an object associated.public void clear()
ObjectStore
clear
in interface ObjectStore<String>
clear
in class InMemoryObjectStore<String>
public String getDirectory()
public void setDirectory(String directory)
public String getEncoding()
public void setEncoding(String encoding)
public void dispose()
Disposable
dispose
in interface Disposable
dispose
in class AbstractMonitoredObjectStore<String>
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.