Class AbstractJdbcSender<H>

java.lang.Object
org.frankframework.jdbc.JdbcFacade
org.frankframework.jdbc.AbstractJdbcSender<H>
All Implemented Interfaces:
FrankElement, HasApplicationContext, HasName, HasPhysicalDestination, IBlockEnabledSender<H>, IConfigurable, IScopeProvider, ISender, ISenderWithParameters, IWithParameters, NameAware, TransactionAware, ConfigurableLifecycle, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle
Direct Known Subclasses:
AbstractJdbcQuerySender

public abstract class AbstractJdbcSender<H> extends JdbcFacade implements IBlockEnabledSender<H>
Base class for building JDBC-senders. TODO: This class has only a single (abstract) subclass so it can be merged into the AbstractJdbcQuerySender
Since:
4.2.h
Author:
Gerrit van Brakel
  • Field Details

  • Constructor Details

    • AbstractJdbcSender

      protected AbstractJdbcSender()
  • Method Details

    • addParameter

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

      public @NonNull ParameterList getParameterList()
      Specified by:
      getParameterList in interface IWithParameters
    • 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 JdbcFacade
      Throws:
      ConfigurationException - in case it was not able to configure the component.
    • getConnection

      public @NonNull 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 @NonNull 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 Object
    • 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