public class HookMessage extends ObjectMessage<HookMessage.AgentActionEvent>
|Modifier and Type||Class and Description|
Enumeration representing agent actions that could be monitored using hooks.
|Constructor and Description|
This message should be used to request or release a hook on an agent action.
public HookMessage(HookMessage.AgentActionEvent hookType)
In this example, the sender will be informed by the kernel of all successful requestRole operation made by the agents. This information will be transmitted using a subclass of HookMessage depending on the nature of the event. That is,
sendMessage( LocalCommunity.NAME, LocalCommunity.Groups.SYSTEM, Organization.GROUP_MANAGER_ROLE, new HookMessage(AgentActionEvent.REQUEST_ROLE));
AgentLifeEventmessages will be sent by the kernel according to the type of the hook which has been requested.
To give up the hook, just send to the kernel another message built with the same action and it will remove the sender from the subscriber list.
hookType- the action event type to monitor
Fabien Michel, Olivier Gutknecht, Jacques Ferber - February 17 2020