lime
Class InitiatorTransDescriptor

java.lang.Object
  extended bylime.TransDescriptor
      extended bylime.InitiatorTransDescriptor
All Implemented Interfaces:
LimeConstants

class InitiatorTransDescriptor
extends TransDescriptor

A descriptor of a transaction for the host that initiated the transaction.


Field Summary
(package private)  AgentID agent
          The agent that initiated the transaction (AGENT_HELLO,AGENT_BYE).
static java.lang.String AGENT
           
static short AGENT_BYE
           
static java.lang.String AGENT_GONE
           
static short AGENT_HELLO
           
static int AGENT_ID_TAG
           
static short AGENT_LOCALHOST
           
static short AGENT_NOTINSYS
           
static short AGENT_REMOTE
           
static short AGENT_UNSPECIFIED
           
(package private)  java.util.Hashtable agents
          Hashtable of agents.
static short DATA
           
static short DECLARE_LEADER
           
static short DISENGAGE_AGENT
           
static short DISENGAGE_HOST
           
static short ENGAGE_AGENT
           
static short ENGAGE_HOST
           
static short GO
           
static java.lang.String HOST
           
static int HOST_ADDR_TAG
           
static short HOST_BYE
           
static java.lang.String HOST_GONE
           
static short HOST_HELLO
           
static short HOST_LOCALHOST
           
static short HOST_NOTINSYS
           
static short HOST_REMOTE
           
static int HOST_TUPLE_HOST_TAG
           
static short HOST_UNSPECIFIED
           
(package private)  java.util.Hashtable hostsAgents
          The hashtable from each host to a hashtable of its agents and TSs.
(package private)  java.util.Vector hostsDataReceived
          LimeServers from which a DATA message has been received.
(package private)  java.util.Vector hostsDataSent
          LimeServers to which DATA message has been sent This is used only during host engagements.
static short ING
           
static short INITIATOR_REQ
           
static short INST_REACTS_TO
           
static short INST_REM_UPON_LISTENER
           
static short INST_UPON_LISTENER
           
static short LOCAL_SYS_TAKE
           
(package private)  Result lock
          The lock used by the transaction.
(package private)  java.util.Hashtable lstsHostAgents
           
(package private)  LimeTupleSpace[] lts
          The tuple spaces owned by the agent involved in the transaction
private  java.util.Hashtable ltsH
          Maps a name of the tuple space to the LimeTupleSpace (which contains the ITupleSpace).
static int MAX_ROUNDS
           
private  java.util.Hashtable namedTS
          Maps a name of the tuple space to the ITupleSpace.
static short OUTG
           
static short RDG
           
static short REACTS_TO
           
static short READ
           
static short READY
           
static short READY_SPECIAL
           
static short REM_ING
           
static short REM_OUTG
           
static short REM_OUTG_ACK
           
static short REM_RDG
           
static short REM_SYS_READ
           
static short REM_SYS_TAKE
           
static short REMOVE_REACTS_TO
           
static short REMOVE_REM_UPON_LISTENER
           
static short REMOVE_UPON
           
static short REQUEST_TRANSACTION
           
static short SET_HOST
           
static short SET_SHARED
           
static short SETUP
           
static short SETUP_SPECIAL
           
(package private)  LimeServerID source
          The ID of the LimeServer on which this transaction was created.
static short START
           
static short SYS_READ
           
static short SYS_REPLY
           
static short SYS_TAKE
           
static short TAKE
           
(package private)  TransactionID tid
          The transaction identifier.
static short TRANSACTION_GRANTED
           
(package private)  short transType
          AGENT_HELLO, AGENT_BYE, HOST_HELLO, HOST_BYE
static java.lang.String TS
           
static java.lang.String TS_GONE
           
static int TS_ID_TAG
           
static int TYPE_TAG
           
static short UPON
           
static short UPON_EVENT
           
static java.lang.String VERSION
           
static short WAIT_TO_READ
           
static short WAIT_TO_TAKE
           
static short WRITE
           
 
Constructor Summary
(package private) InitiatorTransDescriptor(TransactionOpDescriptor desc, LimeTupleSpace[] lts, Result lock)
          Creates an InitiatorTransDescriptor for the specified transaction.
 
Method Summary
(package private)  void addEngagingTuples(java.lang.String tsName, lights.interfaces.ITuple[] newTups)
           
(package private)  AgentID[] getDepartingAgents()
          Returns an array of AgentIDs that represent the agents that are departing.
(package private)  lights.interfaces.ITuple[] getEngagingTuples(java.lang.String tsName)
          returns the tuples that are to be added as a result of the current transaction.
(package private)  LimeServerID[] getHostsDataExpected()
          Returns an array of LimeServerIDs representing the hosts from which this transaction is expecting data from.
(package private)  Result getLock()
          Returns the lock held within this object.
(package private)  java.util.Hashtable getLTS()
          Returns a hashtable that maps the name of the tuple space to the LimeTupleSpace.
(package private)  java.util.Hashtable getNamedTS()
          Returns a hashtable that maps the name of the tuple space to the ITupleSpace.
(package private)  boolean isSource()
          Returns true if the LimeServer on this JVM is the one that initiated the transaction.
(package private)  boolean isTransDone()
          Returns true if the transaction is completed.
(package private)  int numHostsDataExpected()
          Returns the number of hosts this transaction is expecting data messges from.
(package private)  void setHostsDataExpected(LimeServerID[] ids)
          Sets the host data expected variable within this calss.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lts

LimeTupleSpace[] lts
The tuple spaces owned by the agent involved in the transaction


lock

Result lock
The lock used by the transaction.


lstsHostAgents

java.util.Hashtable lstsHostAgents

namedTS

private java.util.Hashtable namedTS
Maps a name of the tuple space to the ITupleSpace.


ltsH

private java.util.Hashtable ltsH
Maps a name of the tuple space to the LimeTupleSpace (which contains the ITupleSpace).


transType

short transType
AGENT_HELLO, AGENT_BYE, HOST_HELLO, HOST_BYE


source

LimeServerID source
The ID of the LimeServer on which this transaction was created.


tid

TransactionID tid
The transaction identifier.


agent

AgentID agent
The agent that initiated the transaction (AGENT_HELLO,AGENT_BYE).


agents

java.util.Hashtable agents
Hashtable of agents.


hostsDataReceived

java.util.Vector hostsDataReceived
LimeServers from which a DATA message has been received. This is used only during engagements.


hostsDataSent

java.util.Vector hostsDataSent
LimeServers to which DATA message has been sent This is used only during host engagements.


hostsAgents

java.util.Hashtable hostsAgents
The hashtable from each host to a hashtable of its agents and TSs. This is used only during host engagements.


VERSION

public static final java.lang.String VERSION
See Also:
Constant Field Values

WRITE

public static final short WRITE
See Also:
Constant Field Values

OUTG

public static final short OUTG
See Also:
Constant Field Values

REM_OUTG_ACK

public static final short REM_OUTG_ACK
See Also:
Constant Field Values

TAKE

public static final short TAKE
See Also:
Constant Field Values

WAIT_TO_TAKE

public static final short WAIT_TO_TAKE
See Also:
Constant Field Values

ING

public static final short ING
See Also:
Constant Field Values

READ

public static final short READ
See Also:
Constant Field Values

WAIT_TO_READ

public static final short WAIT_TO_READ
See Also:
Constant Field Values

RDG

public static final short RDG
See Also:
Constant Field Values

REACTS_TO

public static final short REACTS_TO
See Also:
Constant Field Values

UPON

public static final short UPON
See Also:
Constant Field Values

REMOVE_REACTS_TO

public static final short REMOVE_REACTS_TO
See Also:
Constant Field Values

REMOVE_UPON

public static final short REMOVE_UPON
See Also:
Constant Field Values

INST_REACTS_TO

public static final short INST_REACTS_TO
See Also:
Constant Field Values

INST_UPON_LISTENER

public static final short INST_UPON_LISTENER
See Also:
Constant Field Values

INST_REM_UPON_LISTENER

public static final short INST_REM_UPON_LISTENER
See Also:
Constant Field Values

REMOVE_REM_UPON_LISTENER

public static final short REMOVE_REM_UPON_LISTENER
See Also:
Constant Field Values

REM_SYS_TAKE

public static final short REM_SYS_TAKE
See Also:
Constant Field Values

REM_SYS_READ

public static final short REM_SYS_READ
See Also:
Constant Field Values

REM_ING

public static final short REM_ING
See Also:
Constant Field Values

REM_RDG

public static final short REM_RDG
See Also:
Constant Field Values

SYS_TAKE

public static final short SYS_TAKE
See Also:
Constant Field Values

SYS_READ

public static final short SYS_READ
See Also:
Constant Field Values

REM_OUTG

public static final short REM_OUTG
See Also:
Constant Field Values

UPON_EVENT

public static final short UPON_EVENT
See Also:
Constant Field Values

SYS_REPLY

public static final short SYS_REPLY
See Also:
Constant Field Values

LOCAL_SYS_TAKE

public static final short LOCAL_SYS_TAKE
See Also:
Constant Field Values

SET_SHARED

public static final short SET_SHARED
See Also:
Constant Field Values

SET_HOST

public static final short SET_HOST
See Also:
Constant Field Values

DECLARE_LEADER

public static final short DECLARE_LEADER
See Also:
Constant Field Values

ENGAGE_AGENT

public static final short ENGAGE_AGENT
See Also:
Constant Field Values

ENGAGE_HOST

public static final short ENGAGE_HOST
See Also:
Constant Field Values

DISENGAGE_AGENT

public static final short DISENGAGE_AGENT
See Also:
Constant Field Values

DISENGAGE_HOST

public static final short DISENGAGE_HOST
See Also:
Constant Field Values

GO

public static final short GO
See Also:
Constant Field Values

INITIATOR_REQ

public static final short INITIATOR_REQ
See Also:
Constant Field Values

SETUP

public static final short SETUP
See Also:
Constant Field Values

READY

public static final short READY
See Also:
Constant Field Values

START

public static final short START
See Also:
Constant Field Values

DATA

public static final short DATA
See Also:
Constant Field Values

SETUP_SPECIAL

public static final short SETUP_SPECIAL
See Also:
Constant Field Values

READY_SPECIAL

public static final short READY_SPECIAL
See Also:
Constant Field Values

REQUEST_TRANSACTION

public static final short REQUEST_TRANSACTION
See Also:
Constant Field Values

TRANSACTION_GRANTED

public static final short TRANSACTION_GRANTED
See Also:
Constant Field Values

HOST_BYE

public static final short HOST_BYE
See Also:
Constant Field Values

HOST_HELLO

public static final short HOST_HELLO
See Also:
Constant Field Values

AGENT_BYE

public static final short AGENT_BYE
See Also:
Constant Field Values

AGENT_HELLO

public static final short AGENT_HELLO
See Also:
Constant Field Values

HOST_LOCALHOST

public static final short HOST_LOCALHOST
See Also:
Constant Field Values

HOST_REMOTE

public static final short HOST_REMOTE
See Also:
Constant Field Values

HOST_NOTINSYS

public static final short HOST_NOTINSYS
See Also:
Constant Field Values

HOST_UNSPECIFIED

public static final short HOST_UNSPECIFIED
See Also:
Constant Field Values

AGENT_LOCALHOST

public static final short AGENT_LOCALHOST
See Also:
Constant Field Values

AGENT_REMOTE

public static final short AGENT_REMOTE
See Also:
Constant Field Values

AGENT_NOTINSYS

public static final short AGENT_NOTINSYS
See Also:
Constant Field Values

AGENT_UNSPECIFIED

public static final short AGENT_UNSPECIFIED
See Also:
Constant Field Values

TYPE_TAG

public static final int TYPE_TAG
See Also:
Constant Field Values

HOST_TUPLE_HOST_TAG

public static final int HOST_TUPLE_HOST_TAG
See Also:
Constant Field Values

HOST_ADDR_TAG

public static final int HOST_ADDR_TAG
See Also:
Constant Field Values

AGENT_ID_TAG

public static final int AGENT_ID_TAG
See Also:
Constant Field Values

TS_ID_TAG

public static final int TS_ID_TAG
See Also:
Constant Field Values

HOST

public static final java.lang.String HOST
See Also:
Constant Field Values

AGENT

public static final java.lang.String AGENT
See Also:
Constant Field Values

TS

public static final java.lang.String TS
See Also:
Constant Field Values

HOST_GONE

public static final java.lang.String HOST_GONE
See Also:
Constant Field Values

AGENT_GONE

public static final java.lang.String AGENT_GONE
See Also:
Constant Field Values

TS_GONE

public static final java.lang.String TS_GONE
See Also:
Constant Field Values

MAX_ROUNDS

public static final int MAX_ROUNDS
See Also:
Constant Field Values
Constructor Detail

InitiatorTransDescriptor

InitiatorTransDescriptor(TransactionOpDescriptor desc,
                         LimeTupleSpace[] lts,
                         Result lock)
Creates an InitiatorTransDescriptor for the specified transaction.

Parameters:
desc - the transaction's descriptor.
lts - the LimeTupleSpaces involved in this transaction.
lock - the lock used by the transaction.
Method Detail

getLock

Result getLock()
Returns the lock held within this object.

Returns:
the lock held within this object.

getLTS

java.util.Hashtable getLTS()
Returns a hashtable that maps the name of the tuple space to the LimeTupleSpace.

Returns:
a hashtable that maps the name of the tuple space to the LimeTupleSpace.

getNamedTS

java.util.Hashtable getNamedTS()
Returns a hashtable that maps the name of the tuple space to the ITupleSpace.

Returns:
a hashtable that maps the name of the tuple space to the ITupleSpace.

getHostsDataExpected

LimeServerID[] getHostsDataExpected()
Returns an array of LimeServerIDs representing the hosts from which this transaction is expecting data from.


setHostsDataExpected

void setHostsDataExpected(LimeServerID[] ids)
Sets the host data expected variable within this calss.


numHostsDataExpected

int numHostsDataExpected()
Returns the number of hosts this transaction is expecting data messges from.


isSource

boolean isSource()
Returns true if the LimeServer on this JVM is the one that initiated the transaction.


addEngagingTuples

void addEngagingTuples(java.lang.String tsName,
                       lights.interfaces.ITuple[] newTups)

getEngagingTuples

lights.interfaces.ITuple[] getEngagingTuples(java.lang.String tsName)
returns the tuples that are to be added as a result of the current transaction. These are the tuples that should be reacted to

Parameters:
tsName - the tuple space name
Returns:
a vector of tuples (no longer misplaced)

isTransDone

boolean isTransDone()
Returns true if the transaction is completed.

Returns:
true if the transaction is completed.

getDepartingAgents

AgentID[] getDepartingAgents()
Returns an array of AgentIDs that represent the agents that are departing.

Returns:
an array of AgentIDs that represent the agents that are departing.