java.lang.Objectorg.mozilla.javascript.ScriptableObject
org.wso2.mashup.hostobjects.session.SessionHostObject
public class SessionHostObject
| Field Summary | |
|---|---|
static java.lang.String |
MASHUP_SESSION_OBJECT |
| Fields inherited from class org.mozilla.javascript.ScriptableObject |
|---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY,
UNINITIALIZED_CONST |
| Fields inherited from interface org.mozilla.javascript.Scriptable |
|---|
NOT_FOUND |
| Constructor Summary | |
|---|---|
SessionHostObject()Contructor that will be used by the java engine.. |
|
| Method Summary | |
|---|---|
java.lang.String |
getClassName() |
static org.mozilla.javascript.Scriptable |
jsConstructor(org.mozilla.javascript.Context cx,
java.lang.Object[] args,
org.mozilla.javascript.Function ctorObj,
boolean inNewExpr)Constructor that gets called when creating the session object from Rhino. |
void |
jsFunction_clear()Removes all values (clears) from the current java script session object. |
java.lang.Object |
jsFunction_get(java.lang.String key)Retrieves the value associated with the given "key" from the current java script session object. |
java.lang.String[] |
jsFunction_getKeys()Returns an array of strings containing all the key values, which represent the elements stored in session var keys = session.getKeys(); |
void |
jsFunction_put(java.lang.String key,
java.lang.Object object)Puts the key value pair in to the java script session object. |
void |
jsFunction_remove(java.lang.String key)Removes the value associated with the given "key" from the current java script session object. |
int |
jsFunction_size()Returns the number of elements contained in the session var x = session.size(); |
| Methods inherited from class org.mozilla.javascript.ScriptableObject |
|---|
associateValue, callMethod, callMethod, defineClass,
defineClass, defineClass, defineConst, defineConstProperty,
defineFunctionProperties, defineProperty, defineProperty,
defineProperty, defineProperty, delete, delete, deleteProperty,
deleteProperty, get, get, getAllIds, getAssociatedValue,
getAttributes, getAttributes, getAttributes, getAttributes,
getClassPrototype, getDefaultValue, getDefaultValue,
getFunctionPrototype, getGetterOrSetter, getIds,
getObjectPrototype, getParentScope, getProperty, getProperty,
getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue,
has, has, hasInstance, hasProperty, hasProperty, isConst, isSealed,
put, put, putConst, putConstProperty, putProperty, putProperty,
redefineProperty, sealObject, setAttributes, setAttributes,
setAttributes, setAttributes, setGetterOrSetter, setParentScope,
setPrototype |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString,
wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String MASHUP_SESSION_OBJECT
| Constructor Detail |
|---|
public SessionHostObject()
| Method Detail |
|---|
public static org.mozilla.javascript.Scriptable jsConstructor(org.mozilla.javascript.Context cx,
java.lang.Object[] args,
org.mozilla.javascript.Function ctorObj,
boolean inNewExpr)
throws org.wso2.mashup.MashupFault
Constructor that gets called when creating the session object from Rhino.
Retrieve the instance of this class available in the ServiceGroupContext of the current invocation and returns is to the user. If an instance of this is not available in the ServiceGroupContext, create an instance of this object and stores it in the ServiceGroupContext of the current message.
java.io.IOExceptionorg.wso2.mashup.MashupFaultpublic java.lang.String getClassName()
getClassName in interface
org.mozilla.javascript.ScriptablegetClassName in class
org.mozilla.javascript.ScriptableObject
public void jsFunction_put(java.lang.String key,
java.lang.Object object)
session.put("name", "WSO2 Mashup Server");
key - - The key of the object added to the
sessionobject - - The value of the object added to the
sessionpublic java.lang.Object jsFunction_get(java.lang.String key)
session.get("name");
key - - The key of the object that the value is
needed forpublic void jsFunction_remove(java.lang.String key)
session.remove("name");
key - - The key of the object that needs to be
removedpublic void jsFunction_clear()
session.clear();
public int jsFunction_size()
var x = session.size();
public java.lang.String[] jsFunction_getKeys()
var keys = session.getKeys();