public class FilePersistenceStrategy extends Object implements QueuePersistenceStrategy, MuleContextAware
Modifier and Type | Class and Description |
---|---|
protected static class |
FilePersistenceStrategy.HolderImpl |
QueuePersistenceStrategy.Holder
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_QUEUE_STORE
The default queueStore directory for persistence
|
static String |
EXTENSION |
protected MuleContext |
muleContext |
Constructor and Description |
---|
FilePersistenceStrategy() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the store.
|
protected String |
getId(Object obj) |
boolean |
isTransient() |
Object |
load(String queue,
Object id)
Loads an object specified by the given id.
|
void |
open()
Open the store.
|
void |
remove(String queue,
Object id)
Removes the object specified by the given id from the store.
|
List |
restore()
Retrieves the ids of the stored objects.
|
protected void |
restoreFiles(File dir,
List msgs) |
void |
setMuleContext(MuleContext context) |
Object |
store(String queue,
Object obj)
Stores an object and returns its generated id.
|
public static final String DEFAULT_QUEUE_STORE
public static final String EXTENSION
protected MuleContext muleContext
public void setMuleContext(MuleContext context)
setMuleContext
in interface MuleContextAware
public Object store(String queue, Object obj) throws IOException
QueuePersistenceStrategy
store
in interface QueuePersistenceStrategy
obj
- the object to be storedIOException
public void remove(String queue, Object id) throws IOException
QueuePersistenceStrategy
remove
in interface QueuePersistenceStrategy
id
- the id of the stored objectIOException
public Object load(String queue, Object id) throws IOException
QueuePersistenceStrategy
load
in interface QueuePersistenceStrategy
id
- the id of the stored objectIOException
public List restore() throws IOException
QueuePersistenceStrategy
restore
in interface QueuePersistenceStrategy
IOException
protected void restoreFiles(File dir, List msgs) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public void open() throws IOException
QueuePersistenceStrategy
open
in interface QueuePersistenceStrategy
IOException
public void close() throws IOException
QueuePersistenceStrategy
close
in interface QueuePersistenceStrategy
IOException
public boolean isTransient()
isTransient
in interface QueuePersistenceStrategy
Copyright © 2003–2013 MuleSource, Inc.. All rights reserved.