Class AbstractJdbcSender<H>

All Implemented Interfaces:
AdapterAware, HasPhysicalDestination, IBlockEnabledSender<H>, IConfigurable, IConfigurationAware, INamedObject, IScopeProvider, ISender, ISenderWithParameters, IWithParameters, IXAEnabled, HasStatistics, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
AbstractJdbcQuerySender

public abstract class AbstractJdbcSender<H> extends JdbcFacade implements IBlockEnabledSender<H>, HasStatistics, AdapterAware
Base class for building JDBC-senders.
Since:
4.2.h
Author:
Gerrit van Brakel
  • Field Details

  • Constructor Details

    • AbstractJdbcSender

      public AbstractJdbcSender()
  • Method Details

    • addParameter

      public void addParameter(IParameter p)
      Specified by:
      addParameter in interface IWithParameters
    • getParameterList

      public ParameterList getParameterList()
      Specified by:
      getParameterList in interface IWithParameters
    • 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 JdbcFacade
      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 the sendMessage() method.
      Specified by:
      start in interface ISender
    • stop

      public void stop()
      Description copied from interface: ISender
      Stop/close the sender and deallocate resources.
      Specified by:
      stop in interface ISender
      Overrides:
      stop in class JndiBase
    • getConnection

      public Connection getConnection() throws JdbcException
      Description copied from class: JdbcFacade
      Obtains a connection to the datasource.
      Overrides:
      getConnection in class JdbcFacade
      Throws:
      JdbcException
    • sendMessage

      @Nonnull public final 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
    • toString

      public String toString()
      Overrides:
      toString in class JndiBase
    • setTimeout

      public void setTimeout(int i)
      The number of seconds the JDBC driver will wait for a statement object to execute. If the limit is exceeded, a TimeoutException is thrown. A value of 0 means execution time is not limited
      Default value
      0
    • setConfigurationMetrics

      public void setConfigurationMetrics(MetricsInitializer configurationMetrics)
    • getAdapter

      public Adapter getAdapter()
      Specified by:
      getAdapter in interface HasStatistics
    • setAdapter

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

      public int getTimeout()