|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--springs.access.AccessService
The access service.
Nested Class Summary | |
(package private) class |
AccessService.RetryingGettingReference
Note: it seems that the searching could be improved by looking if it is among the local references outside the thread (in a way that we can avoid creating a thread every time): however, the reference could disappeared from the list of local references causing a fail that cannot be captured unless it is within the boundaries of a retrying task. |
Field Summary | |
protected springs.access.AgentReferencesUpdater |
_agentReferencesUpdater
The updater of remote references to agents. |
protected springs.access.LocalAgentReferencesCollector |
_larc
The collector of unused local references to agents. |
protected springs.access.LocalAgentReferences |
_localReferencesToAgents
Stores information about local references to agents. |
private java.lang.String |
_lockForSeach
|
protected java.util.Hashtable |
_referenceGetters
|
Constructor Summary | |
AccessService()
Constructor. |
Method Summary | |
void |
deleteAllReferencesTo(springs.agent.SpringsAgent agent,
java.lang.String localContextName)
Records the need of deleting the remote references to the given agent. |
springs.access.LocalAgentReferences |
getLocalReferencesToAgent()
Obtains the local references to the agents. |
int |
getNumberOfReferences()
Obtains the number of references. |
springs.access.AgentReference |
getReference(java.lang.String agentName)
Obtains a reference to an agent. |
springs.access.AgentReference |
getReference(java.lang.String agentName,
boolean registerAsObserver)
Obtains a reference to an agent by searching it remotely. |
springs.access.AgentReference |
getReferenceFromLocalAgents(java.lang.String agentName,
boolean mustBeAutomaticUpdate)
Gets a reference to a locally-executing agent. |
springs.access.AgentReference |
getReferenceFromTable(java.lang.String agentName)
Gets a reference searching only locally. |
void |
referenceUsed(java.lang.String agentName)
Notifies the context that a reference to the given agent has been used. |
void |
removeNeedToUpdateReferenceTo(java.lang.String agentName)
Removes the need to update the remote references to the given agent (e.g., because the agent has moved to another context). |
void |
removeReference(java.lang.String agentName)
Removes a reference to an agent. |
void |
terminate()
Shuts the access service down. |
void |
updateAllReferencesTo(springs.agent.SpringsAgent agent,
java.lang.String localContextName)
Records the need of updating the remote references to the given agent. |
void |
updateReference(java.lang.String agentName,
java.lang.String context,
int seqNum,
boolean youAreLocationServer,
long millisWhenCreated)
Updates the reference to the given agent. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected springs.access.LocalAgentReferences _localReferencesToAgents
LocalAgentReferences
protected springs.access.LocalAgentReferencesCollector _larc
LocalAgentReferencesCollector
protected springs.access.AgentReferencesUpdater _agentReferencesUpdater
AgentReferencesUpdater
protected java.util.Hashtable _referenceGetters
private java.lang.String _lockForSeach
Constructor Detail |
public AccessService()
Method Detail |
public springs.access.AgentReference getReference(java.lang.String agentName) throws AgentReferenceException
agentName
- the name of the agent.
AgentReferenceException
- if error.AgentReference
,
AgentReferenceException
public springs.access.AgentReference getReference(java.lang.String agentName, boolean registerAsObserver) throws AgentReferenceException
agentName
- the name of the agent.registerAsObserver
- a boolean indicating whether the context should register itself as
an observer for the agent.
AgentReferenceException
- if the agent cannot be found.AgentReference
,
AgentReferenceException
public int getNumberOfReferences()
public void updateReference(java.lang.String agentName, java.lang.String context, int seqNum, boolean youAreLocationServer, long millisWhenCreated)
agentName
- the agent name.context
- the context.seqNum
- a number to identify the sequence number for the current address of the agent.youAreLocationServer
- a boolean indicating whether this agent is a location server.millisWhenCreated
- the millis when the agent was created.String
public void removeReference(java.lang.String agentName)
agentName
- the name of the agent.String
public springs.access.LocalAgentReferences getLocalReferencesToAgent()
LocalAgentReferences
public void referenceUsed(java.lang.String agentName)
agentName
- the name of the agent.String
public void updateAllReferencesTo(springs.agent.SpringsAgent agent, java.lang.String localContextName)
agent
- the agent.localContextName
- the local context name.SpringsAgent
,
Vector
,
String
public void removeNeedToUpdateReferenceTo(java.lang.String agentName)
agentName
- the name of the agent.String
public void deleteAllReferencesTo(springs.agent.SpringsAgent agent, java.lang.String localContextName)
agent
- the agent.localContextName
- the local context name.SpringsAgent
,
Vector
public void terminate()
public springs.access.AgentReference getReferenceFromLocalAgents(java.lang.String agentName, boolean mustBeAutomaticUpdate)
agentName
- the name of the agent.mustBeAutomaticUpdate
- a boolean indicating whether the reference is required to be
updated automatically.
AgentReference
public springs.access.AgentReference getReferenceFromTable(java.lang.String agentName)
agentName
- the name of the agent.
AgentReference
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |