// CREATE AGENT
if (action instanceof CreateAgent) {
theAMS.createAgentAction((CreateAgent) action, request.getSender(), requesterPrincipal, requesterCredentials);
String agentName = JADEManagementOntology.adjustAgentName(((CreateAgent) action).getAgentName(), new String[] {((CreateAgent) action).getContainer().getName()});
asynchNotificationKey = new AID(agentName, AID.ISLOCALNAME);
}
// KILL AGENT (asynchronous notification to requester)
else if (action instanceof KillAgent) {
theAMS.killAgentAction((KillAgent) action, request.getSender(), requesterPrincipal, requesterCredentials);
asynchNotificationKey = ((KillAgent) action).getAgent();
}
// CLONE AGENT (asynchronous notification to requester)
// Note that CloneAction extends MoveAction --> must be considered first!!!
else if (action instanceof CloneAction) {
theAMS.cloneAgentAction((CloneAction) action, request.getSender());
asynchNotificationKey = new AID(((CloneAction) action).getNewName(), AID.ISLOCALNAME);
}
// MOVE AGENT (asynchronous notification to requester)
else if (action instanceof MoveAction) {
theAMS.moveAgentAction((MoveAction) action, request.getSender());
asynchNotificationKey = ((MoveAction) action).getMobileAgentDescription().getName();