org.jboss.remoting
Class NullCallbackStore

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

public class NullCallbackStore
extends Object
implements SerializableStore, 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.

Author:
Tom Elrod
See Also:
Serialized Form

Nested Class Summary
 class NullCallbackStore.FailedCallback
           
 
Constructor Summary
NullCallbackStore()
           
 
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)
          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
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.

Specified by:
getNext in interface SerializableStore
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).

Specified by:
add in interface SerializableStore
Parameters:
object -
Throws:
IOException

setConfig

public void setConfig(Map config)
No op

Specified by:
setConfig in interface SerializableStore
Parameters:
config -

start

public void start()
           throws Exception
No op

Specified by:
start in interface SerializableStore
Throws:
Exception

stop

public void stop()
No op

Specified by:
stop in interface SerializableStore

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.

Specified by:
create in interface SerializableStore
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.

Specified by:
destroy in interface SerializableStore

setPurgeOnShutdown

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

Specified by:
setPurgeOnShutdown in interface SerializableStore
Parameters:
purgeOnShutdown -

getPurgeOnShutdown

public boolean getPurgeOnShutdown()
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


Copyright © 2004 JBoss Inc. All Rights Reserved.