Package org.frankframework.senders
Class AbstractSenderWrapper
java.lang.Object
org.frankframework.senders.AbstractSender
org.frankframework.senders.AbstractSenderWithParameters
org.frankframework.senders.AbstractSenderWrapper
- All Implemented Interfaces:
ICacheEnabled<String,
,String> AdapterAware
,IConfigurable
,IConfigurationAware
,INamedObject
,IScopeProvider
,ISender
,ISenderWithParameters
,IWithParameters
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
ReconnectSenderWrapper
,SenderSeries
,SenderWrapper
public abstract class AbstractSenderWrapper
extends AbstractSenderWithParameters
implements AdapterAware, ICacheEnabled<String,String>
Baseclass for Wrappers for senders, that allows to get input from a session variable, and to store output in a session variable.
- Since:
- 4.9
- Author:
- Gerrit van Brakel
-
Field Summary
Modifier and TypeFieldDescriptionprotected Adapter
protected MetricsInitializer
protected SenderWrapperProcessor
Fields inherited from class org.frankframework.senders.AbstractSenderWithParameters
parameterNamesMustBeUnique, paramList
Fields inherited from class org.frankframework.senders.AbstractSender
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure()
is called once at startup of the framework in the configure method of the owner of this sender.abstract SenderResult
doSendMessage
(Message message, PipeLineSession session) getCache()
boolean
protected abstract boolean
sendMessage
(Message message, PipeLineSession session) Send a message to some destination (as configured in the Sender object).void
setAdapter
(Adapter adapter) void
optionalcache
definitionvoid
setConfigurationMetrics
(MetricsInitializer configurationMetrics) void
setGetInputFromFixedValue
(String string) If set, this fixed value is taken as input, instead of regular inputvoid
setGetInputFromSessionKey
(String string) If set, input is taken from this session key, instead of regular inputvoid
setPreserveInput
(boolean preserveInput) If settrue
, the input of a pipe is restored before processing the next onevoid
setSenderWrapperProcessor
(SenderWrapperProcessor senderWrapperProcessor) void
setStoreInputInSessionKey
(String string) If set, the input is stored under this session keyvoid
setStoreResultInSessionKey
(String string) If set, the result is stored under this session keyvoid
start()
This method will be called to start the sender.void
stop()
Stop/close the sender and deallocate resources.Methods inherited from class org.frankframework.senders.AbstractSenderWithParameters
addParameter, checkStringAttributeOrParameter, consumesSessionVariable, getParameterList, getParameterOverriddenAttributeValue, getParameterOverriddenAttributeValue, getParameterValueList
Methods inherited from class org.frankframework.senders.AbstractSender
createBean, getApplicationContext, getConfigurationClassLoader, getLogPrefix, getName, setApplicationContext, setName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContext
Methods inherited from interface org.frankframework.core.IConfigurationAware
getApplicationContext, getName
Methods inherited from interface org.frankframework.core.INamedObject
getName, setName
Methods inherited from interface org.frankframework.core.IScopeProvider
getConfigurationClassLoader
Methods inherited from interface org.frankframework.core.ISender
isSynchronous, sendMessageOrThrow
-
Field Details
-
adapter
-
configurationMetrics
-
senderWrapperProcessor
-
-
Constructor Details
-
AbstractSenderWrapper
public AbstractSenderWrapper()
-
-
Method Details
-
configure
Description copied from interface:ISender
configure()
is called once at startup of the framework in the configure method of the owner of this sender. Purpose of this method is to check whether the static configuration of the sender is correct. As much as possible class-instantiating should take place in theconfigure()
oropen()
method, to improve performance.- Specified by:
configure
in interfaceIConfigurable
- Specified by:
configure
in interfaceISender
- Overrides:
configure
in classAbstractSenderWithParameters
- Throws:
ConfigurationException
-
start
public void start()Description copied from interface:ISender
This method will be called to start the sender. After this method is called the sendMessage method may be called. Purpose of this method is to reduce creating connections to databases etc. in thesendMessage()
method.- Specified by:
start
in interfaceISender
- Overrides:
start
in classAbstractSender
-
stop
public void stop()Description copied from interface:ISender
Stop/close the sender and deallocate resources.- Specified by:
stop
in interfaceISender
- Overrides:
stop
in classAbstractSender
-
isSenderConfigured
protected abstract boolean isSenderConfigured() -
doSendMessage
public abstract SenderResult doSendMessage(@Nonnull Message message, @Nonnull PipeLineSession session) throws SenderException, TimeoutException - Throws:
SenderException
TimeoutException
-
sendMessage
@Nonnull public SenderResult sendMessage(@Nonnull Message message, @Nonnull PipeLineSession session) throws SenderException, TimeoutException Description copied from interface:ISender
Send a message to some destination (as configured in the Sender object). This method may only be called after theconfigure()
method is called.The following table shows the difference between synchronous and a-synchronous senders:
synchronous a-synchronous ISender.isSynchronous()
returnstrue
false
return value of sendMessage()
isthe 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
.- Specified by:
sendMessage
in interfaceISender
- Throws:
SenderException
TimeoutException
-
setGetInputFromSessionKey
If set, input is taken from this session key, instead of regular input -
setGetInputFromFixedValue
If set, this fixed value is taken as input, instead of regular input -
setPreserveInput
public void setPreserveInput(boolean preserveInput) If settrue
, the input of a pipe is restored before processing the next one- Default value
- false
-
setStoreResultInSessionKey
If set, the result is stored under this session key -
setStoreInputInSessionKey
If set, the input is stored under this session key -
getGetInputFromSessionKey
-
getGetInputFromFixedValue
-
getStoreResultInSessionKey
-
getStoreInputInSessionKey
-
isPreserveInput
public boolean isPreserveInput() -
setAdapter
- Specified by:
setAdapter
in interfaceAdapterAware
-
setConfigurationMetrics
-
setSenderWrapperProcessor
-
getCache
- Specified by:
getCache
in interfaceICacheEnabled<String,
String>
-
setCache
Description copied from interface:ICacheEnabled
optionalcache
definition- Specified by:
setCache
in interfaceICacheEnabled<String,
String>
-