fabric.worker.remote
Class RemoteWorker

java.lang.Object
  extended by fabric.net.RemoteNode
      extended by fabric.worker.remote.RemoteWorker
All Implemented Interfaces:
java.io.Serializable

public final class RemoteWorker
extends RemoteNode

Encapsulates a remote worker. This class maintains the connection to the remote worker and manages all communication. RemoteWorkers can only be obtained through the RemoteCallManager.getWorker() interface. For each remote worker, there should be at most one RemoteWorker object representing that worker.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class fabric.net.RemoteNode
name
 
Constructor Summary
RemoteWorker(java.lang.String name)
          This should only be called by fabric.worker.Worker.
 
Method Summary
 void abortTransaction(TransactionID tid)
          Informs the remote worker that a transaction is aborting.
 boolean checkForStaleObjects(TransactionID tid)
          Asks the worker to check that the objects used in a given transaction are up-to-date.
 void commitTransaction(long tid)
           
 NodePrincipal getPrincipal()
           
 java.lang.Object issueRemoteCall(Object._Proxy receiver, java.lang.String methodName, java.lang.Class<?>[] parameterTypes, java.lang.Object[] args)
           
protected  SocketAddress lookup()
           
 boolean notifyObjectUpdate(long onum, ObjectGroup group)
          Notifies the worker that an object has been updated.
 boolean notifyObjectUpdate(java.lang.String store, long onum, Glob glob)
          Notifies the dissemination node at the given worker that an object has been updated.
 void prepareTransaction(long tid, long commitTime)
           
 void readObject(TransactionID tid, Object._Impl obj)
          Reads the given object from the remote worker, updating the object's state.
 Object._Impl readObject(TransactionID tid, Store store, long onum)
           
 void takeOwnership(TransactionID tid, Store store, long onum)
          Unsets the ownership bit for the given object at the remote worker.
 java.lang.String toString()
           
 
Methods inherited from class fabric.net.RemoteNode
cleanup, name, openStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteWorker

public RemoteWorker(java.lang.String name)
This should only be called by fabric.worker.Worker. If you want a RemoteWorker, use fabric.worker.Worker.getWorker() instead.

Method Detail

issueRemoteCall

public java.lang.Object issueRemoteCall(Object._Proxy receiver,
                                        java.lang.String methodName,
                                        java.lang.Class<?>[] parameterTypes,
                                        java.lang.Object[] args)
                                 throws UnreachableNodeException,
                                        RemoteCallException
Throws:
UnreachableNodeException
RemoteCallException

prepareTransaction

public void prepareTransaction(long tid,
                               long commitTime)
                        throws UnreachableNodeException,
                               TransactionPrepareFailedException
Throws:
UnreachableNodeException
TransactionPrepareFailedException

commitTransaction

public void commitTransaction(long tid)
                       throws UnreachableNodeException,
                              TransactionCommitFailedException
Throws:
UnreachableNodeException
TransactionCommitFailedException

abortTransaction

public void abortTransaction(TransactionID tid)
                      throws UnreachableNodeException
Informs the remote worker that a transaction is aborting.

Parameters:
tid - the tid for the transaction that is aborting.
Throws:
UnreachableNodeException

readObject

public void readObject(TransactionID tid,
                       Object._Impl obj)
Reads the given object from the remote worker, updating the object's state.

Parameters:
tid - the tid for the current transaction.

readObject

public Object._Impl readObject(TransactionID tid,
                               Store store,
                               long onum)

takeOwnership

public void takeOwnership(TransactionID tid,
                          Store store,
                          long onum)
Unsets the ownership bit for the given object at the remote worker.

Parameters:
tid - the tid for the current transaction.

getPrincipal

public NodePrincipal getPrincipal()
Returns:
the principal associated with the remote worker.

toString

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

notifyObjectUpdate

public boolean notifyObjectUpdate(java.lang.String store,
                                  long onum,
                                  Glob glob)
Notifies the dissemination node at the given worker that an object has been updated.

Returns:
whether the node is resubscribing to the object.

notifyObjectUpdate

public boolean notifyObjectUpdate(long onum,
                                  ObjectGroup group)
Notifies the worker that an object has been updated.

Returns:
whether the node is resubscribing to the object.

checkForStaleObjects

public boolean checkForStaleObjects(TransactionID tid)
Asks the worker to check that the objects used in a given transaction are up-to-date.


lookup

protected SocketAddress lookup()
                        throws java.io.IOException
Specified by:
lookup in class RemoteNode
Returns:
Throws:
java.io.IOException