|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.itim.script.wrappers.ObjectWrapperManager
public class ObjectWrapperManager
Main entry point to wrap an Object to place in the scripting environment. Each script evaluating thread has its own ObjectWrapperManager instance. An instance is created for the first time for a script evaluating thread and stored in OWMInstances Map. This instance is used during the evaluation of the entire script. Once the script evaluation completes, the instance of ObjectWrapperManager is removed from OWMInstances map.
Field Summary | |
---|---|
static java.lang.String |
NO_WRAP
Factory name to use for classes that should not be wrapped. |
Method Summary | |
---|---|
static void |
dispose()
Remove the ObjectWrapperManager instance from the Map once the script evaluation has completed. |
static ObjectWrapperManager |
getInstance()
Get a reference to the ObjectWrapperManager which is created by the current script evaluating thread. |
java.lang.Object |
lookupItem(java.lang.String name)
Gets the origional Object with the given name. |
void |
remove(java.lang.String key)
Remove the Object associated with key from the lookup map. |
void |
storeItem(java.lang.Object obj,
ObjectWrapper wrapper)
This method generates a unique key for the wrapper and sets the name via the ObjectWrapper.setKey(String key) method, then inserts
obj into the lookup map maintained by ObjectWrapperManager so we can get
at the origional object later. |
java.lang.Object |
wrap(java.lang.String name,
java.lang.Object obj,
java.lang.String lang,
java.lang.Object param)
Wraps obj with the correct type of Wrapper based on the configuration. |
java.lang.Object |
wrapInternalObject(java.lang.String name,
java.lang.Object obj,
java.lang.String lang,
java.lang.Object param)
Wraps obj with the correct type of Wrapper based on the configuration. If the wrapper to use for obj is com.ibm.itim.script.wrappers.NO_WRAP then obj will be returned and not wrapped or inserted into the lookup map. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NO_WRAP
Method Detail |
---|
public static ObjectWrapperManager getInstance()
public java.lang.Object wrap(java.lang.String name, java.lang.Object obj, java.lang.String lang, java.lang.Object param)
name
- Name that can be used to look this bean up using the
ScriptEvaluator. This is typically the bean name, and can be
null. If name is null, then a unique id will be automatically
assigned.obj
- The Object to wrap.lang
- The scripting language we are using.param
- Some wrapper classes need parameters to correctly wrap
objects. param is how this information is passed.
public void remove(java.lang.String key)
key
from the lookup map.
This method should only be called by the dispose()
method
of ObjectWrapper classes.
Though the references to this method still exist, this method is not used
anymore by internal script engine implementation of ITIM.
key
- The key (or name) used to lookup objects in
ObjectWrapperManager. Since this method is only supposed to be
called by ObjectWrapper classes, key
can be
gotten from the getKey()
method.public static void dispose()
public java.lang.Object lookupItem(java.lang.String name)
name
- The name of the Object used when wrapping the Object.
public void storeItem(java.lang.Object obj, ObjectWrapper wrapper)
ObjectWrapper.setKey(String key)
method, then inserts
obj into the lookup map maintained by ObjectWrapperManager so we can get
at the origional object later.
This method exists so that items constructed from the script environment,
in their wrappers, can still be accessed outside of the scripting
environment.
obj
- The object that is wrapped.wrapper
- The wrapped version of obj.public java.lang.Object wrapInternalObject(java.lang.String name, java.lang.Object obj, java.lang.String lang, java.lang.Object param)
name
- Name that can be used to look this bean up using the
ScriptEvaluator. This is typically the bean name, and can be
null. If name is null, then a unique id will be automatically
assigned.obj
- The Object to wrap.lang
- The scripting language we are using.param
- Some wrapper classes need parameters to correctly wrap
objects. param is how this information is passed.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |