All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.beans.script.SCREventProcessor
java.lang.Object
|
+----com.ibm.beans.script.SCREventProcessor
- public class SCREventProcessor
- extends Object
- implements Serializable
This class defines the scripting event processor that is created by the scripting component.
The event processor is responsible for listening to the events
fired by the beans in a client application. An instance of event processor
introspects on the beans as they are registered at design time and
creates event listeners accordingly at run time.
-
magicPrefix
- Indicates the prefix for the name of a listener class created to listen
to a user-defined event.
-
SCREventProcessor()
- Creates an event processor.
-
SCREventProcessor(String, String)
- Creates an event processor taking the scripting component as an argument.
-
addUserDefinedListenerClass(String, String)
- Adds a listener class for a user-defined event to the
instance data.
-
deregisterClass(String)
- This method is called by the scripting component when a bean class is
deregistered from the scripting environment.
-
editScript()
- This method is called when the user wishes to edit the script.
-
eventFired(Object, String, Object[], String[], Object[])
- Indicates that an event has been fired by a bean.
-
eventFired(String, EventObject, Object)
- Indicates that an event has been fired by a bean.
-
eventFiredThrowsClause(Object, String, Object[], String[], Object[])
- Indicates that an event has been fired by a bean.
-
eventFiredThrowsClause(String, EventObject, Object)
- Indicates that an event has been fired by a bean.
-
getPackagingFiles(Vector, Vector)
- Requests the extra files that the event processor creates for implementing
listener classes for the user-defined events.
-
isUserClassCreated(String)
- This method checks if a listener class for a user-defined event exists.
-
registerClass(Class)
- This method is called by the scripting component when a bean class is registered
with the scripting environment.
-
runScript(SCRRTComponent)
- This method is called just before the script code is executed.
-
terminateScript()
- This method is called when the script execution is terminated.
magicPrefix
public String magicPrefix
- Indicates the prefix for the name of a listener class created to listen
to a user-defined event.
SCREventProcessor
public SCREventProcessor()
- Creates an event processor.
This constructor initializes the instance data.
SCREventProcessor
public SCREventProcessor(String wDir,
String pName)
- Creates an event processor taking the scripting component as an argument.
This constructor initializes the instance data.
- Parameters:
- wDir - The name of the working directory.
- pName - The name of the package in which the listener classes created
by the event processor are stored.
registerClass
public synchronized void registerClass(Class cls)
- This method is called by the scripting component when a bean class is registered
with the scripting environment. If the bean class is not already registered, then
the event processor introspects on the class,
finds the events that it can potentially fire, and appropriately
generates the listener classes for those events.
- Parameters:
- cls - The bean class that is registered with the scripting environment.
deregisterClass
public synchronized void deregisterClass(String clsName)
- This method is called by the scripting component when a bean class is
deregistered from the scripting environment.
- Parameters:
- clsName - The bean class name that is deregistered.
runScript
public synchronized void runScript(SCRRTComponent c)
- This method is called just before the script code is executed.
The event processor gets all the beans that are
registered with the scripting environment and
adds appropriate event listeners to them.
- Parameters:
- c - Run-time scripting component.
terminateScript
public synchronized void terminateScript()
- This method is called when the script execution is terminated.
The event processor removes all the event listeners from the beans.
editScript
public synchronized void editScript()
- This method is called when the user wishes to edit the script.
It sets the mode to DESIGN_MODE. In this mode, the event processor
performs introspection on every bean that is registered with it.
eventFired
public synchronized void eventFired(String eventName,
EventObject e,
Object sourceObj)
- Indicates that an event has been fired by a bean. The
event processor forwards this call to the scripting component.
- Parameters:
- eventName - The name of the event handler procedure.
- e - The event object.
- sourceObj - The bean that fires the event.
eventFiredThrowsClause
public synchronized Throwable eventFiredThrowsClause(String eventName,
EventObject e,
Object sourceObj)
- Indicates that an event has been fired by a bean. The
event processor forwards this call to the scripting component. The
event handler script for this event can possibly raise an exception.
- Parameters:
- eventName - The name of the event handler procedure.
- e - The event object.
- sourceObj - The bean that fires the event.
- Returns:
- The exception thrown by the event handler.
eventFired
public synchronized void eventFired(Object source,
String eventName,
Object args[],
String arg_classes[],
Object retArgs[])
- Indicates that an event has been fired by a bean. The
event processor forwards this call to the scripting component which in
turn invokes the appropriate event handler in the script code.
- Parameters:
- source - The bean that fired the event.
- eventName - The name of the event handler procedure.
- args - An array of actual parameters.
- arg_classes - An array of class names of actual parameters.
- retArgs - An array of objects returned by the scripting component.
eventFiredThrowsClause
public synchronized Throwable eventFiredThrowsClause(Object source,
String eventName,
Object args[],
String arg_classes[],
Object retArgs[])
- Indicates that an event has been fired by a bean. The
event processor forwards this call to the scripting component which in
turn invokes the appropriate event handler in the script code. The event
handler can possibly raise an exception.
- Parameters:
- source - The bean that fired the event.
- eventName - The name of the event handler procedure.
- args - An array of actual parameters.
- arg_classes - An array of class names of actual parameters.
- retArgs - An array of objects returned by the scripting component.
- Returns:
- The exception thrown by the event handler.
isUserClassCreated
public synchronized int isUserClassCreated(String name)
- This method checks if a listener class for a user-defined event exists.
- Parameters:
- name - The name of the listener class for the user-defined event.
- Returns:
- Index of the listener class in the listener class vector; -1 if
the listener class is not found.
addUserDefinedListenerClass
public synchronized int addUserDefinedListenerClass(String fileName,
String className)
- Adds a listener class for a user-defined event to the
instance data.
- Parameters:
- fileName - The file in which the listener class is stored.
- className - The fully-qualified class name of the listener class.
- Returns:
- The number of already added user defined listener classes.
getPackagingFiles
public void getPackagingFiles(Vector allNames,
Vector byteArrays)
- Requests the extra files that the event processor creates for implementing
listener classes for the user-defined events.
- Parameters:
- allNames - The list of class names of the listener classes.
- byteArrays - The list of byte arrays representing the listener classes.
All Packages Class Hierarchy This Package Previous Next Index