Class JdbcSenderBase<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:
JdbcQuerySenderBase

public abstract class JdbcSenderBase<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

    • JdbcSenderBase

      public JdbcSenderBase()
  • 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
    • 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
      Throws:
      SenderException
    • close

      public void close()
      Description copied from interface: ISender
      Stop/close the sender and deallocate resources.
      Specified by:
      close in interface ISender
      Overrides:
      close 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

      public final SenderResult sendMessage(Message message, 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()