public abstract class AbstractEventHandler extends java.lang.Object implements EventHandler
EventHandler.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
consuming
Whether this handler may consume events.
|
protected boolean |
critical
Whether this handler is critical and failures should abort all event
handling.
|
protected boolean |
exclusive
Whether this handler needs to handle events exclusively.
|
protected java.lang.String |
id
The ID of this handler (usually the plugin ID).
|
protected boolean |
interruptible
Whether this event handler can be interrupted while handling an event.
|
protected java.util.logging.Logger |
logger
The logger for logging problems and various information.
|
| Constructor and Description |
|---|
AbstractEventHandler(Registry registry,
boolean exclusive,
boolean consuming,
boolean critical)
Creates a new event handler having the designated ID and the designated
flags.
|
AbstractEventHandler(Registry registry,
boolean exclusive,
boolean consuming,
boolean critical,
boolean interruptible)
Creates a new event handler having the designated ID and the designated
flags.
|
AbstractEventHandler(java.lang.String id,
boolean exclusive,
boolean consuming,
boolean critical)
Creates a new event handler having the designated ID and the designated
flags.
|
AbstractEventHandler(java.lang.String id,
boolean exclusive,
boolean consuming,
boolean critical,
boolean interruptible)
Creates a new event handler having the designated ID and the designated
flags.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getID()
Gets the ID of this event handler.
|
boolean |
isConsuming()
Gets whether this event handler is consuming and therefore may change or
consume an event while processing it.
|
boolean |
isCritical()
Gets whether this handler is critical and failures should abort all event
handling.
|
boolean |
isExclusive()
Gets whether this event handler is exclusive and thus no concurrent event
handling should take place while this handler is processing an event.
|
boolean |
isInterruptible()
Whether this event handler can be interrupted while handling an event.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandleEventprotected final java.util.logging.Logger logger
protected final java.lang.String id
protected final boolean exclusive
protected final boolean consuming
protected final boolean critical
protected final boolean interruptible
public AbstractEventHandler(java.lang.String id,
boolean exclusive,
boolean consuming,
boolean critical)
id - The ID of this handler (usually the plugin ID).exclusive - Whether this handler needs to handle events exclusively.
If this handler is consuming or critical, this parameter will be
ignored.consuming - Whether this handler may consume events. If the handler is
consuming, it is also exclusive.critical - Whether this handler is critical. If the handler is
critical, it will also be exclusive.public AbstractEventHandler(java.lang.String id,
boolean exclusive,
boolean consuming,
boolean critical,
boolean interruptible)
id - The ID of this handler (usually the plugin ID).exclusive - Whether this handler needs to handle events exclusively.
If this handler is consuming or critical, this parameter will be
ignored.consuming - Whether this handler may consume events. If the handler is
consuming, it is also exclusive.critical - Whether this handler is critical. If the handler is
critical, it will also be exclusive.interruptible - Whether this event handler can be interrupted while
handling an event.public AbstractEventHandler(Registry registry, boolean exclusive, boolean consuming, boolean critical)
registry - The registry to get the ID of this handler (the simple name
of the plugin instance).exclusive - Whether this handler needs to handle events exclusively.
If this handler is consuming or critical, this parameter will be
ignored.consuming - Whether this handler may consume events. If the handler is
consuming, it is also exclusive.critical - Whether this handler is critical. If the handler is
critical, it will also be exclusive.public AbstractEventHandler(Registry registry, boolean exclusive, boolean consuming, boolean critical, boolean interruptible)
registry - The registry to get the ID of this handler (the simple name
of the plugin instance).exclusive - Whether this handler needs to handle events exclusively.
If this handler is consuming or critical, this parameter will be
ignored.consuming - Whether this handler may consume events. If the handler is
consuming, it is also exclusive.critical - Whether this handler is critical. If the handler is
critical, it will also be exclusive.interruptible - Whether this event handler can be interrupted while
handling an event.public java.lang.String getID()
EventHandlergetID in interface EventHandlerpublic boolean isExclusive()
EventHandlerisExclusive in interface EventHandlerpublic boolean isConsuming()
EventHandlerisConsuming in interface EventHandlerpublic boolean isInterruptible()
EventHandlerisInterruptible in interface EventHandlerpublic boolean isCritical()