public class HookManager
extends java.lang.Object
The EnginePlugin's onMessage() callback processes an incoming message by calling into its local HookManager and finding all matching hooks for the incoming message's message type for all the hooks. For each matching hook, it calls the hook's processMessage() method.
Constructor and Description |
---|
HookManager()
Normally created by the EnginePlugin class.
|
Modifier and Type | Method and Description |
---|---|
void |
addHook(MessageType msgType,
Hook hook)
Adds a hook to the HookManager.
|
java.util.List<Hook> |
getHooks(MessageType msgType)
Returns this list of all hooks matching the message type.
|
void |
removeHook(MessageType msgType,
Hook hook)
Remove hook from the hook manager.
|
public HookManager()
public void addHook(MessageType msgType, Hook hook)
msgType
- the message type to matchhook
- the hook to be called for matching messagesEnginePlugin.handleMessageImpl(atavism.msgsys.Message, int)
public void removeHook(MessageType msgType, Hook hook)
public java.util.List<Hook> getHooks(MessageType msgType)
msgType
- the message type to match