Class SenderWrapperBase

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 SenderWrapperBase extends SenderWithParametersBase 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 Details

  • Constructor Details

    • SenderWrapperBase

      public SenderWrapperBase()
  • Method Details

    • configure

      public void configure() throws ConfigurationException
      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 the configure() or open() method, to improve performance.
      Specified by:
      configure in interface IConfigurable
      Specified by:
      configure in interface ISender
      Overrides:
      configure in class SenderWithParametersBase
      Throws:
      ConfigurationException
    • open

      public void open() throws SenderException
      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 the sendMessage() method.
      Specified by:
      open in interface ISender
      Overrides:
      open in class SenderBase
      Throws:
      SenderException
    • close

      public void close() throws SenderException
      Description copied from interface: ISender
      Stop/close the sender and deallocate resources.
      Specified by:
      close in interface ISender
      Overrides:
      close in class SenderBase
      Throws:
      SenderException
    • 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 the configure() method is called.

      The following table shows the difference between synchronous and a-synchronous senders:

       synchronousa-synchronous
      ISender.isSynchronous() returnstruefalse
      return value of sendMessage() isthe reply-messagethe messageId of the message sent
      the correlationID specified with sendMessage()may be ignoredis sent with the message
      a {link TimeOutException}may be thrown if a timeout occurs waiting for a replyshould 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 interface ISender
      Throws:
      SenderException
      TimeoutException
    • setGetInputFromSessionKey

      public void setGetInputFromSessionKey(String string)
      If set, input is taken from this session key, instead of regular input
    • setGetInputFromFixedValue

      public void setGetInputFromFixedValue(String string)
      If set, this fixed value is taken as input, instead of regular input
    • setPreserveInput

      public void setPreserveInput(boolean preserveInput)
      If set true, the input of a pipe is restored before processing the next one
      Default value
      false
    • setStoreResultInSessionKey

      public void setStoreResultInSessionKey(String string)
      If set, the result is stored under this session key
    • setStoreInputInSessionKey

      public void setStoreInputInSessionKey(String string)
      If set, the input is stored under this session key
    • getGetInputFromSessionKey

      public String getGetInputFromSessionKey()
    • getGetInputFromFixedValue

      public String getGetInputFromFixedValue()
    • getStoreResultInSessionKey

      public String getStoreResultInSessionKey()
    • getStoreInputInSessionKey

      public String getStoreInputInSessionKey()
    • isPreserveInput

      public boolean isPreserveInput()
    • setAdapter

      public void setAdapter(Adapter adapter)
      Specified by:
      setAdapter in interface AdapterAware
    • setConfigurationMetrics

      public void setConfigurationMetrics(MetricsInitializer configurationMetrics)
    • setSenderWrapperProcessor

      public void setSenderWrapperProcessor(SenderWrapperProcessor senderWrapperProcessor)
    • getCache

      public ICache<String,String> getCache()
      Specified by:
      getCache in interface ICacheEnabled<String,String>
    • setCache

      public void setCache(ICache<String,String> cache)
      Description copied from interface: ICacheEnabled
      optional cache definition
      Specified by:
      setCache in interface ICacheEnabled<String,String>