public class ScriptReceiver extends AbstractInOutSyncMessageReceiver
...
scripts/myScript.js
This example shows a JavaScript function embedded within a services.xml file:
...
The script language is determined by the file name suffix when using scripts
in seperate files or the script parameter name suffix when using inline scripts.AbstractMessageReceiver.AsyncMessageReceiverWorker, AbstractMessageReceiver.ThreadContextDescriptor| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
BSFENGINE_PROP |
static java.lang.String |
CONVERTOR_ATTR |
protected static java.lang.String |
CONVERTOR_PROP |
static java.lang.String |
DEFAULT_FUNCTION |
static java.lang.String |
FUNCTION_ATTR |
static java.lang.String |
SCRIPT_ATTR |
static java.lang.String |
SCRIPT_SRC_PROP |
DO_ASYNC, SAVED_MC, SAVED_TCCL, SCOPE, serviceTCCL| Constructor and Description |
|---|
ScriptReceiver() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.bsf.BSFEngine |
getBSFEngine(MessageContext mc)
Gets the BSFEngine for the script service.
|
protected org.apache.bsf.BSFEngine |
initScript(MessageContext mc)
Initializes the script service by finding the script source code,
compiling it in a BSFEngine, and creating an OMElementConvertor
for the script.
|
void |
invokeBusinessLogic(MessageContext inMC,
MessageContext outMC)
Invokes the service by calling the script function
|
protected java.lang.String |
readScript(java.lang.ClassLoader cl,
java.lang.String scriptName)
Reads the complete script source code into a String
|
invokeBusinessLogicgetSOAPFactory, getTheImplementationObject, makeNewServiceObject, receive, replicateState, restoreThreadContext, setThreadContextpublic static final java.lang.String SCRIPT_ATTR
public static final java.lang.String FUNCTION_ATTR
public static final java.lang.String DEFAULT_FUNCTION
public static final java.lang.String CONVERTOR_ATTR
protected static final java.lang.String BSFENGINE_PROP
protected static final java.lang.String CONVERTOR_PROP
public static final java.lang.String SCRIPT_SRC_PROP
public void invokeBusinessLogic(MessageContext inMC, MessageContext outMC) throws AxisFault
invokeBusinessLogic in class AbstractInOutSyncMessageReceiverAxisFaultprotected org.apache.bsf.BSFEngine getBSFEngine(MessageContext mc) throws AxisFault
AxisFaultprotected org.apache.bsf.BSFEngine initScript(MessageContext mc) throws AxisFault
AxisFaultCopyright © 2004-2025 The Apache Software Foundation. All Rights Reserved.