Class SimpleJdbcListener

java.lang.Object
org.frankframework.jdbc.JdbcFacade
org.frankframework.jdbc.SimpleJdbcListener
All Implemented Interfaces:
FrankElement, HasApplicationContext, HasName, HasPhysicalDestination, IConfigurable, IListener<String>, IPullingListener<String>, IScopeProvider, IXAEnabled, NameAware, ConfigurableLifecycle, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

@Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Please use JdbcTableListener (also non-locking) to perform a count query or let it directly return messages.") public class SimpleJdbcListener extends JdbcFacade implements IPullingListener<String>
Deprecated, for removal: This API element is subject to removal in a future version.
Database Listener that returns a count of messages available, but does not perform any locking or other management of processing messages in parallel.
Author:
Peter Leeuwenburgh
  • Field Details

    • KEYWORD_SELECT_COUNT

      protected static final String KEYWORD_SELECT_COUNT
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • connection

      protected Connection connection
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • SimpleJdbcListener

      public SimpleJdbcListener()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • configure

      public void configure() throws ConfigurationException
      Deprecated, for removal: This API element is subject to removal in a future version.
      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.
    • start

      public void start()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IListener
      Prepares the listener for receiving messages. start() is called once each time the listener is started.
      Specified by:
      start in interface ConfigurableLifecycle
      Specified by:
      start in interface IListener<String>
      Specified by:
      start in interface org.springframework.context.Lifecycle
      Overrides:
      start in class JdbcFacade
    • stop

      public void stop()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IListener
      Close all resources used for listening. Called once each time the listener is stopped.
      Specified by:
      stop in interface IListener<String>
      Specified by:
      stop in interface org.springframework.context.Lifecycle
      Overrides:
      stop in class JdbcFacade
    • openThread

      public @NonNull Map<String,Object> openThread() throws ListenerException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IPullingListener
      Prepares a thread for receiving messages. Called once for each thread that will listen for messages.
      Specified by:
      openThread in interface IPullingListener<String>
      Returns:
      the threadContext for this thread. The threadContext is a Map in which thread-specific data can be stored. May not be null, must be a mutable map type.
      Throws:
      ListenerException
    • closeThread

      public void closeThread(@NonNull Map<String,Object> threadContext) throws ListenerException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IPullingListener
      Finalizes a message receiving thread. Called once for each thread that listens for messages, just before IListener.stop() is called.
      Specified by:
      closeThread in interface IPullingListener<String>
      Throws:
      ListenerException
    • getRawMessage

      public @Nullable RawMessageWrapper<String> getRawMessage(@NonNull Map<String,Object> threadContext) throws ListenerException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IPullingListener
      Retrieves messages from queue or other channel, but does no processing on it. 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.

      Any thread-specific properties should be stored in and retrieved from the threadContext.

      Specified by:
      getRawMessage in interface IPullingListener<String>
      Throws:
      ListenerException
    • getRawMessage

      protected RawMessageWrapper<String> getRawMessage(Connection conn, Map<String,Object> threadContext) throws ListenerException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      ListenerException
    • extractMessage

      public Message extractMessage(@NonNull RawMessageWrapper<String> rawMessage, @NonNull Map<String,Object> context)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IListener
      Extracts data from message obtained from IPullingListener.getRawMessage(Map) or IPushingListener.wrapRawMessage(Object, PipeLineSession). May also extract other parameters from the message and put those into the context.
      Specified by:
      extractMessage in interface IListener<String>
      Parameters:
      rawMessage - The RawMessageWrapper from which to extract the Message.
      context - Context to populate. Either a PipeLineSession or a Map threadContext depending on caller.
      Returns:
      input Message for adapter.
    • executeQuery

      protected ResultSet executeQuery(Connection conn, String query) throws ListenerException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      ListenerException
    • afterMessageProcessed

      public void afterMessageProcessed(PipeLineResult processResult, RawMessageWrapper<String> rawMessage, PipeLineSession pipeLineSession)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IListener
      Called to perform actions (like committing or sending a reply) after a message has been processed by the Pipeline.
      Specified by:
      afterMessageProcessed in interface IListener<String>
    • execute

      protected void execute(Connection conn, String query) throws ListenerException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      ListenerException
    • execute

      protected void execute(Connection conn, String query, String parameter) throws ListenerException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      ListenerException
    • setSelectQuery

      public void setSelectQuery(String string)
      Deprecated, for removal: This API element is subject to removal in a future version.
      count query that returns the number of available records. when there are available records the pipeline is activated
    • getSelectQuery

      public String getSelectQuery()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • isTrace

      public boolean isTrace()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setTrace

      public void setTrace(boolean trace)
      Deprecated, for removal: This API element is subject to removal in a future version.