Search this API

y.module
Class ModuleEvent

java.lang.Object
  extended by java.util.EventObject
      extended by y.module.ModuleEvent
All Implemented Interfaces:
java.io.Serializable

public class ModuleEvent
extends java.util.EventObject

Event object used by YModule to notify ModuleListener instances of the current state of the running module.

See Also:
ModuleListener, YModule.addModuleListener(ModuleListener), Serialized Form
 

Field Summary
static short TYPE_MODULE_DISPOSED
          Constant used for events that are fired after the module's YModule.dispose() method ran (even if it got interrupted by an exception).
static short TYPE_MODULE_EXCEPTION_THROWN
          Constant used for events that are fired if the module threw an Exception or Throwable.
static short TYPE_MODULE_INITIALIZING
          Constant used for events that are fired before the module's YModule.init() method is invoked.
static short TYPE_MODULE_MAIN_RUN_FINISHED
          Constant used for events that are fired after the module's YModule.run() method has been invoked.
static short TYPE_MODULE_MAIN_RUN_STARTING
          Constant used for events that are fired before the module's YModule.run() method is invoked.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ModuleEvent(YModule source, short type)
          Creates a new instance of ModuleEvent with given type.
ModuleEvent(YModule source, java.lang.Throwable t)
          Creates a new instance of ModuleEvent with type TYPE_MODULE_EXCEPTION_THROWN using the given Throwable.
 
Method Summary
 short getEventType()
          Returns the type of the event.
 YModule getModule()
          Returns the module which fired the event.
 java.lang.Throwable getThrowable()
          Returns the associated Throwable if the type of this instance is TYPE_MODULE_EXCEPTION_THROWN.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_MODULE_INITIALIZING

public static final short TYPE_MODULE_INITIALIZING
Constant used for events that are fired before the module's YModule.init() method is invoked.

See Also:
Constant Field Values

TYPE_MODULE_MAIN_RUN_STARTING

public static final short TYPE_MODULE_MAIN_RUN_STARTING
Constant used for events that are fired before the module's YModule.run() method is invoked.

See Also:
Constant Field Values

TYPE_MODULE_MAIN_RUN_FINISHED

public static final short TYPE_MODULE_MAIN_RUN_FINISHED
Constant used for events that are fired after the module's YModule.run() method has been invoked.

See Also:
Constant Field Values

TYPE_MODULE_EXCEPTION_THROWN

public static final short TYPE_MODULE_EXCEPTION_THROWN
Constant used for events that are fired if the module threw an Exception or Throwable.

See Also:
Constant Field Values

TYPE_MODULE_DISPOSED

public static final short TYPE_MODULE_DISPOSED
Constant used for events that are fired after the module's YModule.dispose() method ran (even if it got interrupted by an exception).

See Also:
Constant Field Values
Constructor Detail

ModuleEvent

public ModuleEvent(YModule source,
                   java.lang.Throwable t)
Creates a new instance of ModuleEvent with type TYPE_MODULE_EXCEPTION_THROWN using the given Throwable.

See Also:
TYPE_MODULE_EXCEPTION_THROWN

ModuleEvent

public ModuleEvent(YModule source,
                   short type)
Creates a new instance of ModuleEvent with given type.

See Also:
TYPE_MODULE_INITIALIZING, TYPE_MODULE_MAIN_RUN_STARTING, TYPE_MODULE_MAIN_RUN_FINISHED, TYPE_MODULE_DISPOSED
Method Detail

getModule

public YModule getModule()
Returns the module which fired the event.


getEventType

public short getEventType()
Returns the type of the event.

See Also:
TYPE_MODULE_INITIALIZING, TYPE_MODULE_MAIN_RUN_STARTING, TYPE_MODULE_MAIN_RUN_FINISHED, TYPE_MODULE_DISPOSED, TYPE_MODULE_EXCEPTION_THROWN

getThrowable

public java.lang.Throwable getThrowable()
Returns the associated Throwable if the type of this instance is TYPE_MODULE_EXCEPTION_THROWN.


© Copyright 2000-2021,
yWorks GmbH.
All rights reserved.