Class CompositeSender

All Implemented Interfaces:
AdapterAware, FrankElement, HasApplicationContext, HasName, IConfigurable, IScopeProvider, ISender, ISenderWithParameters, IWithParameters, NameAware, org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle

public class CompositeSender extends AbstractSenderWithParameters implements org.springframework.beans.factory.InitializingBean, AdapterAware
Pipe that allows you to call a Frank!Framework Plugin. Just like a FrankSender this pipe calls a sub-process, or sub-adapter. As not all session variables are copied over, if you wish to propagate a value, you can do so by using Parameters. For example:
<ForEachChildElementPipe name="callPluginAsSender" ...>
    <CompositeSender name="plugin" plugin="demo-plugin" ref="demo-test-part.xml">
        <Param name="inject-me" value="im a value" />
        <Param name="inject-me-too" sessionKey="originalMessage" />
    </CompositeSender>
</ForEachChildElementPipe>
Author:
Niels Meijer
See Also:
  • Constructor Details

  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • 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 AbstractSenderWithParameters
      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 AbstractSender
    • stop

      public void stop()
      Description copied from interface: ISender
      Stop/close the sender and deallocate resources.
      Specified by:
      stop in interface ISender
      Specified by:
      stop in interface org.springframework.context.Lifecycle
      Overrides:
      stop in class AbstractSender
    • sendMessage

      public @NonNull SenderResult sendMessage(@NonNull Message message, @NonNull PipeLineSession parentSession) throws SenderException
      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
    • setPlugin

      public void setPlugin(String pluginName)
      Functional name of the plugin to load.
    • setRef

      @Default("Configuration.xml") public void setRef(String partReference)
      File in the Plugin which contains the <PipelinePart /> to call. Defaults to "Configuration.xml" but can be any XML file.