|
|||||||||||
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. This class is a singleton.
Field Summary | |
---|---|
static java.lang.String |
NO_WRAP
Factory name to use for classes that should not be wrapped. |
Method Summary | |
---|---|
static ObjectWrapperManager |
getInstance()
Get a reference to the only ObjectWrapperManager. |
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. Note: This function is intended to be used internally from ScriptEvaluator and the calling function should register the wrapped obj to dispose listener by calling ScriptContextDAO.addDisposeListener(), so that the obj gets cleared from 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.
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 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 |