Package ch.ivyteam.ivy.event
Class SystemEvent<P>
java.lang.Object
ch.ivyteam.ivy.event.SystemEvent<P>
- Type Parameters:
P
- the type of the optional parameter
Events that are created and sent by and through the ivy System,
usually by calling
ISystemEventDispatcher.sendSystemEvent(SystemEvent)
.
They can be used, e.g., for internal message servicing.
System events may (but must not necessarily) be supplied with a token, which can be verified by the dispatcher. The dispatcher may prohibit the sending of System events if they cannot provide an appropriate token.
SystemEvent
s have broadcast character, they are never targeted
at a specific receiver. Therefore the category can only tell about the
source of the event.
- API:
- This is a public API.
-
Constructor Summary
ConstructorDescriptionSystemEvent
(SystemEventCategory category, String name) Creates a newSystemEvent
.SystemEvent
(SystemEventCategory category, String name, P parameter) Creates a newSystemEvent
with an optional parameter object.SystemEvent
(SystemEventCategory category, String name, P parameter, Object token) Creates a newSystemEvent
with an optional parameter object and an optional token. -
Method Summary
Modifier and TypeMethodDescriptionGets the event category.getName()
Gets the name of the event (should be unique within the category).Gets the optional event parameter object.
-
Constructor Details
-
SystemEvent
Creates a newSystemEvent
.- Parameters:
category
- the event categoryname
- the name of the event (should be unique for the category)- Throws:
NullPointerException
- if category or name are null- API:
- This public API is available in Java.
-
SystemEvent
Creates a newSystemEvent
with an optional parameter object.- Parameters:
category
- the event categoryname
- the name of the event (should be unique for the category)parameter
- an optional parameter object- Throws:
NullPointerException
- if category or name are null- API:
- This public API is available in Java.
-
SystemEvent
Creates a newSystemEvent
with an optional parameter object and an optional token.The token is typically checked and removed by the
ISystemEventDispatcher
.- Parameters:
category
- the event categoryname
- the name of the event (should be unique for the category)parameter
- an optional parameter objecttoken
- an optional token to be evaluated by theISystemEventDispatcher
- Throws:
NullPointerException
- if category or name are null- API:
- This public API is available in Java.
-
-
Method Details
-
getCategory
Gets the event category.- Returns:
- the category
- API:
- This public API is available in Java.
-
getName
Gets the name of the event (should be unique within the category).- Returns:
- the name
- API:
- This public API is available in Java.
-
getParameter
Gets the optional event parameter object.- Returns:
- the parameter (may be null)
- API:
- This public API is available in Java.
-