|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleafchat.core.api.BasicMsgOwner
public abstract class BasicMsgOwner
Utility class that implements most of MsgOwner (assuming you are going to let the system handle target registration).
Constructor Summary | |
---|---|
BasicMsgOwner()
|
Method Summary | |
---|---|
boolean |
allowExternalDispatch(Msg m)
Called if somebody tries to dispatch a message other than via the MessageDispatch class |
MessageDispatch |
getDispatch()
|
void |
init(MessageDispatch md)
Called once the dispatcher is registered. |
void |
manualDispatch(Msg m)
Called when the dispatcher should handle manual dispatch of a message (to all targets for which it returned false in registerTarget). |
boolean |
registerTarget(java.lang.Object target,
java.lang.Class<? extends Msg> message,
MessageFilter mf,
int requestID,
int priority)
Called when a new target registers to receive messages from this class. |
void |
unregisterTarget(java.lang.Object target,
int requestID)
Called when a target unregisters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface leafchat.core.api.MsgOwner |
---|
getFriendlyName, getMessageClass |
Constructor Detail |
---|
public BasicMsgOwner()
Method Detail |
---|
public MessageDispatch getDispatch()
public boolean allowExternalDispatch(Msg m)
MsgOwner
allowExternalDispatch
in interface MsgOwner
m
- Message for dispatch
public void init(MessageDispatch md)
MsgOwner
init
in interface MsgOwner
md
- Provided by the system to handle message dispatch from this
dispatcherpublic void manualDispatch(Msg m)
MsgOwner
It is up to the message owner to handle 'stopped' messages (m.isStopped) and not pass them on to further targets.
manualDispatch
in interface MsgOwner
m
- Message being sentpublic boolean registerTarget(java.lang.Object target, java.lang.Class<? extends Msg> message, MessageFilter mf, int requestID, int priority)
MsgOwner
registerTarget
in interface MsgOwner
target
- Targetmessage
- Class of desired message (null = all)mf
- Filter (may be null)requestID
- ID associated with this request (used in unregister)priority
- Priority for message
public void unregisterTarget(java.lang.Object target, int requestID)
MsgOwner
unregisterTarget
in interface MsgOwner
target
- TargetrequestID
- Identifier of the request to be removed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |