public class AMQPAgent extends Agent
AMQPAgent
is responsible of the communications with other Joram
AMQP servers.Modifier and Type | Field and Description |
---|---|
private static Map<Long,Long> |
lockers
contains the lock Object to notify.
|
static org.objectweb.util.monolog.api.Logger |
logger
logger
|
private static Map<Long,Object> |
responses
contains the async response.
|
private static long |
serialVersionUID
serialVersionUID
|
static StubAgentIn |
stubAgentIn |
static StubAgentOut |
stubAgentOut |
agentProfiling, emptyString, fixed, logmon
BOOLEAN_ENCODED_SIZE, BYTE_ENCODED_SIZE, DOUBLE_ENCODED_SIZE, FLOAT_ENCODED_SIZE, INT_ENCODED_SIZE, LONG_ENCODED_SIZE, SHORT_ENCODED_SIZE
Constructor and Description |
---|
AMQPAgent()
Empty constructor for newInstance().
|
Modifier and Type | Method and Description |
---|---|
void |
agentFinalize(boolean lastTime)
Finalizes the agent before it is garbaged.
|
protected void |
agentInitialize(boolean firstTime)
Gives this agent an opportunity to initialize after having been deployed,
and each time it is loaded into memory.
|
static AgentId |
getAMQPId(short serverId)
get destination AgentId of AMQPAgent.
|
static Object |
getResponse(long lock) |
static void |
putResponse(AgentId from,
long lock,
Object response) |
void |
react(AgentId from,
Notification not)
Distributes the received notifications to the appropriate reactions.
|
static void |
sendRequestTo(Object request,
short serverId,
long proxyId,
Long keyLock)
send AMQP request to serverId AMQP agent.
|
private void |
sendRestart() |
agentSave, decode, delete, delete, delete, deploy, deploy, encode, getAgentId, getCommitTime, getEncodableClassId, getEncodedSize, getId, getLogTopic, getName, getReactNb, getReactTime, hasName, isAgentProfiling, isDeployed, isFixed, isUpdated, needToBeCommited, resetCommitTime, resetReactTime, resetTimer, save, sendTo, sendTo, sendTo, setAgentProfiling, setName, setNoSave, setSave, toString
private static final long serialVersionUID
public static org.objectweb.util.monolog.api.Logger logger
public static StubAgentIn stubAgentIn
public static StubAgentOut stubAgentOut
protected void agentInitialize(boolean firstTime) throws Exception
agentInitialize
in class Agent
firstTime
- true when first called by the factoryException
- unspecialized exceptionpublic void agentFinalize(boolean lastTime)
agentFinalize
in class Agent
lastTime
- true when last called by the factory on agent deletion.public void react(AgentId from, Notification not) throws Exception
public static AgentId getAMQPId(short serverId)
serverId
- destination server Id.public static void sendRequestTo(Object request, short serverId, long proxyId, Long keyLock)
request
- the request to sendserverId
- destination server Id.keyLock
- the locker Object for synchronous call or null for async.public static void putResponse(AgentId from, long lock, Object response)
lock
- response
- public static Object getResponse(long lock)
lock
- private void sendRestart()
Copyright © 2015 ScalAgent D.T.. All Rights Reserved.