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
-
eventProc
- Event processor object used in run time.
-
rtEnv
- The run-time scripting environment object.
-
running
- Flag that indicates whether the script is running.
-
runTable
- Run-time object-name table.
-
SCRRTComponent(SCREventProcessor)
- Constructor for the SCRRTComponent class.
-
cleanUp()
- Cleans up the script.
-
eventFired(Object[], String[], String, Object, Object[])
- Called by the event processor when
a Java bean fires an event.
-
getName(Object)
- Returns the name of the given Java object.
-
getObjectFor(String)
- Returns the Java object by a given name.
-
getObjects()
- Requests all the objects registered with the run-time scripting component.
-
getRunTable()
- Requests the run-time object-name table.
-
handleEventFired(Object[], String[], String, String, Object[])
- Called by the event processor when a bean fires
an event during script execution.
-
handleInitialize()
- Initializes subclasses.
-
handleRunScript(boolean, SCRRTClient)
- A hook for subclasses for handling script use.
-
handleTerminateScript()
- A hook for subclasses for handling script use.
-
initialize(Hashtable)
- Initializes the instance data.
-
isRunning()
- Requests the current value of the running flag.
-
needAddListener(Object, String)
- Checks to see if it is necessary to add a particular event listener
to a Java object.
-
runScript(boolean, SCRRTClient)
- Runs the compiled script.
-
setRTEnv(SCRRTEnvironment)
- Sets the run-time environment property.
-
terminateScript()
- Terminates the running script.
eventProc
protected SCREventProcessor eventProc
- Event processor object used in run time. It is set by the constructor.
- See Also:
- SCREventProcessor
runTable
protected Hashtable runTable
- Run-time object-name table.
running
protected transient boolean running
- Flag that indicates whether the script is running.
rtEnv
protected SCRRTEnvironment rtEnv
- The run-time scripting environment object.
- See Also:
- SCRRTEnvironment
SCRRTComponent
public SCRRTComponent(SCREventProcessor event_processor)
- Constructor for the SCRRTComponent class.
- Parameters:
- event_processor - The run-time event processor.
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.
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.
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.
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.
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.
handleInitialize
protected abstract boolean handleInitialize()
- Initializes subclasses.
Subclass must implement this method.
- Returns:
- true if initialization is successful; false otherwise.
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.
handleTerminateScript
protected abstract boolean handleTerminateScript()
- A hook for subclasses for handling script use.
- Returns:
- true if the script terminates successfully; false otherwise.
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.
isRunning
public final boolean isRunning()
- Requests the current value of the running flag.
- Returns:
- true if the script is running; false otherwise.
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.
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.
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.
getObjects
public Object[] getObjects()
- Requests all the objects registered with the run-time scripting component.
- Returns:
- An array of registered objects.
getRunTable
protected Hashtable getRunTable()
- Requests the run-time object-name table.
- Returns:
- Hashtable of object-name mapping.
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