@Category(value="Advanced") public class JavascriptSender extends SenderSeries
jsFunctionName
method,
you will need to create a parameter on the sender.
It is recommended to have the result of the javascript function be of type String, as the output of the sender will be
of type String.Modifier and Type | Class and Description |
---|---|
static class |
JavascriptSender.JavaScriptEngines |
HasStatistics.Action
senderWrapperProcessor
parameterNamesMustBeUnique, paramList
log
Constructor and Description |
---|
JavascriptSender() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
isSenderConfigured() |
void |
open()
This method will be called to start the sender.
|
SenderResult |
sendMessage(Message message,
PipeLineSession session)
Send a message to some destination (as configured in the Sender object).
|
void |
setEngineName(JavascriptSender.JavaScriptEngines engineName)
the name of the javascript engine to be used
|
void |
setJsFileName(String jsFileName)
the name of the javascript file containing the functions to run
|
void |
setJsFunctionName(String jsFunctionName)
the name of the javascript function that will be called (first)
|
close, configure, consumesSessionVariable, doSendMessage, getSenders, getStatisticsKeeper, iterateOverStatistics, registerSender, setSender
getLogPrefix, setGetInputFromFixedValue, setGetInputFromSessionKey, setPreserveInput, setStoreInputInSessionKey, setStoreResultInSessionKey
addParameter, checkStringAttributeOrParameter, getParameterList, getParameterOverriddenAttributeValue, getParameterOverriddenAttributeValue, getParameterValueList
createBean, getName, setApplicationContext, setName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCache, setCache
isSynchronous, sendMessageOrThrow
getName, setName
getApplicationContext, getName
getConfigurationClassLoader
protected boolean isSenderConfigured()
isSenderConfigured
in class SenderSeries
public void open() throws SenderException
ISender
sendMessage()
method.open
in interface ISender
open
in class SenderSeries
SenderException
public SenderResult sendMessage(Message message, PipeLineSession session) throws SenderException
ISender
configure()
method is called.
The following table shows the difference between synchronous and a-synchronous senders:
synchronous | a-synchronous | |
---|---|---|
ISender.isSynchronous() returns | true | false |
return value of sendMessage() is | the reply-message | the messageId of the message sent |
the correlationID specified with sendMessage() | may be ignored | is sent with the message |
a {link TimeOutException} | may be thrown if a timeout occurs waiting for a reply | should not be expected |
Multiple objects may try to call this method at the same time, from different threads.
Implementations of this method should therefore be thread-safe, or synchronized
.
sendMessage
in interface ISender
sendMessage
in class SenderWrapperBase
SenderException
public void setJsFileName(String jsFileName)
public void setJsFunctionName(String jsFunctionName)
public void setEngineName(JavascriptSender.JavaScriptEngines engineName)
Copyright © 2023 Frank!Framework. All rights reserved.