public class ScriptingEndpoint extends ProviderEndpoint implements ScriptingEndpointType
| Modifier and Type | Field and Description |
|---|---|
static char |
EXTENSION_SEPARATOR |
static java.lang.String |
KEY_CHANNEL |
static java.lang.String |
KEY_COMPONENT_NAMESPACE |
static java.lang.String |
KEY_CONTEXT |
static java.lang.String |
KEY_ENDPOINT |
static java.lang.String |
KEY_ENDPOINTNAME |
static java.lang.String |
KEY_IN_EXCHANGE |
static java.lang.String |
KEY_IN_MSG |
static java.lang.String |
KEY_INTERFACENAME |
static java.lang.String |
KEY_LOGGER |
static java.lang.String |
KEY_OUT_EXCHANGE |
static java.lang.String |
KEY_OUT_MSG |
static java.lang.String |
KEY_SCRIPT |
static java.lang.String |
KEY_SERVICENAME |
static java.lang.String |
KEY_USER_BINDINGS |
static java.lang.String |
LANGUAGE_AUTODETECT |
definition, description, endpoint, interfaceName, service, serviceUnit| Constructor and Description |
|---|
ScriptingEndpoint() |
| Modifier and Type | Method and Description |
|---|---|
void |
configureTarget(javax.jbi.messaging.MessageExchange exchange)
Configures the target on the newly created exchange
|
protected void |
copyAttachments(javax.jbi.messaging.NormalizedMessage from,
javax.jbi.messaging.NormalizedMessage to)
Copies attachments from one message to another that do not already exist
|
protected void |
copyProperties(javax.jbi.messaging.NormalizedMessage from,
javax.jbi.messaging.NormalizedMessage to)
Copies properties from one message to another that do not already exist
|
protected java.util.logging.Logger |
createScriptLogger() |
protected void |
done(javax.jbi.messaging.MessageExchange messageExchange) |
protected void |
fail(javax.jbi.messaging.MessageExchange messageExchange,
java.lang.Exception e) |
java.util.Map<java.lang.String,java.lang.Object> |
getBindings() |
static java.lang.String |
getExtension(java.lang.String filename) |
java.lang.String |
getLanguage() |
java.lang.String |
getLogResourceBundle() |
ScriptingMarshalerSupport |
getMarshaler() |
org.springframework.core.io.Resource |
getScript() |
java.util.logging.Logger |
getScriptLogger()
returns the script logger
|
java.lang.String |
getTargetEndpoint() |
javax.xml.namespace.QName |
getTargetInterface() |
javax.xml.namespace.QName |
getTargetOperation() |
javax.xml.namespace.QName |
getTargetService() |
java.lang.String |
getTargetUri() |
static int |
indexOfExtension(java.lang.String filename) |
static int |
indexOfLastSeparator(java.lang.String filename) |
boolean |
isCopyAttachments() |
boolean |
isCopyProperties() |
boolean |
isDisableOutput() |
void |
process(javax.jbi.messaging.MessageExchange exchange) |
protected void |
send(javax.jbi.messaging.MessageExchange messageExchange) |
protected void |
sendSync(javax.jbi.messaging.MessageExchange messageExchange) |
void |
setBindings(java.util.Map<java.lang.String,java.lang.Object> bindings)
A Map with additional variables that are made available during script execution.
|
void |
setCopyAttachments(boolean copyAttachments)
Copy the attachments into the 'out' message.
|
void |
setCopyProperties(boolean copyProperties)
Copy the properties into the 'out' message.
|
void |
setDisableOutput(boolean disableOutput)
Set this flag to true to
true to avoid sending back a response message. |
void |
setLanguage(java.lang.String language)
The scripting language to be used.
|
void |
setLogResourceBundle(java.lang.String logResourceBundle)
The resource bundle to use when logging internationalized messages.
|
void |
setMarshaler(ScriptingMarshalerSupport marshaler)
Custom marshaler implementation to handle startup/shutdown, loading the script code and registering additional user beans.
|
void |
setScript(org.springframework.core.io.Resource script)
Spring Resource referring to the script location.
|
void |
setScriptLogger(java.util.logging.Logger scriptLogger)
Sets the logger to use if the script decides to log.
|
void |
setTargetEndpoint(java.lang.String targetEndpoint)
Target endpoint for the output exchange that is created by the script.
|
void |
setTargetInterface(javax.xml.namespace.QName targetInterface)
Target interface for the output exchange that is created by the script.
|
void |
setTargetOperation(javax.xml.namespace.QName targetOperation)
Target operation for the output exchange that is created by the script.
|
void |
setTargetService(javax.xml.namespace.QName targetService)
Target service for the output exchange that is created by the script.
|
void |
setTargetUri(java.lang.String targetUri)
URI for configuring target service/endpoint/interface for the exchange that is created by the script.
|
void |
start() |
void |
stop() |
activate, deactivate, getRole, processInOnly, processInOutgetChannel, getContext, getExchangeFactorygetDefinition, getDescription, getEndpoint, getInterfaceName, getKey, getService, getServiceUnit, isExchangeOkay, prepareExchange, setDefinition, setDescription, setEndpoint, setInterfaceName, setService, setServiceUnit, toString, validatepublic static final java.lang.String KEY_CHANNEL
public static final java.lang.String KEY_COMPONENT_NAMESPACE
public static final java.lang.String KEY_CONTEXT
public static final java.lang.String KEY_ENDPOINT
public static final java.lang.String KEY_ENDPOINTNAME
public static final java.lang.String KEY_IN_EXCHANGE
public static final java.lang.String KEY_IN_MSG
public static final java.lang.String KEY_OUT_EXCHANGE
public static final java.lang.String KEY_OUT_MSG
public static final java.lang.String KEY_INTERFACENAME
public static final java.lang.String KEY_LOGGER
public static final java.lang.String KEY_SCRIPT
public static final java.lang.String KEY_SERVICENAME
public static final java.lang.String KEY_USER_BINDINGS
public static final java.lang.String LANGUAGE_AUTODETECT
public static final char EXTENSION_SEPARATOR
protected java.util.logging.Logger createScriptLogger()
throws javax.jbi.messaging.MessagingException
javax.jbi.messaging.MessagingExceptionprotected void done(javax.jbi.messaging.MessageExchange messageExchange)
throws javax.jbi.messaging.MessagingException
done in class SimpleEndpointjavax.jbi.messaging.MessagingExceptionprotected void fail(javax.jbi.messaging.MessageExchange messageExchange,
java.lang.Exception e)
throws javax.jbi.messaging.MessagingException
fail in class SimpleEndpointjavax.jbi.messaging.MessagingExceptionpublic java.util.Map<java.lang.String,java.lang.Object> getBindings()
public java.lang.String getLanguage()
public java.lang.String getLogResourceBundle()
public ScriptingMarshalerSupport getMarshaler()
public org.springframework.core.io.Resource getScript()
public java.util.logging.Logger getScriptLogger()
throws javax.jbi.messaging.MessagingException
javax.jbi.messaging.MessagingExceptionpublic boolean isDisableOutput()
public void process(javax.jbi.messaging.MessageExchange exchange)
throws java.lang.Exception
process in interface Endpointprocess in class ProviderEndpointjava.lang.Exceptionprotected void send(javax.jbi.messaging.MessageExchange messageExchange)
throws javax.jbi.messaging.MessagingException
send in class SimpleEndpointjavax.jbi.messaging.MessagingExceptionprotected void sendSync(javax.jbi.messaging.MessageExchange messageExchange)
throws javax.jbi.messaging.MessagingException
sendSync in class SimpleEndpointjavax.jbi.messaging.MessagingExceptionpublic void setBindings(java.util.Map<java.lang.String,java.lang.Object> bindings)
bindings - the bindings to setpublic void setDisableOutput(boolean disableOutput)
true to avoid sending back a response message.
Defaults to falsedisableOutput - the disableOutput to setpublic void setLanguage(java.lang.String language)
autodetect to determine the language
by the script file extension.language - The language to set.public void setLogResourceBundle(java.lang.String logResourceBundle)
logResourceBundle - The logResourceBundle to set.public void setMarshaler(ScriptingMarshalerSupport marshaler)
marshaler - the marshaler to setpublic void setScript(org.springframework.core.io.Resource script)
script - the script to setpublic void setScriptLogger(java.util.logging.Logger scriptLogger)
scriptLogger - public void start()
throws java.lang.Exception
start in interface Endpointstart in class SimpleEndpointjava.lang.Exceptionpublic void stop()
throws java.lang.Exception
stop in interface Endpointstop in class SimpleEndpointjava.lang.Exceptionprotected void copyProperties(javax.jbi.messaging.NormalizedMessage from,
javax.jbi.messaging.NormalizedMessage to)
from - the message containing the propertiesto - the destination message where the properties are setprotected void copyAttachments(javax.jbi.messaging.NormalizedMessage from,
javax.jbi.messaging.NormalizedMessage to)
throws javax.jbi.messaging.MessagingException
from - the message with the attachmentsto - the destination message where the attachments are to be addedjavax.jbi.messaging.MessagingException - if an attachment could not be addedpublic static java.lang.String getExtension(java.lang.String filename)
public static int indexOfExtension(java.lang.String filename)
public static int indexOfLastSeparator(java.lang.String filename)
public void configureTarget(javax.jbi.messaging.MessageExchange exchange)
throws javax.jbi.messaging.MessagingException
exchange - the exchange to configurejavax.jbi.messaging.MessagingException - if the target could not be configuredpublic boolean isCopyProperties()
public void setCopyProperties(boolean copyProperties)
true.copyProperties - The copyProperties to set.public boolean isCopyAttachments()
public void setCopyAttachments(boolean copyAttachments)
true.copyAttachments - The copyAttachments to set.public javax.xml.namespace.QName getTargetInterface()
public void setTargetInterface(javax.xml.namespace.QName targetInterface)
targetInterface - The targetInterface to set.public javax.xml.namespace.QName getTargetOperation()
public void setTargetOperation(javax.xml.namespace.QName targetOperation)
targetOperation - The targetOperation to set.public javax.xml.namespace.QName getTargetService()
public void setTargetService(javax.xml.namespace.QName targetService)
targetService - The targetService to set.public java.lang.String getTargetEndpoint()
public void setTargetEndpoint(java.lang.String targetEndpoint)
targetEndpoint - The targetEndpoint to set.public java.lang.String getTargetUri()
public void setTargetUri(java.lang.String targetUri)
targetUri - The targetUri to set.Copyright © 2005-2014 FuseSource. All Rights Reserved.