fabric.store
Class InProcessStore

java.lang.Object
  extended by fabric.net.RemoteNode
      extended by fabric.worker.RemoteStore
          extended by fabric.store.InProcessStore
All Implemented Interfaces:
Store, java.io.Serializable

public class InProcessStore
extends RemoteStore

In-process implementation of the Store interface for use when a worker is running in-process with a Store. The operations work directly on the Store's TransactionManager object.

Author:
mdgeorge
See Also:
Serialized Form

Field Summary
protected  SurrogateManager sm
           
protected  TransactionManager tm
           
 
Fields inherited from class fabric.net.RemoteNode
name
 
Constructor Summary
InProcessStore(java.lang.String name, Node.Store c)
           
 
Method Summary
 void abortTransaction(boolean useAuthentication, TransactionID tid)
          Notifies the store that the transaction is being Aborted.
 void commitTransaction(boolean useAuthentication, long transactionID)
          Notifies the Store that the transaction should be committed.
 long createOnum()
          Obtains a new, unused object number from the Store.
protected  java.util.List<SerializedObject> getStaleObjects(LongKeyMap<java.lang.Integer> reads)
          Helper for checkForStaleObjects.
 boolean prepareTransaction(boolean useAuthentication, long tid, long commitTime, java.util.Collection<Object._Impl> toCreate, LongKeyMap<java.lang.Integer> reads, java.util.Collection<Object._Impl> writes)
          Sends a PREPARE message to the store.
 ObjectGroup readObjectFromStore(long onum)
          Goes to the store to get object.
 
Methods inherited from class fabric.worker.RemoteStore
cache, checkForStaleObjects, cleanup, clearCache, evict, getPrincipal, getPublicKey, getRoot, hashCode, isLocalStore, lookup, notifyEvict, readEncryptedObjectFromStore, readObject, readObjectFromCache, readObjectNoDissem, readResolve, reserve, toString, updateCache
 
Methods inherited from class fabric.net.RemoteNode
name, openStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface fabric.worker.Store
name
 

Field Detail

tm

protected final TransactionManager tm

sm

protected final SurrogateManager sm
Constructor Detail

InProcessStore

public InProcessStore(java.lang.String name,
                      Node.Store c)
Method Detail

abortTransaction

public void abortTransaction(boolean useAuthentication,
                             TransactionID tid)
Description copied from interface: Store
Notifies the store that the transaction is being Aborted.

Specified by:
abortTransaction in interface Store
Overrides:
abortTransaction in class RemoteStore
tid - the ID of the aborting transaction. This is assumed to specify a top-level transaction.

commitTransaction

public void commitTransaction(boolean useAuthentication,
                              long transactionID)
                       throws TransactionCommitFailedException
Description copied from interface: Store
Notifies the Store that the transaction should be committed.

Specified by:
commitTransaction in interface Store
Overrides:
commitTransaction in class RemoteStore
transactionID - the ID of the transaction to commit
Throws:
TransactionCommitFailedException

createOnum

public long createOnum()
Description copied from interface: Store
Obtains a new, unused object number from the Store.

Specified by:
createOnum in interface Store
Overrides:
createOnum in class RemoteStore

prepareTransaction

public boolean prepareTransaction(boolean useAuthentication,
                                  long tid,
                                  long commitTime,
                                  java.util.Collection<Object._Impl> toCreate,
                                  LongKeyMap<java.lang.Integer> reads,
                                  java.util.Collection<Object._Impl> writes)
                           throws TransactionPrepareFailedException
Description copied from class: RemoteStore
Sends a PREPARE message to the store.

Specified by:
prepareTransaction in interface Store
Overrides:
prepareTransaction in class RemoteStore
Returns:
whether a subtransaction was created on the store as a result of the prepare.
Throws:
TransactionPrepareFailedException

readObjectFromStore

public ObjectGroup readObjectFromStore(long onum)
                                throws FetchException
Description copied from class: RemoteStore
Goes to the store to get object.

Overrides:
readObjectFromStore in class RemoteStore
Parameters:
onum - The object number to fetch
Returns:
An ObjectGroup whose head object is the requested object.
Throws:
FetchException - if there was an error while fetching the object from the store.

getStaleObjects

protected java.util.List<SerializedObject> getStaleObjects(LongKeyMap<java.lang.Integer> reads)
Description copied from class: RemoteStore
Helper for checkForStaleObjects.

Overrides:
getStaleObjects in class RemoteStore