LiveGraph
data visualisation and analysis framework

org.LiveGraph.events
Enum SystemEvent

java.lang.Object
  extended by java.lang.Enum<SystemEvent>
      extended by org.LiveGraph.events.SystemEvent
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SystemEvent>, EventType

public enum SystemEvent
extends java.lang.Enum<SystemEvent>
implements EventType

The system level event types of the LiveGraph event engine are defined here.

LiveGraph (http://www.live-graph.org).

Copyright (c) 2007-2008 by G. Paperin.

File: SystemEvent.java

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following terms and conditions are met:

1. Redistributions of source code must retain the above acknowledgement of the LiveGraph project and its web-site, the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above acknowledgement of the LiveGraph project and its web-site, the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software or any derived software must display the following acknowledgement:
This product includes software developed by the LiveGraph project and its contributors.
(http://www.live-graph.org)

4. All advertising materials distributed in form of HTML pages or any other technology permitting active hyper-links that mention features or use of this software or any derived software must display the acknowledgment specified in condition 3 of this agreement, and in addition, include a visible and working hyper-link to the LiveGraph homepage (http://www.live-graph.org).

THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version:
"2.0.beta01"
Author:
Greg Paperin (http://www.paperin.org)

Enum Constant Summary
SYS_EventProcessingException
          Events of this type are raised by EventManager when an exception occurs during the processing of a LiveGraph event; events of this type are never validated.
SYS_NoOp
          Events if this type should not cause any action; such events may be used for housekeeping purposes such as to notifying the listeners that the event manager is active, pooling the event queue, measuring the event turnaround time, making sure that all events enqueued up to a certain point are processed or others.
 
Method Summary
static SystemEvent valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static SystemEvent[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SYS_EventProcessingException

public static final SystemEvent SYS_EventProcessingException

Events of this type are raised by EventManager when an exception occurs during the processing of a LiveGraph event; events of this type are never validated.

If an Exception occurs during the normal processing of an event by any EventListener, the exception is caught, saved, and the processing of the event by other listeners is continued. After all EventListeners have been invoked for any given event, and if any exceptions have occured during the processing of that event, all of these exceptions are wrapped into a single instance of EventProcessingException. That EventProcessingException is passed to the EventProducer that fired the event responsible for the exception using the EventProducer.eventProcessingException(Event, EventProcessingException)-callback. The producer may consume the exception (by returning true from the eventProcessingException-call) or ignore it (by returning false). If the exception is consumed, it will no longer be processed. If the exception is not consumed, the EventManager will print it to System.err and then raise an event of type SYS_EventProcessingException in a normal manner with the EventProcessingException as the event's getInfoObject()-parameter.
The purpose of this whole procedure is to make sure that the event dispathing does not break if an exception occurs and that the application has sufficient oportunity to handle exceptions.

If an Error (rather than an Exception) occurs during the normal processing of an event by any EventListener, the processing of that event is not continued by other listeners, as in the case of Exceptions and RuntimeExceptions. Instead, the processing of the current event is terminated, the error is wrapped in an instance of EventProcessingException, and then processed as described above.

If an exception or error occurs during the processing of a SYS_EventProcessingException-event, the EventManager will behave as described above, with the difference that no additional SYS_EventProcessingException-event will be raised.

The main event diapatching loop is protected by a try-catch-all block. It cannot be reminated by an event or by an exception/error in an event handler. If the application wishes to terminate the event dispatcher it must call EventManager.shutDownWhenFinished() or EventManager.shutDownImmediately(). However, in most cases the event dispatcher should never be accessed by an application directly (other than to raise events). API users should use LiveGraph.disposeGUIAndExit() to correctly free LiveGraph resources.

When issuing events of type SYS_EventProcessingException, EventManager initialises the event info parameters as follows:

Info parameter Value
getInfoBoolean() unspecified
getInfoLong() unspecified
getInfoDouble() unspecified
getInfoObject() The EventProcessingException object


SYS_NoOp

public static final SystemEvent SYS_NoOp
Events if this type should not cause any action; such events may be used for housekeeping purposes such as to notifying the listeners that the event manager is active, pooling the event queue, measuring the event turnaround time, making sure that all events enqueued up to a certain point are processed or others.
Info parameter Value
getInfoBoolean() unspecified
getInfoLong() unspecified
getInfoDouble() unspecified
getInfoObject() unspecified

Method Detail

values

public static SystemEvent[] 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 (SystemEvent c : SystemEvent.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SystemEvent 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 name
java.lang.NullPointerException - if the argument is null

LiveGraph
data visualisation and analysis framework