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 String |
BSFENGINE_PROP |
static String |
CONVERTOR_ATTR |
protected static String |
CONVERTOR_PROP |
static String |
DEFAULT_FUNCTION |
static String |
FUNCTION_ATTR |
static String |
SCRIPT_ATTR |
static 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 String |
readScript(ClassLoader cl,
String scriptName)
Reads the complete script source code into a String
|
invokeBusinessLogic
getSOAPFactory, getTheImplementationObject, makeNewServiceObject, receive, replicateState, restoreThreadContext, setThreadContext
public static final String SCRIPT_ATTR
public static final String FUNCTION_ATTR
public static final String DEFAULT_FUNCTION
public static final String CONVERTOR_ATTR
protected static final String BSFENGINE_PROP
protected static final String CONVERTOR_PROP
public static final String SCRIPT_SRC_PROP
public void invokeBusinessLogic(MessageContext inMC, MessageContext outMC) throws AxisFault
invokeBusinessLogic
in class AbstractInOutSyncMessageReceiver
AxisFault
protected org.apache.bsf.BSFEngine getBSFEngine(MessageContext mc) throws AxisFault
AxisFault
protected org.apache.bsf.BSFEngine initScript(MessageContext mc) throws AxisFault
AxisFault
protected String readScript(ClassLoader cl, String scriptName) throws AxisFault
AxisFault
Copyright © 2004-2015 The Apache Software Foundation. All Rights Reserved.