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 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.

SystemEvents 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 Details

    • SystemEvent

      public SystemEvent(SystemEventCategory category, String name)
      Creates a new SystemEvent.
      Parameters:
      category - the event category
      name - 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

      public SystemEvent(SystemEventCategory category, String name, P parameter)
      Creates a new SystemEvent with an optional parameter object.
      Parameters:
      category - the event category
      name - 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

      public SystemEvent(SystemEventCategory category, String name, P parameter, Object token)
      Creates a new SystemEvent with an optional parameter object and an optional token.

      The token is typically checked and removed by the ISystemEventDispatcher.

      Parameters:
      category - the event category
      name - the name of the event (should be unique for the category)
      parameter - an optional parameter object
      token - an optional token to be evaluated by the ISystemEventDispatcher
      Throws:
      NullPointerException - if category or name are null
      API:
      This public API is available in Java.
  • Method Details

    • getCategory

      public SystemEventCategory getCategory()
      Gets the event category.
      Returns:
      the category
      API:
      This public API is available in Java.
    • 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 Java.
    • getParameter

      public P getParameter()
      Gets the optional event parameter object.
      Returns:
      the parameter (may be null)
      API:
      This public API is available in Java.