|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread lime.LimeTSMgr lime.LimeSystemTSMgr
Manages the Lime System Tuple Space.
Field Summary | |
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
|
static short |
DATA
|
static short |
DECLARE_LEADER
|
static short |
DISENGAGE_AGENT
|
static short |
DISENGAGE_HOST
|
static short |
ENGAGE_AGENT
|
static short |
ENGAGE_HOST
|
private static java.lang.String |
ERRMSG
|
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) Queue |
incomingEvents
|
(package private) Queue |
incomingOps
|
(package private) Queue |
incomingTransactionStarts
|
(package private) QueueWaiter |
incomingWaiter
|
static int |
INCOMMING_EVENTS_QUEUE
|
static int |
INCOMMING_OPS_QUEUE
|
static int |
INCOMMING_TRANSACTION_STARTS_QUEUE
|
static short |
ING
|
static short |
INITIATOR_REQ
|
static short |
INST_REACTS_TO
|
static short |
INST_REM_UPON_LISTENER
|
static short |
INST_UPON_LISTENER
|
(package private) boolean |
inTransaction
Indicates whether the tuple space is participating in a transaction. |
static short |
LOCAL_SYS_TAKE
|
static int |
MAX_ROUNDS
|
(package private) java.lang.String |
name
The name of the tuple space. |
(package private) static java.util.Hashtable |
namedTS
Holds tuple spaces keyed by their names. |
static short |
OUTG
|
(package private) java.util.Hashtable |
pendingWrite
Maps the sequence number to the TupleOpDescriptor. |
static short |
RDG
|
(package private) Reactor |
reactor
The local reactor. |
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
|
(package private) java.util.Hashtable |
replyTuples
Used for upon and reactions. |
static short |
REQUEST_TRANSACTION
|
(package private) java.util.Hashtable |
savedReactions
Used to reinstall the reaction of an upon of a waiting operation |
static short |
SET_HOST
|
static short |
SET_SHARED
|
static short |
SETUP
|
static short |
SETUP_SPECIAL
|
static short |
START
|
static short |
SYS_READ
|
static short |
SYS_REPLY
|
static short |
SYS_TAKE
|
(package private) static LimeSystemTSMgr |
sysMgr
The LimeSystemTupleSpace manager. |
static short |
TAKE
|
static short |
TRANSACTION_GRANTED
|
(package private) TransactionMgr |
transactionMgr
The transaction manager. |
static java.lang.String |
TS
|
static java.lang.String |
TS_GONE
|
static int |
TS_ID_TAG
|
(package private) lights.interfaces.ITupleSpace |
tupleSpace
A named tuple space. |
static int |
TYPE_TAG
|
static short |
UPON
|
static short |
UPON_EVENT
|
(package private) UponMgr |
upons
both pending and uninstalled upons... |
static java.lang.String |
VERSION
|
static short |
WAIT_TO_READ
|
static short |
WAIT_TO_TAKE
|
static short |
WRITE
|
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
(package private) |
LimeSystemTSMgr()
|
Method Summary | |
(package private) void |
addAgent(AgentID agent,
LimeServerID host)
|
(package private) void |
addAntiTuple(lights.interfaces.ITuple t)
|
(package private) void |
addHost(LimeServerID host)
|
private void |
addSystemTuple(lights.interfaces.ITuple t)
|
(package private) void |
addTupleSpace(java.lang.String tsname,
AgentID agent)
|
(package private) boolean |
contains(AgentID agent)
Returns whether or not the specific agent is in the current lime system. |
(package private) boolean |
contains(LimeServerID host)
Returns whether or not the specific host is in the current lime system. |
(package private) boolean |
containsAgents()
|
(package private) void |
doRemOutg(RemoteTupleOpDescriptor opDesc,
boolean sendAck)
Put the tuple that comes from remotely into the tuple space. |
(package private) void |
doSysReply(RemoteTupleOpDescriptor opDesc)
A SysReply message is the actual tuple being returned from the remote system. |
(package private) void |
doWait(TupleOpDescriptor opDesc)
Force the tuple to be looked for locally, then have a reaction installed if the tuple is not found |
(package private) AgentID[] |
getAgents(LimeServerID host)
Return an array containing the AgentID of each agent present on a given host. |
(package private) LimeServerID[] |
getAllHosts()
Return an array containing the LimeServerIDs of each host in the LSTS. |
(package private) java.lang.String |
getAntiTupleType(lights.interfaces.ITuple t)
|
(package private) LimeServerID |
getHost(AgentID agentID)
given an agentID, give the InetAddress of the host from |
(package private) LimeServerID |
getLeader()
Returns the LimeServerID of the host that is the leader of this group. |
(package private) static java.lang.String |
getOpType(short type)
Used for debugging purposes. |
(package private) RegisteredReaction[] |
getRemRegReactByAgent(AgentID subscriber)
|
(package private) Lock |
getTransactionLock()
|
(package private) java.lang.String[] |
getTupleSpaces(AgentID agent)
Return an array containing the name of the tuple spaces belonging to a given agent. |
(package private) java.lang.String[] |
getTupleSpaces(LimeServerID host)
Return an array containing the name of all the tuple spaces belonging to all the agents residing on the given host. |
(package private) boolean |
hasAnyAgents(LimeServerID host)
Returns true if the host as any agents. |
(package private) boolean |
hasAnyTupleSpaces(AgentID agent)
Returns true if the specified agent has any tuple spaces left in the shared space. |
(package private) boolean |
hasTupleSpace(AgentID agentID,
java.lang.String tsname)
given an agent id, look into the LSTS to see if the agent has the same named tuple space as this |
(package private) boolean |
hasTupleSpace(LimeServerID host,
java.lang.String tsname)
Returns true if the specified host has a tuple space with the specified name. |
(package private) boolean |
isAgentOnHost(AgentID agent,
LimeServerID host)
|
(package private) boolean |
isLastAgent(AgentID aID,
java.lang.String tsname)
Check whether a given agent is the last one that owns a given tuple space. |
(package private) void |
isolateLSTS()
remove all agents/tspaces/hosts not on this getServerID() |
private lights.interfaces.ITuple |
makeTemplate(java.lang.String type,
LimeServerID host,
AgentID aid,
java.lang.String tsname)
Makes a template. |
(package private) void |
mergeMisplaced(java.util.Vector tuples,
java.util.Vector upons)
|
(package private) lights.interfaces.ITuple[] |
mergePrivateWithPublic(LimeTupleSpace lts)
Called from the Transaction manager to merge the upons/reactions of a private tuple space into the public space, and to return the tuples which are to be handed to the reactor when the transaction is complete |
(package private) void |
performOp(OpDescriptor opDesc)
|
(package private) void |
postOp(LocalOpDescriptor opDesc)
Places operations into the INCOMMING_OPS_QUEUE queue. |
(package private) void |
printAgents()
|
(package private) void |
printHosts()
|
(package private) void |
printMisplacedTuples(java.util.Vector t)
Used for debugging purposes. |
(package private) lights.interfaces.ITuple |
readOrTakeTuple(short type,
lights.interfaces.ITuple template)
read or take a tuple (based on the type passed) from the tuple space of this manager |
(package private) short |
relativeLocation(lights.interfaces.IField locField,
java.lang.String tsname)
|
(package private) short |
relativeLocation(Location loc,
java.lang.String tsname)
Figure out whether the location parameter is a host or agent, then specifically the type of host or agent. |
(package private) void |
removeAgent(AgentID agent)
|
(package private) void |
removeHost(LimeServerID host)
Removes a host tuple from the tuple space, replaces it with its antituple. |
(package private) void |
removeTupleSpace(java.lang.String tsname,
AgentID agent)
|
void |
run()
|
(package private) static lights.interfaces.ITuple[] |
takeTupleSpaceProjection(lights.interfaces.ITupleSpace ts,
AgentID[] agents,
int index)
Returns the set of tuples that represent a given projection of the tuple space. |
(package private) void |
writeSystemTuple(lights.interfaces.ITuple t)
|
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final java.lang.String ERRMSG
public static final int INCOMMING_EVENTS_QUEUE
public static final int INCOMMING_OPS_QUEUE
public static final int INCOMMING_TRANSACTION_STARTS_QUEUE
static java.util.Hashtable namedTS
Queue incomingOps
Queue incomingEvents
Queue incomingTransactionStarts
QueueWaiter incomingWaiter
boolean inTransaction
TransactionMgr transactionMgr
static LimeSystemTSMgr sysMgr
lights.interfaces.ITupleSpace tupleSpace
Reactor reactor
java.util.Hashtable savedReactions
java.util.Hashtable replyTuples
java.util.Hashtable pendingWrite
java.lang.String name
UponMgr upons
public static final java.lang.String VERSION
public static final short WRITE
public static final short OUTG
public static final short REM_OUTG_ACK
public static final short TAKE
public static final short WAIT_TO_TAKE
public static final short ING
public static final short READ
public static final short WAIT_TO_READ
public static final short RDG
public static final short REACTS_TO
public static final short UPON
public static final short REMOVE_REACTS_TO
public static final short REMOVE_UPON
public static final short INST_REACTS_TO
public static final short INST_UPON_LISTENER
public static final short INST_REM_UPON_LISTENER
public static final short REMOVE_REM_UPON_LISTENER
public static final short REM_SYS_TAKE
public static final short REM_SYS_READ
public static final short REM_ING
public static final short REM_RDG
public static final short SYS_TAKE
public static final short SYS_READ
public static final short REM_OUTG
public static final short UPON_EVENT
public static final short SYS_REPLY
public static final short LOCAL_SYS_TAKE
public static final short SET_SHARED
public static final short SET_HOST
public static final short DECLARE_LEADER
public static final short ENGAGE_AGENT
public static final short ENGAGE_HOST
public static final short DISENGAGE_AGENT
public static final short DISENGAGE_HOST
public static final short GO
public static final short INITIATOR_REQ
public static final short SETUP
public static final short READY
public static final short START
public static final short DATA
public static final short SETUP_SPECIAL
public static final short READY_SPECIAL
public static final short REQUEST_TRANSACTION
public static final short TRANSACTION_GRANTED
public static final short HOST_BYE
public static final short HOST_HELLO
public static final short AGENT_BYE
public static final short AGENT_HELLO
public static final short HOST_LOCALHOST
public static final short HOST_REMOTE
public static final short HOST_NOTINSYS
public static final short HOST_UNSPECIFIED
public static final short AGENT_LOCALHOST
public static final short AGENT_REMOTE
public static final short AGENT_NOTINSYS
public static final short AGENT_UNSPECIFIED
public static final int TYPE_TAG
public static final int HOST_TUPLE_HOST_TAG
public static final int HOST_ADDR_TAG
public static final int AGENT_ID_TAG
public static final int TS_ID_TAG
public static final java.lang.String HOST
public static final java.lang.String AGENT
public static final java.lang.String TS
public static final java.lang.String HOST_GONE
public static final java.lang.String AGENT_GONE
public static final java.lang.String TS_GONE
public static final int MAX_ROUNDS
Constructor Detail |
LimeSystemTSMgr()
Method Detail |
void doWait(TupleOpDescriptor opDesc) throws lights.interfaces.TupleSpaceException, java.io.IOException
doWait
in class LimeTSMgr
opDesc
- the waiting operation to be performed
lights.interfaces.TupleSpaceException
java.io.IOException
LimeServerID[] getAllHosts()
AgentID[] getAgents(LimeServerID host)
LimeServerID getHost(AgentID agentID)
agentID
- a value of type 'AgentID'
lights.interfaces.TupleSpaceException
- if an error occursjava.lang.String[] getTupleSpaces(AgentID agent)
java.lang.String[] getTupleSpaces(LimeServerID host)
void addHost(LimeServerID host)
void addAgent(AgentID agent, LimeServerID host)
void addTupleSpace(java.lang.String tsname, AgentID agent)
private void addSystemTuple(lights.interfaces.ITuple t) throws lights.interfaces.TupleSpaceException
lights.interfaces.TupleSpaceException
void writeSystemTuple(lights.interfaces.ITuple t)
void removeHost(LimeServerID host)
void removeAgent(AgentID agent)
void removeTupleSpace(java.lang.String tsname, AgentID agent)
void addAntiTuple(lights.interfaces.ITuple t)
java.lang.String getAntiTupleType(lights.interfaces.ITuple t)
boolean contains(AgentID agent)
agent
- the agent's AgentID
boolean contains(LimeServerID host)
host
- the hosts's LimeServerID
boolean hasTupleSpace(AgentID agentID, java.lang.String tsname)
agentID
- a value of type 'AgentID'tsname
- a name of a tuple space
lights.interfaces.TupleSpaceException
- if an error occursboolean hasTupleSpace(LimeServerID host, java.lang.String tsname)
boolean containsAgents()
boolean isAgentOnHost(AgentID agent, LimeServerID host)
boolean hasAnyTupleSpaces(AgentID agent)
agent
- a value of type 'AgentID'boolean hasAnyAgents(LimeServerID host)
boolean isLastAgent(AgentID aID, java.lang.String tsname)
private lights.interfaces.ITuple makeTemplate(java.lang.String type, LimeServerID host, AgentID aid, java.lang.String tsname)
void isolateLSTS()
LimeServerID getLeader()
short relativeLocation(Location loc, java.lang.String tsname)
loc
- Any location, host or agent
lights.interfaces.TupleSpaceException
- if an error occursshort relativeLocation(lights.interfaces.IField locField, java.lang.String tsname)
void printHosts()
void printAgents()
public void run()
run
in interface java.lang.Runnable
void postOp(LocalOpDescriptor opDesc)
void performOp(OpDescriptor opDesc) throws lights.interfaces.TupleSpaceException, java.io.IOException
lights.interfaces.TupleSpaceException
java.io.IOException
void doSysReply(RemoteTupleOpDescriptor opDesc)
opDesc
- the returned remote opearation descriptor, containing the
tuple copy and sequence numbervoid doRemOutg(RemoteTupleOpDescriptor opDesc, boolean sendAck) throws lights.interfaces.TupleSpaceException
opDesc
- the opearation containing the tuple to be writtensendAck
- if this method is called from a transaction, the ack should not be sent, otherwise the ack should be sent.
lights.interfaces.TupleSpaceException
- if an error occurslights.interfaces.ITuple readOrTakeTuple(short type, lights.interfaces.ITuple template)
type
- WAIT_TO_READ, SYS_READ, REM_SYS_READ, or the corresponding
TAKE operationstemplate
- the template to mbe matched
static lights.interfaces.ITuple[] takeTupleSpaceProjection(lights.interfaces.ITupleSpace ts, AgentID[] agents, int index) throws TupleSpaceEngineException, lights.interfaces.TupleSpaceException
ts
- the tuple space to be searched for.agents
- the array of agents to look for.index
- the field index that must be matched.
TupleSpaceEngineException(tse)
TupleSpaceEngineException
lights.interfaces.TupleSpaceException
Lock getTransactionLock()
lights.interfaces.ITuple[] mergePrivateWithPublic(LimeTupleSpace lts) throws TupleSpaceEngineException
lts
- the previously public tuple space to be made public
TupleSpaceEngineException
void mergeMisplaced(java.util.Vector tuples, java.util.Vector upons) throws TupleSpaceEngineException
TupleSpaceEngineException
RegisteredReaction[] getRemRegReactByAgent(AgentID subscriber)
void printMisplacedTuples(java.util.Vector t)
static java.lang.String getOpType(short type)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |