org.mule.util.queue
Class FilePersistenceStrategy

java.lang.Object
  extended by org.mule.util.queue.FilePersistenceStrategy
All Implemented Interfaces:
MuleContextAware, QueuePersistenceStrategy
Direct Known Subclasses:
EventFilePersistenceStrategy

public class FilePersistenceStrategy
extends Object
implements QueuePersistenceStrategy, MuleContextAware


Nested Class Summary
protected static class FilePersistenceStrategy.HolderImpl
           
 
Nested classes/interfaces inherited from interface org.mule.util.queue.QueuePersistenceStrategy
QueuePersistenceStrategy.Holder
 
Field Summary
static String DEFAULT_QUEUE_STORE
          The default queueStore directory for persistence
static String EXTENSION
           
protected  MuleContext muleContext
           
 
Constructor Summary
FilePersistenceStrategy()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_QUEUE_STORE

public static final String DEFAULT_QUEUE_STORE
The default queueStore directory for persistence

See Also:
Constant Field Values

EXTENSION

public static final String EXTENSION
See Also:
Constant Field Values

muleContext

protected MuleContext muleContext
Constructor Detail

FilePersistenceStrategy

public FilePersistenceStrategy()
Method Detail

setMuleContext

public void setMuleContext(MuleContext context)
Specified by:
setMuleContext in interface MuleContextAware

getId

protected String getId(Object obj)

store

public Object store(String queue,
                    Object obj)
             throws IOException
Description copied from interface: QueuePersistenceStrategy
Stores an object and returns its generated id.

Specified by:
store in interface QueuePersistenceStrategy
obj - the object to be stored
Returns:
the id of the stored object
Throws:
IOException

remove

public void remove(String queue,
                   Object id)
            throws IOException
Description copied from interface: QueuePersistenceStrategy
Removes the object specified by the given id from the store.

Specified by:
remove in interface QueuePersistenceStrategy
id - the id of the stored object
Throws:
IOException

load

public Object load(String queue,
                   Object id)
            throws IOException
Description copied from interface: QueuePersistenceStrategy
Loads an object specified by the given id.

Specified by:
load in interface QueuePersistenceStrategy
id - the id of the stored object
Returns:
the object
Throws:
IOException

restore

public List restore()
             throws IOException
Description copied from interface: QueuePersistenceStrategy
Retrieves the ids of the stored objects.

Specified by:
restore in interface QueuePersistenceStrategy
Returns:
the list of ids
Throws:
IOException

restoreFiles

protected void restoreFiles(File dir,
                            List msgs)
                     throws IOException,
                            ClassNotFoundException
Throws:
IOException
ClassNotFoundException

open

public void open()
          throws IOException
Description copied from interface: QueuePersistenceStrategy
Open the store.

Specified by:
open in interface QueuePersistenceStrategy
Throws:
IOException

close

public void close()
           throws IOException
Description copied from interface: QueuePersistenceStrategy
Closes the store.

Specified by:
close in interface QueuePersistenceStrategy
Throws:
IOException

isTransient

public boolean isTransient()
Specified by:
isTransient in interface QueuePersistenceStrategy


Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.