org.jboss.remoting.callback
Class CallbackStoreWrapper

java.lang.Object
  extended by org.jboss.remoting.callback.CallbackStoreWrapper
All Implemented Interfaces:
SerializableStore

public class CallbackStoreWrapper
extends java.lang.Object
implements SerializableStore

A CallbackStoreWrapper is used to wrap an MBean proxy that implements org.jboss.remoting.SerializableStore. If necessary, each call will go through an AccessController.doPrivileged() call.

Version:
$Revision: 1.1 $

Copyright May 5, 2008

Author:
Ron Sigal

Constructor Summary
CallbackStoreWrapper(SerializableStore proxy)
           
 
Method Summary
 void add(java.io.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.
 java.lang.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(java.util.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallbackStoreWrapper

public CallbackStoreWrapper(SerializableStore proxy)
Method Detail

add

public void add(java.io.Serializable object)
         throws java.io.IOException
Description copied from interface: SerializableStore
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).

Specified by:
add in interface SerializableStore
Throws:
java.io.IOException

create

public void create()
            throws java.lang.Exception
Description copied from interface: SerializableStore
This is a no op method, but needed in order to be used as a service within JBoss AS.

Specified by:
create in interface SerializableStore
Throws:
java.lang.Exception

destroy

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

Specified by:
destroy in interface SerializableStore

getNext

public java.lang.Object getNext()
                         throws java.io.IOException
Description copied from interface: SerializableStore
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.

Specified by:
getNext in interface SerializableStore
Returns:
Throws:
java.io.IOException

getPurgeOnShutdown

public boolean getPurgeOnShutdown()
Description copied from interface: SerializableStore
Returns if store will clean up persisted files when shutdown (destroy()).

Specified by:
getPurgeOnShutdown in interface SerializableStore
Returns:

purgeFiles

public void purgeFiles()
Specified by:
purgeFiles in interface SerializableStore

setConfig

public void setConfig(java.util.Map config)
Description copied from interface: SerializableStore
Will use the values in the map to set configuration.

Specified by:
setConfig in interface SerializableStore

setPurgeOnShutdown

public void setPurgeOnShutdown(boolean purgeOnShutdown)
Description copied from interface: SerializableStore
Sets if store should clean up persisted files when shutdown (destroy()).

Specified by:
setPurgeOnShutdown in interface SerializableStore

size

public int size()
Description copied from interface: SerializableStore
Getst the number of objects stored and available.

Specified by:
size in interface SerializableStore
Returns:

start

public void start()
           throws java.lang.Exception
Description copied from interface: SerializableStore
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.

Specified by:
start in interface SerializableStore
Throws:
java.lang.Exception

stop

public void stop()
Description copied from interface: SerializableStore
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.

Specified by:
stop in interface SerializableStore


Copyright ? 1998-2005 JBoss Inc . All Rights Reserved.