Package org.apache.wiki.event
Enum WikiEventEmitter
- java.lang.Object
-
- java.lang.Enum<WikiEventEmitter>
-
- org.apache.wiki.event.WikiEventEmitter
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<WikiEventEmitter>
public enum WikiEventEmitter extends java.lang.Enum<WikiEventEmitter>
Emits all kind ofWikiEvent
s.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
attach(WikiEventListener listener)
Registers aWikiEventListener
so it listens events fired from theWikiEventEmitter
instance.static WorkflowEvent
fireWorkflowEvent(java.lang.Object src, int type)
Fires a Workflow Event from provided source and workflow type.static WorkflowEvent
fireWorkflowEvent(java.lang.Object src, int type, java.lang.Object... args)
Fires a Workflow Event from provided source and workflow type.static WikiEventEmitter
get()
static void
register(WikiEventListener listener)
Registers aWikiEventListener
so it listens events fired from theWikiEventEmitter
instance.static WikiEventEmitter
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static WikiEventEmitter[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final WikiEventEmitter INSTANCE
-
-
Method Detail
-
values
public static WikiEventEmitter[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (WikiEventEmitter c : WikiEventEmitter.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static WikiEventEmitter valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
get
public static WikiEventEmitter get()
-
fireWorkflowEvent
public static WorkflowEvent fireWorkflowEvent(java.lang.Object src, int type)
Fires a Workflow Event from provided source and workflow type.- Parameters:
src
- the source of the event, which can be any object: a wiki page, group or authentication/authentication/group manager.type
- the type of event- Returns:
- fired
WorkflowEvent
ornull
if theWikiEventEmitter
instance hasn't listeners attached.
-
fireWorkflowEvent
public static WorkflowEvent fireWorkflowEvent(java.lang.Object src, int type, java.lang.Object... args)
Fires a Workflow Event from provided source and workflow type.- Parameters:
src
- the source of the event, which can be any object: a wiki page, group or authentication/authentication/group manager.type
- the type of event- Returns:
- fired
WorkflowEvent
ornull
if theWikiEventEmitter
instance hasn't listeners attached.
-
attach
public static void attach(WikiEventListener listener)
Registers aWikiEventListener
so it listens events fired from theWikiEventEmitter
instance. Every otherWikiEventListener
of the same type, listening events from theWikiEventEmitter
instance will stop listening events from it. This ensures events received by theWikiEventListener
will only process the events once.- Parameters:
listener
-WikiEventListener
-
register
public static void register(WikiEventListener listener)
Registers aWikiEventListener
so it listens events fired from theWikiEventEmitter
instance. Events received by theWikiEventListener
could process the events more than once or, several instances of the sameWikiEventListener
would be able to receive the same event.- Parameters:
listener
-WikiEventListener
-
-