org.jboss.remoting
Interface SerializableStore

All Known Subinterfaces:
CallbackStoreMBean
All Known Implementing Classes:
CallbackStore, NullCallbackStore

public interface SerializableStore

Author:
Tom Elrod

Method Summary
 void add(Serializable object)
          Persists the serializable object passed to the directory specified.
 void create()
          This is a no op method, but needed in order to be used as a service within JBoss AS.
 void destroy()
          This is a no op method, but needed in order to be used as a service within JBoss AS.
 Object getNext()
          Will look through the files in the store directory for the oldest object serialized to disk, load it, delete the file, and return the deserialized object.
 boolean getPurgeOnShutdown()
          Returns if store will clean up persisted files when shutdown (destroy()).
 void purgeFiles()
           
 void setConfig(Map config)
          Will use the values in the map to set configuration.
 void setPurgeOnShutdown(boolean purgeOnShutdown)
          Sets if store should clean up persisted files when shutdown (destroy()).
 int size()
          Getst the number of objects stored and available.
 void start()
          Will get the file path value (if not already set will just use the default setting) and will create the directory specified by the file path if it does not already exist.
 void stop()
          This will allow for change of file suffix and file path and then may start again using these new values.
 

Method Detail

size

public int size()
Getst the number of objects stored and available.

Returns:

getNext

public Object getNext()
               throws IOException
Will look through the files in the store directory for the oldest object serialized to disk, load it, delete the file, and return the deserialized object. Important to note that once this object is returned from this method, it is gone forever from this store and will not be able to retrieve it again without adding it back.

Returns:
Throws:
IOException

add

public void add(Serializable object)
         throws IOException
Persists the serializable object passed to the directory specified. The file name will be the current time in milliseconds (vis System.currentTimeMillis()) with the specified suffix. This object can later be retrieved using the getNext() method, but objects will be returned in the order that they were added (FIFO).

Parameters:
object -
Throws:
IOException

setConfig

public void setConfig(Map config)
Will use the values in the map to set configuration.

Parameters:
config -

start

public void start()
           throws Exception
Will get the file path value (if not already set will just use the default setting) and will create the directory specified by the file path if it does not already exist.

Throws:
Exception

stop

public void stop()
This will allow for change of file suffix and file path and then may start again using these new values. However, any object already written out using the old values will be lost as will not longer be accessible if these attributes are changed while stopped.


create

public void create()
            throws Exception
This is a no op method, but needed in order to be used as a service within JBoss AS.

Throws:
Exception

destroy

public void destroy()
This is a no op method, but needed in order to be used as a service within JBoss AS.


setPurgeOnShutdown

public void setPurgeOnShutdown(boolean purgeOnShutdown)
Sets if store should clean up persisted files when shutdown (destroy()).

Parameters:
purgeOnShutdown -

getPurgeOnShutdown

public boolean getPurgeOnShutdown()
Returns if store will clean up persisted files when shutdown (destroy()).

Returns:

purgeFiles

public void purgeFiles()


Copyright © 2004 JBoss Inc. All Rights Reserved.