All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.beans.script.SCRBaseEventListener

java.lang.Object
   |
   +----com.ibm.beans.script.SCRBaseEventListener

public class SCRBaseEventListener
extends Object
The base event listener class. This is a superclass of all the listener classes generated by the scripting event processor. An instance of this class maintains a Vector of all the beans it listens to for a particular event interface. It adds itself as a listener to a bean before the script starts running and removes itself from the listener list after the script execution is terminated.


Variable Index

 o eventProcessor
Indicates the scripting event processor.

Constructor Index

 o SCRBaseEventListener()
Creates and initializes a SCRBaseEventListener instance.

Method Index

 o connectSource(Object)
Adds an instance of BaseEventListener (or its subclass) as a listener for a particular event fired by a bean.
 o disconnectSource()
Removes the event listener from all the beans to which it listens.
 o eventFired(String, Object[], String[], Object[])
Notifies event listeners when an event is fired by an event source.
 o eventFiredThrowsClause(String, Object[], String[], Object[])
Notifies event listeners when an event is fired by an event source.
 o getInterfaceName()
Gets the name of the listener interface.
 o setAddMethodName(String)
Sets the name of the addListener() method.
 o setEventProcessor(SCREventProcessor)
Sets the scripting event processor.
 o setInterfaceName(String)
Sets the name of the listener interface.
 o setRemoveMethodName(String)
Sets the name of removeListener() method.

Variables

 o eventProcessor
 protected SCREventProcessor eventProcessor
Indicates the scripting event processor.

Constructors

 o SCRBaseEventListener
 public SCRBaseEventListener()
Creates and initializes a SCRBaseEventListener instance.

Methods

 o setEventProcessor
 public void setEventProcessor(SCREventProcessor eventProc)
Sets the scripting event processor.

Parameters:
eventProc - The scripting event processor.
 o setAddMethodName
 public void setAddMethodName(String name)
Sets the name of the addListener() method. The addListener() method is used to connect the listener to the event source.

Parameters:
name - The name of the addListener() method.
 o setRemoveMethodName
 public void setRemoveMethodName(String name)
Sets the name of removeListener() method. The removeListener() method is used to disconnect the listener from the event source.

Parameters:
name - The name of removeListener() method.
 o setInterfaceName
 public void setInterfaceName(String name)
Sets the name of the listener interface.

Parameters:
name - The name of the interface.
 o getInterfaceName
 public String getInterfaceName()
Gets the name of the listener interface.

Returns:
name - The name of the interface.
 o connectSource
 public void connectSource(Object object)
Adds an instance of BaseEventListener (or its subclass) as a listener for a particular event fired by a bean. This method is called before the script execution begins.

Parameters:
object - The bean that can fire an event.
 o disconnectSource
 public void disconnectSource()
Removes the event listener from all the beans to which it listens. This method is called when the script execution is terminated.

 o eventFired
 protected void eventFired(String eventName,
                           Object args[],
                           String arg_classes[],
                           Object ret[])
Notifies event listeners when an event is fired by an event source. The listener forwards the event to the scripting component.

Parameters:
eventName -
The name of the event which corresponds to the function to be invoked in the script.
args - An array of actual parameters.
arg_classes - An array of class names of actual parameters.
ret - An array of objects returned by the scripting component.
 o eventFiredThrowsClause
 protected Throwable eventFiredThrowsClause(String eventName,
                                            Object args[],
                                            String arg_classes[],
                                            Object ret[])
Notifies event listeners when an event is fired by an event source. The event handler code in the event listener may throw an exception which is returned to the event source. The listener forwards the event to the scripting component.

Parameters:
eventName -
The name of the event which corresponds to the function to be invoked in the script.
args - An array of actual parameters.
arg_classes - An array of class names of actual parameters.
ret - An array of objects returned by the scripting component.
Returns:
The exception thrown by the event handler.

All Packages  Class Hierarchy  This Package  Previous  Next  Index