|
jPOS 1.6.7 API Documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jpos.bsh.BSHMethod
public class BSHMethod
This is a utility class that makes it a bit easier to work with beanshell scripts. Check out the execute methods.
| Constructor Summary | |
|---|---|
BSHMethod(java.lang.String bshData,
boolean source)
Creates a BSHMethod. |
|
| Method Summary | |
|---|---|
static BSHMethod |
createBshMethod(org.jdom.Element e)
Creates a BSHMethod from a JDom Element. |
java.util.Map |
execute(java.util.Map arguments,
java.util.Collection returnNames)
Sets the given arguments to the Interpreter, evaluates the script and returns a map that has the Strings of the returnNames collection as keys and the objects stored in the variables thus named as values. |
java.lang.Object |
execute(java.util.Map arguments,
java.lang.String resultName)
Sets the given arguments to the Interpreter, evaluates the script and returns the object stored on the variable named resultName. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BSHMethod(java.lang.String bshData,
boolean source)
bshData - - May either be the file to source or the script itself to
evaluate.source - - If true indicates that the bshData passed is a file to
source. Otherwise the string itself is evaluated.| Method Detail |
|---|
public static BSHMethod createBshMethod(org.jdom.Element e)
throws java.io.FileNotFoundException,
java.io.IOException
Example 1 :
<prepare>
import org.jpos.iso.*;
import org.jpos.transaction.*;
msg = context.get("txnRequest");
BaseChannel.getChannel("loop-channel").send(msg);
result=TransactionConstants.PREPARED | TransactionConstants.READONLY;
</prepare>
Example 2 :
<routing file='cfg\files\routing1.bsh' cache='false'/>
java.io.FileNotFoundException
java.io.IOException
public java.lang.Object execute(java.util.Map arguments,
java.lang.String resultName)
throws bsh.EvalError,
java.io.FileNotFoundException,
java.io.IOException
arguments - Parameters to set to the Interpreter. For every
Map.Entry (key, value), interpreter.set(key, value)
is called. All keys must be Strings.returnName - The names of the variables wich`s content is to be
returned.
bsh.EvalError
java.io.FileNotFoundException
java.io.IOException
public java.util.Map execute(java.util.Map arguments,
java.util.Collection returnNames)
throws bsh.EvalError,
java.io.FileNotFoundException,
java.io.IOException
arguments - Parameters to set to the Interpreter. For every
Map.Entry (key, value), interpreter.set(key, value)
is called. All keys must be Strings.returnNames - Collection of Strings. The names of the variables
wich`s contents are to be returned.
bsh.EvalError
java.io.FileNotFoundException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object
|
jPOS.org | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||