public final class RemoteAgents extends LocalHost
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.ConcurrentMap<java.lang.String,Agent<?>> |
publishedAgents
Stores Agents published in context of this instance of RemoteAgents.
|
private java.util.concurrent.ConcurrentMap<java.lang.String,DataflowVariable<RemoteAgent>> |
remoteAgents
Stores promises to remote instances of Agents.
|
remoteHosts
id
Modifier | Constructor and Description |
---|---|
private |
RemoteAgents() |
Modifier and Type | Method and Description |
---|---|
static RemoteAgents |
create() |
<T> T |
get(java.lang.Class<T> klass,
java.lang.String name) |
Promise<RemoteAgent> |
get(java.lang.String host,
int port,
java.lang.String name)
Retrieves
Agent published under specified name on remote host. |
void |
publish(Agent<?> agent,
java.lang.String name)
Publishes
Agent under given name. |
<T> void |
registerProxy(java.lang.Class<T> klass,
java.lang.String name,
T object) |
disconnect, getPromise, getSerialHost, onDisconnect, startServer, stopServer
add, finalizeHandle, get, getId, remove
private final java.util.concurrent.ConcurrentMap<java.lang.String,Agent<?>> publishedAgents
private final java.util.concurrent.ConcurrentMap<java.lang.String,DataflowVariable<RemoteAgent>> remoteAgents
public void publish(Agent<?> agent, java.lang.String name)
Agent
under given name.
It overrides previously published Agent if the same name is given.agent
- the Agent to be publishedname
- the name under which Agent is publishedpublic Promise<RemoteAgent> get(java.lang.String host, int port, java.lang.String name)
Agent
published under specified name on remote host.host
- the address of remote hostport
- the port of remote hostname
- the name under which Agent was publishedRemoteAgent
public static RemoteAgents create()
public <T> void registerProxy(java.lang.Class<T> klass, java.lang.String name, T object)
registerProxy
in class LocalHost