public class Agent<T> extends AgentBase<T>
currentThreadserialHandle| Constructor and Description |
|---|
Agent()
Creates a new Agent with the internal state set to null
|
Agent(T data)
Creates a new Agent around the supplied modifiable object
|
Agent(T data,
groovy.lang.Closure copy)
Creates a new Agent around the supplied modifiable object
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Agent<T> |
agent(T state)
Creates an agent instance initialized with the given state.
|
static <T> Agent<T> |
agent(T state,
groovy.lang.Closure copy)
Creates an agent instance initialized with the given state.
|
static <T> Agent<T> |
fairAgent(T state)
Creates an agent instance initialized with the given state, which will cooperate in thread sharing with other Agent instances
in a fair manner.
|
static <T> Agent<T> |
fairAgent(T state,
groovy.lang.Closure copy)
Creates an agent instance initialized with the given state, which will cooperate in thread sharing with other agents and actors in a fair manner.
|
java.lang.Class<RemoteAgent> |
getRemoteClass()
Class of remote object to be created
|
void |
handleMessage(java.lang.Object message)
Dynamically dispatches the method call
|
addListener, addValidator, await, getInstantVal, getVal, onMessage, onMessage, onMessage, sendAndWait, updateValue, valAsyncattachToThreadPool, call, getErrors, hasErrors, isFair, leftShift, makeFair, registerError, send, setPGroupcreateRemoteHandle, getOrCreateSerialHandle, writeReplacepublic Agent()
public Agent(T data)
data - The object to use for storing the internal state of the variablepublic Agent(T data, groovy.lang.Closure copy)
data - The object to use for storing the internal state of the variablecopy - A closure to use to create a copy of the internal state when sending the internal state outpublic void handleMessage(java.lang.Object message)
handleMessage in class AgentCoremessage - A value or a closurepublic static <T> Agent<T> agent(T state)
state - The initial internal state of the new Agent instancepublic static <T> Agent<T> agent(T state, groovy.lang.Closure copy)
state - The initial internal state of the new Agent instancecopy - A closure to use to create a copy of the internal state when sending the internal state outpublic static <T> Agent<T> fairAgent(T state)
state - The initial internal state of the new Agent instancepublic static <T> Agent<T> fairAgent(T state, groovy.lang.Closure copy)
state - The initial internal state of the new Agent instancecopy - A closure to use to create a copy of the internal state when sending the internal state outpublic java.lang.Class<RemoteAgent> getRemoteClass()
WithSerialIdgetRemoteClass in class WithSerialId