Search this API

y.module
Class ModuleListenerSupport

java.lang.Object
  extended by y.module.ModuleListenerSupport

public class ModuleListenerSupport
extends java.lang.Object

A support class used by YModule to manage the registered ModuleListeners.

 
Your browser does not support SVG content.

Constructor Summary
ModuleListenerSupport(YModule module)
          Initializes a new ModuleListenerSupport instance for the given module.
 
Method Summary
 void addModuleListener(ModuleListener listener)
          Adds the given module listener to receive module events from this instance.
 void fireExceptionThrown(java.lang.Throwable t)
          Propagates a module event of type ModuleEvent.TYPE_MODULE_EXCEPTION_THROWN to all registered ModuleListeners.
 void fireModuleDisposed()
          Propagates a module event of type ModuleEvent.TYPE_MODULE_DISPOSED to all registered ModuleListeners.
 void fireModuleEventHappened(ModuleEvent event)
          Notifies all registered listeners about the event.
 void fireModuleInitializing()
          Propagates a module event of type ModuleEvent.TYPE_MODULE_INITIALIZING to all registered ModuleListeners.
 void fireModuleMainRunFinished()
          Propagates a module event of type ModuleEvent.TYPE_MODULE_MAIN_RUN_FINISHED to all registered ModuleListeners.
 void fireModuleMainRunStarting()
          Propagates a module event of type ModuleEvent.TYPE_MODULE_MAIN_RUN_STARTING to all registered ModuleListeners.
 ModuleListener[] getModuleListeners()
          Returns all the module listeners that have been added to this support instance.
 boolean hasListeners()
          Returns whether or not there are module listeners associated with this class.
 void removeModuleListener(ModuleListener listener)
          Removes the given module listener so that it no longer receives module events from this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleListenerSupport

public ModuleListenerSupport(YModule module)
Initializes a new ModuleListenerSupport instance for the given module.

Parameters:
module - the module whose event handling is managed by this instance.
Method Detail

addModuleListener

public void addModuleListener(ModuleListener listener)
Adds the given module listener to receive module events from this instance.

Parameters:
listener - The listener to register. May not be null.

removeModuleListener

public void removeModuleListener(ModuleListener listener)
Removes the given module listener so that it no longer receives module events from this instance.

Parameters:
listener - The listener to remove.

getModuleListeners

public ModuleListener[] getModuleListeners()
Returns all the module listeners that have been added to this support instance.

See Also:
addModuleListener(ModuleListener), removeModuleListener(ModuleListener)

fireModuleInitializing

public void fireModuleInitializing()
Propagates a module event of type ModuleEvent.TYPE_MODULE_INITIALIZING to all registered ModuleListeners.


fireModuleDisposed

public void fireModuleDisposed()
Propagates a module event of type ModuleEvent.TYPE_MODULE_DISPOSED to all registered ModuleListeners.


fireModuleMainRunStarting

public void fireModuleMainRunStarting()
Propagates a module event of type ModuleEvent.TYPE_MODULE_MAIN_RUN_STARTING to all registered ModuleListeners.


fireModuleMainRunFinished

public void fireModuleMainRunFinished()
Propagates a module event of type ModuleEvent.TYPE_MODULE_MAIN_RUN_FINISHED to all registered ModuleListeners.


fireExceptionThrown

public void fireExceptionThrown(java.lang.Throwable t)
Propagates a module event of type ModuleEvent.TYPE_MODULE_EXCEPTION_THROWN to all registered ModuleListeners.

Parameters:
t - the thrown exception

hasListeners

public boolean hasListeners()
Returns whether or not there are module listeners associated with this class.


fireModuleEventHappened

public void fireModuleEventHappened(ModuleEvent event)
Notifies all registered listeners about the event.

Parameters:
event - The event to be fired

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