org.pasoa.storage.memory
Class MemoryStorage

java.lang.Object
  extended by org.pasoa.storage.memory.MemoryStorage
All Implemented Interfaces:
BackendStore, Cache, Management, Record, Retrieval

public class MemoryStorage
extends Object
implements BackendStore


Field Summary
 
Fields inherited from interface org.pasoa.common.Record
ACTOR_STATE_PA, INTERACTION_PA, RELATIONSHIP_PA, SUBMISSION_FINISHED
 
Constructor Summary
MemoryStorage()
           
 
Method Summary
 void cache(CacheableItem ci)
           
 boolean cacheEnabled()
           
 void delete()
           
 CacheableItem getCachedItem()
          Returns some item that has been cached.
 InteractionRecord getInteractionRecord(long index)
          Retrieve the message exchange at the given index
 long getNumberOfInteractionRecords()
          Get the number of message exchanges available.
 void record(GlobalPAssertionKey gpid, Element asserter, Element assertion, String kindOfAssertion)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryStorage

public MemoryStorage()
Method Detail

record

public void record(GlobalPAssertionKey gpid,
                   Element asserter,
                   Element assertion,
                   String kindOfAssertion)
            throws Exception
Specified by:
record in interface Record
Throws:
Exception

cacheEnabled

public boolean cacheEnabled()
Specified by:
cacheEnabled in interface Cache

cache

public void cache(CacheableItem ci)
           throws Exception
Specified by:
cache in interface Cache
Throws:
Exception

getCachedItem

public CacheableItem getCachedItem()
                            throws Exception
Description copied from interface: Cache
Returns some item that has been cached. No order is guranteed. Returns null if there are no CachableItems left in the cache. !!! When a cached item is gotten from the cache, it is removed from the cache and not longer exists there.

Specified by:
getCachedItem in interface Cache
Returns:
Throws:
Exception

getInteractionRecord

public InteractionRecord getInteractionRecord(long index)
                                       throws Exception
Description copied from interface: Retrieval
Retrieve the message exchange at the given index

Specified by:
getInteractionRecord in interface Retrieval
Throws:
Exception

getNumberOfInteractionRecords

public long getNumberOfInteractionRecords()
                                   throws Exception
Description copied from interface: Retrieval
Get the number of message exchanges available.

Specified by:
getNumberOfInteractionRecords in interface Retrieval
Throws:
Exception

shutdown

public void shutdown()
              throws Exception
Specified by:
shutdown in interface Management
Throws:
Exception

delete

public void delete()
            throws Exception
Specified by:
delete in interface Management
Throws:
Exception