|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.server.core.comm.KnownAgents
public class KnownAgents
Maintains a list of agents by holding string representations of their remote endpoints. This class implementation is thread safe. Note that this class does not know agents by their name - only by their remote endpoints!
| Constructor Summary | |
|---|---|
KnownAgents()
Constructor for KnownAgents. |
|
| Method Summary | |
|---|---|
boolean |
addAgent(org.jboss.remoting.InvokerLocator endpoint)
Adds the given remote endpoint to the list of known agents. |
boolean |
addAgent(String endpoint)
Adds the given remote endpoint to the list of known agents. |
org.jboss.remoting.InvokerLocator |
getAgent(String host,
int port)
Given a specific host and port, this will return the associated agent. |
List<org.jboss.remoting.InvokerLocator> |
getAllAgents()
Returns a list of all the known agents. |
boolean |
removeAgent(org.jboss.remoting.InvokerLocator endpoint)
Removes the given remote endpoint from the list of known agents. |
boolean |
removeAgent(String endpoint)
Removes the given remote endpoint from the list of known agents. |
void |
removeAllAgents()
Empties the internal list of agents. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public KnownAgents()
KnownAgents.
| Method Detail |
|---|
public boolean addAgent(org.jboss.remoting.InvokerLocator endpoint)
endpoint - the endpoint to add if it refers to an agent
true if the endpoint was an agent and it was added; false if the endpoint was
not an agent and nothing was added to the internal list of known agentspublic boolean addAgent(String endpoint)
endpoint is a String so you can call this
method by directly using a value from Agent.getRemoteEndpoint().
endpoint - the endpoint to add if it refers to an agent
true if the endpoint was an agent and it was added; false if the endpoint was
not an agent and nothing was added to the internal list of known agents
RuntimeException - if the endpoint was malformed and invalidpublic boolean removeAgent(org.jboss.remoting.InvokerLocator endpoint)
false.
endpoint - the endpoint to remove
true if the agent existed and was removed; false otherwisepublic boolean removeAgent(String endpoint)
false. The given endpoint is a String so
you can call this method by directly using a value from Agent.getRemoteEndpoint().
endpoint - the endpoint to remove
true if the agent existed and was removed; false otherwise
RuntimeException - if the endpoint was malformed and invalid
public org.jboss.remoting.InvokerLocator getAgent(String host,
int port)
host - the host of the agent to retrieveport - the port of the agent to retrieve
null if no known agent exists in the listpublic List<org.jboss.remoting.InvokerLocator> getAllAgents()
public void removeAllAgents()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||