org.mule.util.store
Class PartitionedPersistentObjectStore<T extends Serializable>
java.lang.Object
org.mule.util.store.AbstractPartitionedObjectStore<T>
org.mule.util.store.PartitionedPersistentObjectStore<T>
- All Implemented Interfaces:
- MuleContextAware, ExpirableObjectStore<T>, ListableObjectStore<T>, ObjectStore<T>, PartitionableExpirableObjectStore<T>, PartitionableObjectStore<T>
public class PartitionedPersistentObjectStore<T extends Serializable>
- extends AbstractPartitionedObjectStore<T>
- implements MuleContextAware, PartitionableExpirableObjectStore<T>
Method Summary |
List<Serializable> |
allKeys(String partitionName)
|
List<String> |
allPartitions()
|
void |
close(String partitionName)
|
protected List<Serializable> |
collectAllKeys(String partitionName)
|
boolean |
contains(Serializable key,
String partitionName)
|
protected void |
createStoreDirectory(File directory)
|
protected File |
createStoreFile(Serializable key,
String partitionName)
|
protected File |
createStorePartition(String partitionName)
|
protected void |
deleteStoreFile(File file)
|
protected T |
deserialize(File file)
|
void |
disposePartition(String partitionName)
|
protected void |
ensureStoreDirectoryExists(File outputFile)
|
void |
expire(int entryTTL,
int maxEntries)
|
void |
expire(int entryTTL,
int maxEntries,
String partitionName)
|
boolean |
isPersistent()
Is this store persistent? |
protected void |
listStoredFiles(File directory,
List<Serializable> keys)
|
void |
open()
Open the underlying store. |
void |
open(String partitionName)
|
T |
remove(Serializable key,
String partitionName)
|
T |
retrieve(Serializable key,
String partitionName)
|
protected void |
serialize(T value,
File outputFile)
|
void |
setMuleContext(MuleContext context)
|
void |
store(Serializable key,
T value,
String partitionName)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_OBJECT_STORE
public static final String DEFAULT_OBJECT_STORE
- See Also:
- Constant Field Values
PartitionedPersistentObjectStore
public PartitionedPersistentObjectStore()
PartitionedPersistentObjectStore
public PartitionedPersistentObjectStore(MuleContext context)
open
public void open(String partitionName)
throws ObjectStoreException
- Specified by:
open
in interface PartitionableObjectStore<T extends Serializable>
- Throws:
ObjectStoreException
close
public void close(String partitionName)
throws ObjectStoreException
- Specified by:
close
in interface PartitionableObjectStore<T extends Serializable>
- Throws:
ObjectStoreException
isPersistent
public boolean isPersistent()
- Description copied from interface:
ObjectStore
- Is this store persistent?
- Specified by:
isPersistent
in interface ObjectStore<T extends Serializable>
- Returns:
- true if this store is persistent
contains
public boolean contains(Serializable key,
String partitionName)
throws ObjectStoreException
- Specified by:
contains
in interface PartitionableObjectStore<T extends Serializable>
- Throws:
ObjectStoreException
store
public void store(Serializable key,
T value,
String partitionName)
throws ObjectStoreException
- Specified by:
store
in interface PartitionableObjectStore<T extends Serializable>
- Throws:
ObjectStoreException
retrieve
public T retrieve(Serializable key,
String partitionName)
throws ObjectStoreException
- Specified by:
retrieve
in interface PartitionableObjectStore<T extends Serializable>
- Throws:
ObjectStoreException
remove
public T remove(Serializable key,
String partitionName)
throws ObjectStoreException
- Specified by:
remove
in interface PartitionableObjectStore<T extends Serializable>
- Throws:
ObjectStoreException
allKeys
public List<Serializable> allKeys(String partitionName)
throws ObjectStoreException
- Specified by:
allKeys
in interface PartitionableObjectStore<T extends Serializable>
- Throws:
ObjectStoreException
collectAllKeys
protected List<Serializable> collectAllKeys(String partitionName)
throws ObjectStoreException
- Throws:
ObjectStoreException
listStoredFiles
protected void listStoredFiles(File directory,
List<Serializable> keys)
throws IOException,
ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
allPartitions
public List<String> allPartitions()
throws ObjectStoreException
- Specified by:
allPartitions
in interface PartitionableObjectStore<T extends Serializable>
- Throws:
ObjectStoreException
createStoreDirectory
protected void createStoreDirectory(File directory)
throws ObjectStoreException
- Throws:
ObjectStoreException
createStorePartition
protected File createStorePartition(String partitionName)
throws ObjectStoreException
- Throws:
ObjectStoreException
createStoreFile
protected File createStoreFile(Serializable key,
String partitionName)
throws ObjectStoreException
- Throws:
ObjectStoreException
ensureStoreDirectoryExists
protected void ensureStoreDirectoryExists(File outputFile)
throws ObjectStoreException
- Throws:
ObjectStoreException
serialize
protected void serialize(T value,
File outputFile)
throws ObjectStoreException
- Throws:
ObjectStoreException
deserialize
protected T deserialize(File file)
throws ObjectStoreException
- Throws:
ObjectStoreException
deleteStoreFile
protected void deleteStoreFile(File file)
throws ObjectStoreException
- Throws:
ObjectStoreException
open
public void open()
throws ObjectStoreException
- Description copied from interface:
ListableObjectStore
- Open the underlying store.
- Specified by:
open
in interface ListableObjectStore<T extends Serializable>
- Overrides:
open
in class AbstractPartitionedObjectStore<T extends Serializable>
- Throws:
ObjectStoreException
- if an exception occurred while opening the underlying store.
setMuleContext
public void setMuleContext(MuleContext context)
- Specified by:
setMuleContext
in interface MuleContextAware
expire
public void expire(int entryTTL,
int maxEntries)
throws ObjectStoreException
- Specified by:
expire
in interface ExpirableObjectStore<T extends Serializable>
- Throws:
ObjectStoreException
expire
public void expire(int entryTTL,
int maxEntries,
String partitionName)
throws ObjectStoreException
- Specified by:
expire
in interface PartitionableExpirableObjectStore<T extends Serializable>
- Throws:
ObjectStoreException
disposePartition
public void disposePartition(String partitionName)
throws ObjectStoreException
- Specified by:
disposePartition
in interface PartitionableObjectStore<T extends Serializable>
- Throws:
ObjectStoreException
Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.