All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.beans.script.comps.java.SCRJavaComponent
java.lang.Object
|
+----com.ibm.beans.script.SCRComponent
|
+----com.ibm.beans.script.ide.SCRIDEComponent
|
+----com.ibm.beans.script.comps.java.SCRJavaComponent
- public class SCRJavaComponent
- extends SCRIDEComponent
This class implements the Java
scripting Java component. It is derived from SCRIDEComponent.
- See Also:
- SCRIDEComponent
-
generator
- The Java code generator is created in the initialize method.
-
javaInstance
- The system IDE instance.
-
scriptName
- The name of the generated Java class.
-
SCRJavaComponent()
- Constructor for the SCRJavaComponent.
-
checkChanged(long)
- Check if the script is changed after the last change time.
-
createGenerator()
- Creates the script generator object.
-
createJavaEditableObj(String, String, String, SCRJavaEventMethodInfo, SCRObjectHandle)
- Creates a new Java editable object for the IDE.
-
createJavaEventMethodInfo(String)
- Creates a new event method information object.
-
createObjectHandle(String, Class)
- Creates an object handle for a registered Java object.
-
createRTComponent(boolean)
- Creates the run-time component.
-
deregisterObjectHandle(SCRObjectHandle)
- Overrides the deregisterObjectHandle method of the parent.
-
doIntrospection(SCRRegisteredClass, int)
- Introspects a registered class and creates the class information
tree.
-
exportScript(BufferedWriter)
- Exports the script information.
-
getInitialCode()
- Returns the initial code fragment for generated source code.
-
getMethodPrototype(String, String, int, Vector, Vector)
- Gets method prototype.
-
getPackagingFiles(Vector, Vector)
- Requests the list of extra class files that are generated by the
scripting component.
-
getScriptName()
- Gets the script name for the generated Java class.
-
getSysMethodTitle(String)
- Gets the system method title.
-
getSystemInstance()
- Gets or creates the system IDE instance.
-
importScript(BufferedReader)
- Imports the script information.
-
initialize(SCRClient, SCREnvironment)
- Creates an event processor and a vector for registered classes.
-
initObjectHandle(SCRIDEObjectHandle, Class)
- Initializes an IDE object handle and adds SCRIDEEditableObjects into
the IDE instance.
-
isEmpty()
-
-
needRecreateRtComponent(boolean)
- Checks if the run-time component needs to be recreated.
-
renameObject(String, String)
- Overrides the renameObject method of the parent.
generator
protected transient SCRJavaGenerator generator
- The Java code generator is created in the initialize method.
- See Also:
- SCRJavaGenerator
scriptName
protected String scriptName
- The name of the generated Java class.
javaInstance
protected SCRJavaIDEInstance javaInstance
- The system IDE instance. It is created by calling the getSystemInstance
method. The javaInstance stores the initialize, terminate, script-specific
imports, and any non-event related methods of the script.
SCRJavaComponent
public SCRJavaComponent()
- Constructor for the SCRJavaComponent.
needRecreateRtComponent
public boolean needRecreateRtComponent(boolean withDebug)
- Checks if the run-time component needs to be recreated.
- Parameters:
- withDebug - The boolean that specifies if debug information
is included. true, includes the debug information; false,
does not include the debug information.
- Returns:
- true if new run-time component needs to be created again;
false otherwise.
- Overrides:
- needRecreateRtComponent in class SCRComponent
- See Also:
- SCRRTComponent
createRTComponent
public SCRRTComponent createRTComponent(boolean withDebug)
- Creates the run-time component. This method generates and compiles the
Java code, then creates the run-time component with the generated
Java class.
- Parameters:
- withDebug - Boolean that specifies if debug information is
included. true, includes the debug information; false,
does not include the debug information.
- Returns:
- The created run-time component.
- Overrides:
- createRTComponent in class SCRComponent
- See Also:
- SCRRTComponent
checkChanged
protected 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.
- Overrides:
- checkChanged in class SCRComponent
initialize
public void initialize(SCRClient scr_client,
SCREnvironment env)
- Creates an event processor and a vector for registered classes.
This method registers all existing object handles and adds itself
as the scripting environment event listener.This method is called by
the scripting environment.
- Parameters:
- scr_client -
- The scripting client. The component will
call the client when it request the client to run, terminate, or save
the script.
- env - The associated SCREnvironment object.
- Overrides:
- initialize in class SCRIDEComponent
- See Also:
- scrEnv
getSystemInstance
public SCRIDEInstance getSystemInstance()
- Gets or creates the system IDE instance.
- Returns:
- The system IDE instance.
- Overrides:
- getSystemInstance in class SCRIDEComponent
initObjectHandle
public void initObjectHandle(SCRIDEObjectHandle obj_handle,
Class cls)
- Initializes an IDE object handle and adds SCRIDEEditableObjects into
the IDE instance.
- Parameters:
- obj_handle - The object handle to be initialized.
- cls - The class of the object specified by the handle.
- Overrides:
- initObjectHandle in class SCRIDEComponent
doIntrospection
public void doIntrospection(SCRRegisteredClass reg_cls,
int depth)
- Introspects a registered class and creates the class information
tree.
- Parameters:
- reg_cls - The registered class.
- depth - The introspection depth.
- Overrides:
- doIntrospection in class SCRComponent
getScriptName
public String getScriptName()
- Gets the script name for the generated Java class. If the scriptName
is null, creates a default name.
- Returns:
- The script name for the generated Java class.
createObjectHandle
public SCRObjectHandle createObjectHandle(String name,
Class cls)
- Creates an object handle for a registered Java object. This method
overrides the method defined in SCRComponent.
- Parameters:
- name - The unique object name.
- cls - The Java class.
- Returns:
- The created object handle.
- Overrides:
- createObjectHandle in class SCRComponent
- See Also:
- SCRIDEObjectHandle, initObjectHandle
deregisterObjectHandle
protected void deregisterObjectHandle(SCRObjectHandle handle)
- Overrides the deregisterObjectHandle method of the parent. The method first
calls the parent, then sets the changed flag to true.
- Parameters:
- handle - The object handle that needs to be deregistered.
- Overrides:
- deregisterObjectHandle in class SCRIDEComponent
renameObject
public SCRObjectHandle renameObject(String old_name,
String new_name)
- Overrides the renameObject method of the parent. The method first calls
the parent, then sets the changed flag to true.
- Parameters:
- old_name - The old name of the object.
- new_name - The new name of the object.
- Overrides:
- renameObject in class SCRIDEComponent
exportScript
public void exportScript(BufferedWriter out)
- Exports the script information.
- Parameters:
- out - The output buffer to which the script information is exported.
- Overrides:
- exportScript in class SCRComponent
importScript
public void importScript(BufferedReader in)
- Imports the script information.
- Parameters:
- in - The input buffer from which the script information is imported.
- Overrides:
- importScript in class SCRComponent
createJavaEditableObj
protected SCRJavaEditableObj createJavaEditableObj(String event_name,
String title,
String code,
SCRJavaEventMethodInfo evt_info,
SCRObjectHandle obj_handle)
- Creates a new Java editable object for the IDE.
- Parameters:
- event_name - The event for which the object is created.
- title - The title of the editable object.
- code - The source code associated with the object.
- evt_info - The event descriptor information.
- obj_handle - The handle to the scriptable bean.
- Returns:
- The Java editable object.
getInitialCode
protected String getInitialCode()
- Returns the initial code fragment for generated source code.
- Returns:
- The code fragment string.
getSysMethodTitle
protected String getSysMethodTitle(String method_name)
- Gets the system method title.
- Parameters:
- method_name - The name of the syatem method.
- Returns:
- A string that represents the signature for the system method.
createGenerator
protected void createGenerator()
- Creates the script generator object.
- Returns:
- The Java generator object.
getMethodPrototype
protected String getMethodPrototype(String name,
String return_type,
int modifier,
Vector arg_names,
Vector arg_types)
- Gets method prototype.
- Parameters:
- name - The name of the method.
- return_type - The data type of the return value.
- modifier - The modifier value.
- arg_names - The names of the formal parameters.
- arg_types - The types of the formal parameters.
- Returns:
- The string that represents signature for a Java method.
createJavaEventMethodInfo
protected SCRJavaEventMethodInfo createJavaEventMethodInfo(String title)
- Creates a new event method information object.
- Parameters:
- title - The title of the event method information object.
- Returns:
- Java event method information object.
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.
- Overrides:
- getPackagingFiles in class SCRComponent
isEmpty
public boolean isEmpty()
- Overrides:
- isEmpty in class SCRComponent
All Packages Class Hierarchy This Package Previous Next Index