Class ReconnectSenderWrapper

All Implemented Interfaces:
ICacheEnabled<String,String>, FrankElement, HasApplicationContext, HasName, IConfigurable, IScopeProvider, ISender, ISenderWithParameters, IWithParameters, NameAware, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle

public class ReconnectSenderWrapper extends AbstractSenderWrapper
Wrapper for senders, that opens the wrapped sender at runtime before each sender action, and closes it afterwards. This prevents (long) open connections inside Senders and possible connection failures. Example:

 <SenderPipe>
     <ReconnectSenderWrapper>
         <EchoSender myAttribute="myValue" />
     </ReconnectSenderWrapper>
 </SenderPipe>
 

Author:
Niels Meijer
  • Constructor Details

    • ReconnectSenderWrapper

      public ReconnectSenderWrapper()
  • Method Details

    • isSenderConfigured

      protected boolean isSenderConfigured()
      Specified by:
      isSenderConfigured in class AbstractSenderWrapper
    • configure

      public void configure() throws ConfigurationException
      Description copied from interface: IConfigurable
      Configure this component.

      configure() is called once at startup of the framework in the configure method of the owner of this IConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in the configure(), to improve performance.

      In the case of a container, this will propagate the configure signal to all components that apply.

      Specified by:
      configure in interface IConfigurable
      Overrides:
      configure in class AbstractSenderWrapper
      Throws:
      ConfigurationException - in case it was not able to configure the component.
    • 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 the sendMessage() method.
      Specified by:
      start in interface ISender
      Specified by:
      start in interface org.springframework.context.Lifecycle
      Overrides:
      start in class AbstractSenderWrapper
    • doSendMessage

      public SenderResult doSendMessage(Message message, PipeLineSession session) throws SenderException, TimeoutException
      Specified by:
      doSendMessage in class AbstractSenderWrapper
      Throws:
      SenderException
      TimeoutException
    • isSynchronous

      public boolean isSynchronous()
      Description copied from interface: ISender
      When true, the result of sendMessage is the reply of the request.
    • setSender

      public void setSender(ISender sender)
      specification of sender to send messages with