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
public class SystemEvent<P> extends Object
Events that are created and sent by and through the ivy System, usually by callingISystemEventDispatcher.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
Constructors Constructor Description SystemEvent(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SystemEventCategory
getCategory()
Gets the event category.String
getName()
Gets the name of the event (should be unique within the category).P
getParameter()
Gets the optional event parameter object.
-
-
-
Constructor Detail
-
SystemEvent
public SystemEvent(SystemEventCategory category, String name)
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 IvyScript and Java. It has the visibility NOVICE.
-
SystemEvent
public SystemEvent(SystemEventCategory category, String name, P parameter)
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 IvyScript and Java. It has the visibility NOVICE.
-
SystemEvent
public SystemEvent(SystemEventCategory category, String name, P parameter, Object token)
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 IvyScript and Java. It has the visibility NOVICE.
-
-
Method Detail
-
getCategory
public SystemEventCategory getCategory()
Gets the event category.- Returns:
- the category
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
-
getName
public String getName()
Gets the name of the event (should be unique within the category).- Returns:
- the name
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
-
getParameter
public P getParameter()
Gets the optional event parameter object.- Returns:
- the parameter (may be null)
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
-
-