Package jade.imtp.leap
Class BackEndStub
- java.lang.Object
-
- jade.imtp.leap.MicroStub
-
- jade.imtp.leap.BackEndStub
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jade.imtp.leap.MicroStub
MicroStub.PostponedCommand
-
-
Field Summary
-
Fields inherited from class jade.imtp.leap.MicroStub
logger, MINIMUM_TIMEOUT, myDispatcher, pendingCommands
-
-
Constructor Summary
Constructors Constructor Description BackEndStub(Dispatcher d, Properties props)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidappendProp(StringBuffer sb, String key, String val)StringbornAgent(String name)Notify the BackEnd container that a new agent is born.voiddeadAgent(String name)Notify the BackEnd container that an agent has died.static StringBufferencodeCreateMediatorRequest(Properties pp)The method encodes the create mediator request, setting all the common properties retrived in the passed property parameter.protected voidhandlePostponedCommandExpired(Command c, ICPException exception)voidmessageOut(ACLMessage msg, String sender)Pass an ACLMessage to the BackEnd for dispatching.static voidparseCreateMediatorResponse(String responseMessage, Properties pp)voidresumedAgent(String name)Notify the BackEnd container that an agent has resumed.ObjectserviceInvokation(String actor, String serviceName, String methodName, Object[] methodParams)Pass a service helper method invocation request to the BackEndvoidsuspendedAgent(String name)Notify the BackEnd container that an agent has suspended.-
Methods inherited from class jade.imtp.leap.MicroStub
checkFlush, endFlush, executeRemotely, flush, isEmpty
-
-
-
-
Constructor Detail
-
BackEndStub
public BackEndStub(Dispatcher d, Properties props)
-
-
Method Detail
-
bornAgent
public String bornAgent(String name) throws JADESecurityException, IMTPException
Description copied from interface:BackEndNotify the BackEnd container that a new agent is born.- Specified by:
bornAgentin interfaceBackEnd- Parameters:
name- The name of the new agent.- Returns:
- The name actually assigned to the newly born agent.
- Throws:
JADESecurityExceptionIMTPException
-
deadAgent
public void deadAgent(String name) throws IMTPException
Description copied from interface:BackEndNotify the BackEnd container that an agent has died. Note that this does not throw NotFoundException as, if the BackEnd does not contain an AgentImage for the deadAgent it just ignores the call.- Specified by:
deadAgentin interfaceBackEnd- Parameters:
name- The name of the dead agent.- Throws:
IMTPException
-
suspendedAgent
public void suspendedAgent(String name) throws NotFoundException, IMTPException
Description copied from interface:BackEndNotify the BackEnd container that an agent has suspended.- Specified by:
suspendedAgentin interfaceBackEnd- Parameters:
name- The name of the suspended agent.- Throws:
NotFoundExceptionIMTPException
-
resumedAgent
public void resumedAgent(String name) throws NotFoundException, IMTPException
Description copied from interface:BackEndNotify the BackEnd container that an agent has resumed.- Specified by:
resumedAgentin interfaceBackEnd- Parameters:
name- The name of the resumed agent.- Throws:
NotFoundExceptionIMTPException
-
messageOut
public void messageOut(ACLMessage msg, String sender) throws NotFoundException, IMTPException
Description copied from interface:BackEndPass an ACLMessage to the BackEnd for dispatching.- Specified by:
messageOutin interfaceBackEnd- Parameters:
msg- The message to be dispatched.sender- The name of the sender agent.- Throws:
NotFoundExceptionIMTPException
-
serviceInvokation
public Object serviceInvokation(String actor, String serviceName, String methodName, Object[] methodParams) throws NotFoundException, ServiceException, IMTPException
Description copied from interface:BackEndPass a service helper method invocation request to the BackEnd- Specified by:
serviceInvokationin interfaceBackEnd- Parameters:
actor- The name of the agent that invoked the methodserviceName- The name of the servicemethodName- The name of the invoked methodmethodParams- The parameters of the invoked methods as an array of Objects- Returns:
- the result of the invoked method or
nullif the method returnsvoid - Throws:
NotFoundExceptionServiceExceptionIMTPException
-
handlePostponedCommandExpired
protected void handlePostponedCommandExpired(Command c, ICPException exception)
- Overrides:
handlePostponedCommandExpiredin classMicroStub
-
parseCreateMediatorResponse
public static final void parseCreateMediatorResponse(String responseMessage, Properties pp)
-
encodeCreateMediatorRequest
public static final StringBuffer encodeCreateMediatorRequest(Properties pp)
The method encodes the create mediator request, setting all the common properties retrived in the passed property parameter.- Parameters:
pp-- Returns:
- a StringBuffer to allow the dispatcher to add dispatcher specific properties.
-
appendProp
public static void appendProp(StringBuffer sb, String key, String val)
-
-