All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.beans.script.SCRRTComponent

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

public abstract class SCRRTComponent
extends Object
implements Serializable
This class is the base run-time scripting component. All run-time scripting components must be derived from this class.

See Also:
SCRComponent

Variable Index

 o eventProc
Event processor object used in run time.
 o rtEnv
The run-time scripting environment object.
 o running
Flag that indicates whether the script is running.
 o runTable
Run-time object-name table.

Constructor Index

 o SCRRTComponent(SCREventProcessor)
Constructor for the SCRRTComponent class.

Method Index

 o cleanUp()
Cleans up the script.
 o eventFired(Object[], String[], String, Object, Object[])
Called by the event processor when a Java bean fires an event.
 o getName(Object)
Returns the name of the given Java object.
 o getObjectFor(String)
Returns the Java object by a given name.
 o getObjects()
Requests all the objects registered with the run-time scripting component.
 o getRunTable()
Requests the run-time object-name table.
 o handleEventFired(Object[], String[], String, String, Object[])
Called by the event processor when a bean fires an event during script execution.
 o handleInitialize()
Initializes subclasses.
 o handleRunScript(boolean, SCRRTClient)
A hook for subclasses for handling script use.
 o handleTerminateScript()
A hook for subclasses for handling script use.
 o initialize(Hashtable)
Initializes the instance data.
 o isRunning()
Requests the current value of the running flag.
 o needAddListener(Object, String)
Checks to see if it is necessary to add a particular event listener to a Java object.
 o runScript(boolean, SCRRTClient)
Runs the compiled script.
 o setRTEnv(SCRRTEnvironment)
Sets the run-time environment property.
 o terminateScript()
Terminates the running script.

Variables

 o eventProc
 protected SCREventProcessor eventProc
Event processor object used in run time. It is set by the constructor.

See Also:
SCREventProcessor
 o runTable
 protected Hashtable runTable
Run-time object-name table.

 o running
 protected transient boolean running
Flag that indicates whether the script is running.

 o rtEnv
 protected SCRRTEnvironment rtEnv
The run-time scripting environment object.

See Also:
SCRRTEnvironment

Constructors

 o SCRRTComponent
 public SCRRTComponent(SCREventProcessor event_processor)
Constructor for the SCRRTComponent class.

Parameters:
event_processor - The run-time event processor.

Methods

 o initialize
 public final void initialize(Hashtable tbl)
Initializes the instance data. This method is called by the scripting environment. It sets the running flag to false and calls the handleInitialize() method.

Parameters:
tbl - Run-time name-object binding table.
 o eventFired
 public final Throwable eventFired(Object args[],
                                   String arg_class_names[],
                                   String method_name,
                                   Object src_obj,
                                   Object return_val[])
Called by the event processor when a Java bean fires an event.

Parameters:
args - The event method arguments.
arg_class_names - The argument class names.
method_name - The event method name.
src_obj - The event source object.
return_val - The return value from the method that is invoked.
Returns:
The exception thrown in the invocation of the target method.
 o cleanUp
 public void cleanUp()
Cleans up the script. This method is called by the scripting component to remove the references to all the objects that are referenced by the run-time Component. Subclasses of the SCRRTComponent class may override this method.

 o runScript
 public final boolean runScript(boolean withDebug,
                                SCRRTClient scr_client)
Runs the compiled script. This method is called by the scripting environment. The scripting component developer must implement this method to use a scripting language-specific script.

Parameters:
withDebug - true if the script is run with debugger; false otherwise.
scr_client - The scripting client used by the component to terminate the script.
Returns:
true if the script is available; false otherwise.
 o terminateScript
 public final boolean terminateScript()
Terminates the running script. The scripting component developer must implement this method in order to have scripting language-specific termination of the script execution.

Returns:
true if the script execution is terminated; false otherwise.
 o handleInitialize
 protected abstract boolean handleInitialize()
Initializes subclasses. Subclass must implement this method.

Returns:
true if initialization is successful; false otherwise.
 o handleRunScript
 protected abstract boolean handleRunScript(boolean withDebug,
                                            SCRRTClient scr_client)
A hook for subclasses for handling script use.

Parameters:
withDebug - Specifies if the script is run with debugger.
scr_client - The scripting client used by the component to terminate the script.
Returns:
true if script runs successfully; false otherwise.
 o handleTerminateScript
 protected abstract boolean handleTerminateScript()
A hook for subclasses for handling script use.

Returns:
true if the script terminates successfully; false otherwise.
 o handleEventFired
 protected abstract Throwable handleEventFired(Object args[],
                                               String arg_class_names[],
                                               String java_method_name,
                                               String src_obj_name,
                                               Object return_tval[])
Called by the event processor when a bean fires an event during script execution. Subclasses must override this method to invoke appropriate script code.

Parameters:
args - The event method arguments.
arg_class_names - The argument class names.
java_method_name - The event method name.
src_obj_name - The name of the Java object that fires the event.
return_tval - The event method return value.
Returns:
The exception thrown in the invocation of the target method.
 o isRunning
 public final boolean isRunning()
Requests the current value of the running flag.

Returns:
true if the script is running; false otherwise.
 o getName
 public String getName(Object obj)
Returns the name of the given Java object.

Parameters:
object - The given Java object.
Returns:
The name of the registered object; null otherwise.
 o getObjectFor
 public Object getObjectFor(String name)
Returns the Java object by a given name.

Parameters:
name - The name of the Java object.
Returns:
The Java object associated with the registered name; null otherwise.
 o needAddListener
 public boolean needAddListener(Object java_obj,
                                String listener_type_name)
Checks to see if it is necessary to add a particular event listener to a Java object.

Parameters:
java_obj - The Java object to which the event listener is added.
listener_type_name - Name of the event listener class.
Returns:
true if the listener should be added to the object; false otherwise.
 o getObjects
 public Object[] getObjects()
Requests all the objects registered with the run-time scripting component.

Returns:
An array of registered objects.
 o getRunTable
 protected Hashtable getRunTable()
Requests the run-time object-name table.

Returns:
Hashtable of object-name mapping.
 o setRTEnv
 protected void setRTEnv(SCRRTEnvironment rt_env)
Sets the run-time environment property.

Parameters:
rt_env - The run-time environment object.

All Packages  Class Hierarchy  This Package  Previous  Next  Index