|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.jaspira.plugin.EventModule
public abstract class EventModule
A module is a group of event handlers for Jaspira events.
Each module has a name which is the base name of all events it registers itself with.
In order to activate a module, install () has to be called. This is usually
done anonymously (new ModuleName ().install ()). A newly installed Module accepts
only one event $MODULENAME.activate, which installs the other eventreaction methods.
The names of receivable events are generated via introspection i.e. every public
method that reveives a JaspiraEvent (or subclass) parameter and returns an
Integer object is converted into a method receiver for "$MODULENAME.$Methodname".
If the method name contains any underscore characters, they are converted into dots
resulting in a noneNative event receiver WITHOUT prepending the Module-Name.
E.g.
public Integer model_model_selected (JaspiraEvent pe)
would be converted to a receiver for "model.model.selected".
Note that while a method can be in mixed case, the resulting event will
always be in lower case.
Any event that is received but not dispatched to an eventHandler will be
passed to handleUnaccountedEvent ().
| Field Summary | |
|---|---|
static JaspiraEventHandlerCode |
EVENT_CONSUMED
Event handler return code: The Event was consumed. |
static JaspiraEventHandlerCode |
EVENT_HANDLED
Event handler return code: The Event was noted. |
static JaspiraEventHandlerCode |
EVENT_IGNORED
Event handler return code: The Event was ignored. |
static int |
MODULE_POST_GLOBAL
Denotes a module that is to be executed after actual event passing has ended |
static int |
MODULE_PRE_GLOBAL
Denotes a module that is to be executed before actual event passing begins |
static int |
MODULE_TREE
Denotes a module that is to be executed inside of the plugin tree. |
| Constructor Summary | |
|---|---|
EventModule()
Create a new module. |
|
| Method Summary | |
|---|---|
boolean |
eventFired(JaspiraEvent je)
This method checks the incoming client event and forwards it to the corrresponding event handler method if there exists one. |
java.util.List |
getEventActionNames()
Returns a list of names of event actions. |
java.util.List |
getForeignEventNames()
Returns a list of the names of all foreign events that this module accepts. |
int |
getModuleType()
The module type determines the way the events of this module are handled. |
abstract java.lang.String |
getName()
The name of this module like "editor.file". |
int |
getPriority()
Gets the module priority. |
protected JaspiraEventHandlerCode |
handleUnaccountedEvent(JaspiraEvent pe)
This method is called when an event has been received that does not map to an event handler method of the module. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MODULE_TREE
public static final int MODULE_PRE_GLOBAL
public static final int MODULE_POST_GLOBAL
public static final JaspiraEventHandlerCode EVENT_IGNORED
public static final JaspiraEventHandlerCode EVENT_HANDLED
public static final JaspiraEventHandlerCode EVENT_CONSUMED
| Constructor Detail |
|---|
public EventModule()
| Method Detail |
|---|
public abstract java.lang.String getName()
public java.util.List getForeignEventNames()
public java.util.List getEventActionNames()
public int getModuleType()
MODULE_TREE/MODULE_PRE_GLOBAL/MODULE_POST_GLOBALprotected JaspiraEventHandlerCode handleUnaccountedEvent(JaspiraEvent pe)
pe - The client event
public boolean eventFired(JaspiraEvent je)
handleUnaccountedEvent(org.openbp.jaspira.event.JaspiraEvent)
method will be called.
eventFired in interface JaspiraEventListenerje - The client event
public int getPriority()
getPriority in interface JaspiraEventListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||