All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.beans.script.SCREnvironment

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

public class SCREnvironment
extends Object
implements Serializable
The scripting environment class is created by a Java application programmer to provide an environment capable of persistently associating Java objects with scripts of supported scripting languages.


Variable Index

 o SCR_ENVIRONMENT_CHANGED_AFTER_CHECK
The name of the client request for checking if the script is changed after last check.
 o SCR_ENVIRONMENT_CHANGED_AFTER_GENERATE
The name of the client request for checking if the script is changed after last generate.
 o SCR_ENVIRONMENT_CHANGED_AFTER_SAVE
The name of the client request for checking if the script is changed after last save.

Constructor Index

 o SCREnvironment()
Creates a scripting environment.

Method Index

 o clientRequest(String, Object)
Processes a client request.
 o deregisterClass(Class)
Deregisteres a class with the scripting environment.
 o deregisterObject(String)
Removes the named object from the scripting environment.
 o editScript()
Edits the script.
 o editScriptNoFrame()
Edits the script.
 o exportScript(BufferedWriter)
Exports script data.
 o getComponentDescriptor()
Gets the scripting component descriptor that is used to create the scripting environment.
 o getPackagingFiles(Vector, Vector)
Requests the list of files that are to be packaged when this scripting environment is published.
 o getRTEnvironment(boolean)
Creates and returns a run-time scripting environment.
 o importScript(BufferedReader)
Imports script data.
 o initialize(SCRClient)
Initializes the scripting environment.
 o isEmpty()
 o registerClass(Class)
Registers a class with the scripting environment.
 o registerObject(Class, String)
Allows the object to be introduced to the scripting environment.
 o renameObject(String, String)
Renames an object with a given name.
 o stopEditingScript()
Stops the script editing session and closes the IDE for the scripting environment.

Variables

 o SCR_ENVIRONMENT_CHANGED_AFTER_SAVE
 public static final String SCR_ENVIRONMENT_CHANGED_AFTER_SAVE
The name of the client request for checking if the script is changed after last save.

 o SCR_ENVIRONMENT_CHANGED_AFTER_GENERATE
 public static final String SCR_ENVIRONMENT_CHANGED_AFTER_GENERATE
The name of the client request for checking if the script is changed after last generate.

 o SCR_ENVIRONMENT_CHANGED_AFTER_CHECK
 public static final String SCR_ENVIRONMENT_CHANGED_AFTER_CHECK
The name of the client request for checking if the script is changed after last check.

Constructors

 o SCREnvironment
 public SCREnvironment()
Creates a scripting environment. This constructor is used for serialization purposes only.

Methods

 o initialize
 public void initialize(SCRClient newScrClient)
Initializes the scripting environment. This function must be called when the SCREnvironment class is deserialized. The SCREnvironmentFactory class calls this method during creation.

Parameters:
newScrClient - The scripting client.
See Also:
SCREnvironmentFactory
 o getComponentDescriptor
 public SCRComponentDescriptor getComponentDescriptor()
Gets the scripting component descriptor that is used to create the scripting environment.

Returns:
The scripting component descriptor that is used to create the scripting environment.
 o registerObject
 public boolean registerObject(Class cls,
                               String name)
Allows the object to be introduced to the scripting environment. The name parameter is assigned to the object. Registering an object makes the object available to the scripting engine described by the scripting component descriptor.

Parameters:
cls - The Object class being introduced into the scripting environment.
name - The name to be assigned to the object.
Returns:
true if registered successfully; false otherwise.
See Also:
SCRComponentDescriptor
 o deregisterObject
 public boolean deregisterObject(String name)
Removes the named object from the scripting environment.

Parameters:
name - The name of the object to be removed.
Returns:
true if deregistered successfully; false otherwise.
See Also:
registerObject, deregisterObject
 o renameObject
 public boolean renameObject(String oldName,
                             String newName)
Renames an object with a given name.

Parameters:
oldName - The name of the object to be renamed.
newName - The new name of the object.
Returns:
true if the object is renamed; false otherwise.
 o registerClass
 public boolean registerClass(Class cls)
Registers a class with the scripting environment.

Parameters:
cls - The class to be registered.
Returns:
true if registered successfully; false otherwise.
See Also:
registerObject
 o deregisterClass
 public boolean deregisterClass(Class cls)
Deregisteres a class with the scripting environment.

Parameters:
cls - Class to be deregistered.
Returns:
true if deregistered successfully; false otherwise.
See Also:
deregisterObject
 o editScript
 public boolean editScript()
Edits the script. Invokes the IDE for the scripting environment. The IDE is created in a separate window.

Returns:
true if successful; false if an IDE is not supported.
 o editScriptNoFrame
 public 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 object.
 o stopEditingScript
 public boolean stopEditingScript()
Stops the script editing session and closes the IDE for the scripting environment.

Returns:
true if successful; false if an IDE is not supported.
 o isEmpty
 public boolean isEmpty()
 o getRTEnvironment
 public SCRRTEnvironment getRTEnvironment(boolean withDebug)
Creates and returns a run-time scripting environment.

Parameters:
withDebug - Indicates whether the run-time environment is created with debugging information.
Returns:
Run-time scripting environment.
 o exportScript
 public void exportScript(BufferedWriter out)
Exports script data.

Parameters:
out - The write buffer.
 o importScript
 public void importScript(BufferedReader in)
Imports script data.

Parameters:
in - The read buffer.
 o getPackagingFiles
 public void getPackagingFiles(Vector allNames,
                               Vector byteArrays)
Requests the list of files that are to be packaged when this scripting environment is published.

Parameters:
allNames - The list of class names of the public classes created by the scripting engine.
byteArrays - The list of byte arrays representing the classes created by the scripting engine.
 o 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.
Returns:
true, if successful; false, if failed.

All Packages  Class Hierarchy  This Package  Previous  Next  Index