fabric.worker
Class LocalStore

java.lang.Object
  extended by fabric.worker.LocalStore
All Implemented Interfaces:
Store

public final class LocalStore
extends java.lang.Object
implements Store


Constructor Summary
protected LocalStore()
          The singleton LocalStore object is managed by the Worker class.
 
Method Summary
 void abortTransaction(boolean useAuthentication, TransactionID tid)
          Notifies the store that the transaction is being Aborted.
 void addLocalDelegation(Principal p, Principal q)
           
 void cache(Object._Impl impl)
          Adds the given object to the cache.
 boolean checkForStaleObjects(LongKeyMap<java.lang.Integer> reads)
          Determines whether the given set of objects are stale.
 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.
 boolean evict(long onum)
          Evicts the object with the given onum from cache.
 ConfPolicy getBottomConfidPolicy()
           
 IntegPolicy getBottomIntegPolicy()
           
 Label getEmptyLabel()
           
 NodePrincipal getPrincipal()
          Returns the NodePrincipal associated with this store.
 Label getPublicReadonlyLabel()
           
 Map getRoot()
          Returns the root map of the Store
 ConfPolicy getTopConfidPolicy()
           
 IntegPolicy getTopIntegPolicy()
           
 Principal getTopPrincipal()
           
 int hashCode()
           
 void initialize()
           
 boolean isLocalStore()
          Determines whether this is the local store.
 boolean localDelegatesTo(Principal p, Principal q)
           
 java.lang.String name()
          Returns this store's host name.
 boolean notifyEvict(long onum)
          Notifies this Store object that an _Impl has been evicted, so that it can perform the necessary cache maintenance.
 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)
          Notifies the store that the transaction is entering the Prepare phase.
 Object._Impl readObject(long onum)
          Returns the requested _Impl object.
 Object._Impl readObjectFromCache(long onum)
          Returns the requested _Impl object if it exists in the object cache.
 Object._Impl readObjectNoDissem(long onum)
          Returns the requested _Impl object, fetching it directly from the Store if it is not resident.
 void removeLocalDelegation(Principal p, Principal q)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocalStore

protected LocalStore()
The singleton LocalStore object is managed by the Worker class.

See Also:
fabric.worker.Worker.getLocalStore
Method Detail

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)
Description copied from interface: Store
Notifies the store that the transaction is entering the Prepare phase.

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

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
tid - the ID of the aborting transaction. This is assumed to specify a top-level transaction.

commitTransaction

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

Specified by:
commitTransaction in interface Store
transactionID - the ID of the transaction to commit

createOnum

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

Specified by:
createOnum in interface Store

readObject

public Object._Impl readObject(long onum)
Description copied from interface: Store
Returns the requested _Impl object. If the object is not resident, it is fetched from the Store via dissemination.

Specified by:
readObject in interface Store
Parameters:
onum - The identifier of the requested object
Returns:
The requested object

readObjectNoDissem

public Object._Impl readObjectNoDissem(long onum)
Description copied from interface: Store
Returns the requested _Impl object, fetching it directly from the Store if it is not resident.

Specified by:
readObjectNoDissem in interface Store
Parameters:
onum - The identifier of the requested object
Returns:
The requested object

readObjectFromCache

public Object._Impl readObjectFromCache(long onum)
Description copied from interface: Store
Returns the requested _Impl object if it exists in the object cache.

Specified by:
readObjectFromCache in interface Store
Parameters:
onum - The identifier of the requested object.
Returns:
The requested object if it exists in the object cache; otherwise, null.

checkForStaleObjects

public boolean checkForStaleObjects(LongKeyMap<java.lang.Integer> reads)
Description copied from interface: Store
Determines whether the given set of objects are stale.

Specified by:
checkForStaleObjects in interface Store
Returns:
true iff stale objects were found.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getRoot

public Map getRoot()
Description copied from interface: Store
Returns the root map of the Store

Specified by:
getRoot in interface Store

addLocalDelegation

public void addLocalDelegation(Principal p,
                               Principal q)

removeLocalDelegation

public void removeLocalDelegation(Principal p,
                                  Principal q)

localDelegatesTo

public boolean localDelegatesTo(Principal p,
                                Principal q)

getTopPrincipal

public Principal getTopPrincipal()

getTopConfidPolicy

public ConfPolicy getTopConfidPolicy()

getBottomConfidPolicy

public ConfPolicy getBottomConfidPolicy()

getTopIntegPolicy

public IntegPolicy getTopIntegPolicy()

getBottomIntegPolicy

public IntegPolicy getBottomIntegPolicy()

getEmptyLabel

public Label getEmptyLabel()

getPublicReadonlyLabel

public Label getPublicReadonlyLabel()

name

public java.lang.String name()
Description copied from interface: Store
Returns this store's host name.

Specified by:
name in interface Store

getPrincipal

public NodePrincipal getPrincipal()
Description copied from interface: Store
Returns the NodePrincipal associated with this store.

Specified by:
getPrincipal in interface Store

isLocalStore

public boolean isLocalStore()
Description copied from interface: Store
Determines whether this is the local store.

Specified by:
isLocalStore in interface Store

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

notifyEvict

public boolean notifyEvict(long onum)
Description copied from interface: Store
Notifies this Store object that an _Impl has been evicted, so that it can perform the necessary cache maintenance.

Specified by:
notifyEvict in interface Store
Parameters:
onum - Onum of the object that was evicted.
Returns:
true iff the onum was found in cache.

evict

public boolean evict(long onum)
Description copied from interface: Store
Evicts the object with the given onum from cache.

Specified by:
evict in interface Store
Returns:
true iff the onum was found in cache.

cache

public void cache(Object._Impl impl)
Description copied from interface: Store
Adds the given object to the cache.

Specified by:
cache in interface Store

initialize

public void initialize()