All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.beans.script.SCRComponent
java.lang.Object
|
+----com.ibm.beans.script.SCRComponent
- public abstract class SCRComponent
- extends Object
- implements Serializable
This is the base scripting component class from which
all scripting components should be derived.
- See Also:
- SCRIDEComponent
-
eventProc
- Event processor object.
-
introspectionDepth
- Depth of introspection.
-
lastGenerationTime
-
-
lastSaveTime
- The last saving time for this scripting component.
-
name_handle_Registry
- Design time mapping of object names and object handles.
-
registeredClasses
- Vector of Java classes that are registered with the scripting component.
-
rtComponent
- Run-time component.
-
scrClient
- Scripting client.
-
scrEnv
- Scripting environment object.
-
SCRComponent()
- Constructs the SCRComponent object.
-
checkChanged(long)
- Check if the script is changed after the last change time.
-
clientRequest(String, Object)
- Processes a client request.
-
createEventProcessor()
- Creates the event processor object.
-
createObjectHandle(String, Class)
- Creates an object handle for a registered object.
-
createRegisteredClass(Class)
- Creates an SCRRegisteredClass object.
-
createRTComponent(boolean)
- Creates the run-time component.
-
deregisterClass(Class)
- Deregisters a Java class.
-
deregisterObject(String)
- Deregisters a named object from the scripting component and the event
processor.
-
deregisterObjectHandle(SCRObjectHandle)
- Deregisters an object handle from the scripting component and the event
processor.
-
doIntrospection(SCRRegisteredClass, int)
- Introspects a registered class.
-
editScript()
- Starts IDE to edit the script.
-
editScriptNoFrame()
- Edits the script.
-
exportScript(BufferedWriter)
- Exports the script data to an output stream.
-
getObjectHandle(String)
- Requests the object handle for a named object.
-
getObjectHandles()
- Gets all registered object handles.
-
getOrCreateRTComponent(boolean)
- Gets a run time only component.
-
getPackagingFiles(Vector, Vector)
- Requests the list of extra class files that are generated by the
scripting component.
-
getRegisteredClasses()
- Gets all registered classes.
-
getRTComponent()
- Requests the run-time component.
-
getScrClient()
- Requests the scripting client object.
-
getScrEnv()
- Requests the SCREnvironment object.
-
ideClosed()
- Notifies the client that the IDE window closed.
-
importScript(BufferedReader)
- Imports the script data from an input stream.
-
initialize(SCRClient, SCREnvironment)
- Creates an event processor and a Vector for registered classes.
-
intRegisterClass(Class, int)
- Registers a Java class.
-
isEmpty()
-
-
needRecreateRtComponent(boolean)
- Checks if the run-time component needs to be recreated.
-
registerClass(Class)
- Registers a Java class.
-
registerObject(Class, String)
- Registers the object with the scripting component and the event
processor.
-
registerObjectHandle(Class, SCRObjectHandle)
- Registers the object handle with the scripting component and the event
processor.
-
renameObject(String, String)
- Renames a named object.
-
runRequest(boolean, boolean)
- Requests that the client run the script.
-
stopEditingScript()
- Stops script editing.
-
supportsRunRequest()
- Checks if the client supports the run script request.
-
syncEditor()
- Saves the contents of the current edit session in preparation for
object streaming.
-
terminateRequest()
- Requests the client to terminate the script.
introspectionDepth
protected int introspectionDepth
- Depth of introspection. Subclasses may change this.
0 indicates no intropspection;
-1 indicates introspect all classes recursively.
- See Also:
- registerClass
scrEnv
protected transient SCREnvironment scrEnv
- Scripting environment object. This variable is set in the initialize()
method.
- See Also:
- SCREnvironment, getScrEnv, initialize
scrClient
protected transient SCRClient scrClient
- Scripting client. This variable is set in the initialize() method.
The scripting component calls the scripting client back when the
IDE requests to run or terminate a script.
- See Also:
- SCRClient
eventProc
protected SCREventProcessor eventProc
- Event processor object. This variable is created in the initialize method
by calling the createEventProcessor() method
- See Also:
- SCREventProcessor, createEventProcessor
registeredClasses
protected transient Vector registeredClasses
- Vector of Java classes that are registered with the scripting component.
name_handle_Registry
protected Hashtable name_handle_Registry
- Design time mapping of object names and object handles.
rtComponent
protected SCRRTComponent rtComponent
- Run-time component. This variable is created by calling
the getOrCreateRTComponent() method.
- See Also:
- SCRRTComponent
lastSaveTime
protected long lastSaveTime
- The last saving time for this scripting component.
lastGenerationTime
protected long lastGenerationTime
SCRComponent
public SCRComponent()
- Constructs the SCRComponent object. This constructor should be called
by the constructor of the derived class.
getScrEnv
public SCREnvironment getScrEnv()
- Requests the SCREnvironment object.
- Returns:
- The associated SCREnvironment object.
- See Also:
- scrEnv
getScrClient
public SCRClient getScrClient()
- Requests the scripting client object.
- Returns:
- The associated scripting client object.
- See Also:
- scrClient
clientRequest
public boolean clientRequest(String request_name,
Object request_para)
- Processes a client request. The component implementation
need to decide it handles what kind of client requests by
override this method. This method always returns false.
- Parameters:
- request_name - The client request name.
- request_para - The client request parameter.
initialize
public void initialize(SCRClient scr_client,
SCREnvironment env)
- Creates an event processor and a Vector for registered classes. This
method is the initialization method and should be called by the
scripting environment. This method registers all the existing
object handles and adds itself as an event listener of the scripting environment.
- Parameters:
- scr_client - The client application of the scripting engine.
- env - The associated SCREnvironment object.
- See Also:
- scrEnv
runRequest
public boolean runRequest(boolean runDebug,
boolean compileDebug)
- Requests that the client run the script. This method is called when the
scripting component (or IDE) requests that the script be started.
- Parameters:
- runDebug - Specifies if the script is started with the debugger.
- compileDebug - Specifies if the script is compiled with the debugging information.
- Returns:
- true if the client starts the script; false otherwise.
ideClosed
public void ideClosed()
- Notifies the client that the IDE window closed. This method calls
the ideClosed() method of the client. To support this feature, the client
should implement the SCRClientExt interface instead of the SCRClient
interface.
- See Also:
- SCRClientExt
supportsRunRequest
public boolean supportsRunRequest()
- Checks if the client supports the run script request.
- Returns:
- true if the client supports run script request; false otherwise.
- See Also:
- SCRClientExt
terminateRequest
public boolean terminateRequest()
- Requests the client to terminate the script. This method is called when
the scripting component(or IDE) wants to stop the script.
- Returns:
- true if the client stops the script; false otherwise.
createEventProcessor
protected SCREventProcessor createEventProcessor()
- Creates the event processor object. Subclasses may
override this method to create their own event
processor.
- Returns:
- The newly created event processor object.
- See Also:
- eventProc, SCREventProcessor
createObjectHandle
public abstract SCRObjectHandle createObjectHandle(String name,
Class cls)
- Creates an object handle for a registered object. This method is called
by the scripting environment before registering the object. The subclasses
of scripting component must override this method in order to create a
scripting language specific object handle.
- Parameters:
- name - The unique object name.
- cls - The Java class.
- Returns:
- The newly created object handle.
- See Also:
- SCRObjectHandle
editScript
public abstract boolean editScript()
- Starts IDE to edit the script. This method is called by the scripting
environment. The component developer should implement this method.
- Returns:
- true if IDE can be started; false otherwise.
editScriptNoFrame
public abstract Component editScriptNoFrame()
- Edits the script. Invokes the IDE for the scripting environment.
The IDE will not be created in a separate window.
- Returns:
- null if an IDE is not supported or the IDE was already created
in a separate window using the editScript() method. This method does not
determine if an IDE is supported.
If the return value
is non-null then the user can add the component into
a java.awt.Container component.
stopEditingScript
public abstract boolean stopEditingScript()
- Stops script editing. This method is called by the scripting
environment. The component developer should implement this method.
- Returns:
- true if IDE can be stopped; false otherwise.
syncEditor
public abstract void syncEditor()
- Saves the contents of the current edit session in preparation for
object streaming.
createRegisteredClass
public abstract SCRRegisteredClass createRegisteredClass(Class cls)
- Creates an SCRRegisteredClass object. This method is called by the
registerClass() method. The scripting component developer should
implement this method.
- Parameters:
- cls - The associated Java class object.
- Returns:
- The newly created SCRRegisteredClass object. The object is
used in class registration.
- See Also:
- registerClass, SCRRegisteredClass
isEmpty
public abstract boolean isEmpty()
doIntrospection
public abstract void doIntrospection(SCRRegisteredClass reg_cls,
int depth)
- Introspects a registered class. This method is called by the
registerClass() method. The subclasses of scripting component must
override this method in order to perform scripting language specific introspection.
- Parameters:
- reg_cls - The registered class object that provides the Java
class object.
- depth - The recursive depth for introspection.
registerObject
public SCRObjectHandle registerObject(Class cls,
String name)
- Registers the object with the scripting component and the event
processor.
- Parameters:
- cls - The class of the object that is registered.
- name - The name of the object that is registered.
- Returns:
- The object handle of the registered object.
registerObjectHandle
protected void registerObjectHandle(Class cls,
SCRObjectHandle handle)
- Registers the object handle with the scripting component and the event
processor.
- Parameters:
- cls - The class of the object that is specified by the object handle.
- handle - The object handle that needs to be registered.
deregisterObject
public SCRObjectHandle deregisterObject(String name)
- Deregisters a named object from the scripting component and the event
processor. The scripting component developer may need to override
this method to deregister the object with IDE.
- Parameters:
- name - The name of the object that needs to be deregistered.
deregisterObjectHandle
protected void deregisterObjectHandle(SCRObjectHandle handle)
- Deregisters an object handle from the scripting component and the event
processor. The scripting component developer may need to override
this method in order to deregister the object with IDE.
- Parameters:
- handle - The handle of the object that needs to be deregistered.
renameObject
public SCRObjectHandle renameObject(String oldName,
String newName)
- Renames a named object. The scripting component developer may need to
override this method in order to rename the object with IDE.
- Parameters:
- oldName - The original object name.
- newName - The new object name.
registerClass
public SCRRegisteredClass registerClass(Class cls)
- Registers a Java class. This method should be called by the scripting environment.
This method calls the intRegisterClass() method to do the class registration.
- Parameters:
- cls - The Java class object to be registered.
- Returns:
- The registered SCRRegisteredClass object.
- See Also:
- SCRRegisteredClass
deregisterClass
public void deregisterClass(Class cls)
- Deregisters a Java class. This method takes the deregistered class
name out of the persistent class name list.
- Parameters:
- cls - The Java class object to be deregistered.
intRegisterClass
protected SCRRegisteredClass intRegisterClass(Class cls,
int depth)
- Registers a Java class. If the class has been registered before,
it finds the SCRRegisteredClass object and returns it; otherwise
a new SCRRegisteredClass object is created and added to the
registered class list. Introspection is performed on the registered
class.
- Parameters:
- cls - The Java class object will be registered.
- depth - The recursive depth for introspection.
- Returns:
- The registered SCRRegisteredClass object.
- See Also:
- SCRRegisteredClass
getRTComponent
public SCRRTComponent getRTComponent()
- Requests the run-time component.
- Returns:
- The run-time component.
- See Also:
- SCRRTComponent
getOrCreateRTComponent
public SCRRTComponent getOrCreateRTComponent(boolean withDebug)
- Gets a run time only component. This method creates the run-time component
when rtComponent is null or needs to be recreated.
- Parameters:
- withDebug - Specifies if debug information is included.
- Returns:
- The current SCRRTComponent object.
- See Also:
- SCRRTComponent
needRecreateRtComponent
protected abstract boolean needRecreateRtComponent(boolean withDebug)
- Checks if the run-time component needs to be recreated. Subclass
needs to implement this method.
- Parameters:
- withDebug - Specifies if debug information is included.
- Returns:
- true if the run-time component needs to be recreated; false otherwise.
- See Also:
- SCRRTComponent
checkChanged
protected abstract boolean checkChanged(long lastChange)
- Check if the script is changed after the last change time.
- Parameters:
- lastChange - The last change time.
- Returns:
- true for changed; false for not changed.
createRTComponent
public abstract SCRRTComponent createRTComponent(boolean withDebug)
- Creates the run-time component. Subclass needs to implement this method.
- Parameters:
- withDebug - Specifies if debug information is included.
- Returns:
- The created run-time component.
- See Also:
- SCRRTComponent
getRegisteredClasses
public Class[] getRegisteredClasses()
- Gets all registered classes.
- Returns:
- The array of registered classes.
getObjectHandles
public SCRObjectHandle[] getObjectHandles()
- Gets all registered object handles.
- Returns:
- An array of registered object handles.
getObjectHandle
public SCRObjectHandle getObjectHandle(String name)
- Requests the object handle for a named object.
- Parameters:
- name - The name of the object for which the handle is being requested.
- Returns:
- The handle of the registered object.
exportScript
public abstract void exportScript(BufferedWriter out)
- Exports the script data to an output stream.
- Parameters:
- out - The buffer to which the script is written.
importScript
public abstract void importScript(BufferedReader in)
- Imports the script data from an input stream.
- Parameters:
- in - The buffer from which the script is read.
getPackagingFiles
public void getPackagingFiles(Vector allNames,
Vector byteArrays)
- Requests the list of extra class files that are generated by the
scripting component. These class files include the compiled script
and the listener classes generated by the event processor.
- Parameters:
- allNames - The fully-qualified class names of the classes.
- byteArrays - The byte arrays representing the classes.
All Packages Class Hierarchy This Package Previous Next Index