org.jboss.remoting
Class NullCallbackStore

java.lang.Object
  extended byorg.jboss.remoting.NullCallbackStore
All Implemented Interfaces:
java.io.Serializable, SerializableStore (src)

public class NullCallbackStore
extends java.lang.Object
implements SerializableStore (src) , java.io.Serializable

This implementation does nothing other than throw away persisted objects and throw exceptions. This is to be use when don't have a proper store or don't care about throwing away callbacks when starting to run out of memory.

See Also:
Serialized Form

Nested Class Summary
 class NullCallbackStore.FailedCallback (src)
           
 
Constructor Summary
NullCallbackStore()
           
 
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)
          No op
 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()
          No op
 void stop()
          No op
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullCallbackStore

public NullCallbackStore()
Method Detail

size

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

Specified by:
size in interface SerializableStore (src)
Returns:

getNext

public java.lang.Object getNext()
                         throws java.io.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.

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

add

public void add(java.io.Serializable object)
         throws java.io.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).

Specified by:
add in interface SerializableStore (src)
Parameters:
object -
Throws:
java.io.IOException

setConfig

public void setConfig(java.util.Map config)
No op

Specified by:
setConfig in interface SerializableStore (src)
Parameters:
config -

start

public void start()
           throws java.lang.Exception
No op

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

stop

public void stop()
No op

Specified by:
stop in interface SerializableStore (src)

create

public void create()
            throws java.lang.Exception
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 (src)
Throws:
java.lang.Exception

destroy

public void destroy()
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 (src)

setPurgeOnShutdown

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

Specified by:
setPurgeOnShutdown in interface SerializableStore (src)
Parameters:
purgeOnShutdown -

getPurgeOnShutdown

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

Specified by:
getPurgeOnShutdown in interface SerializableStore (src)
Returns:

purgeFiles

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