Interface AdaptrisConnection

All Superinterfaces:
AdaptrisComponent, ComponentLifecycle, ComponentLifecycleExtension, StateManagedComponent
All Known Implementing Classes:
AdaptrisConnectionImp, AdvancedJdbcPooledConnection, AllowsRetriesConnection, CacheConnection, DatabaseConnection, EmbeddedConnection, FailoverJdbcConnection, FailoverJmsConnection, FileTransferConnection, FileTransferConnectionUsingPassword, FtpConnection, FtpConnectionImp, FtpSslConnection, HttpConnection, HttpsConnection, JdbcConnection, JdbcPooledConnection, JdbcPooledConnectionImpl, JettyConnection, JmsConnection, JmxConnection, NoOpConnection, NullConnection, PluggableJdbcPooledConnection, SharedConnection, StandardSftpConnection

public interface AdaptrisConnection extends AdaptrisComponent, ComponentLifecycleExtension, StateManagedComponent

Represents a connection to an application or of a protocol type. E.g. JMS, database, etc.

It is generally the responsibility of implementations of this interface to to deliver messages to registered AdaptrisMessageConsumer instances.

Since:
3.0.3 extends ComponentLifecycleExtension to satisfy any underlying pre-initialisation activities.
  • Method Details

    • retrieveExceptionListeners

      Set<StateManagedComponent> retrieveExceptionListeners()
      Return a collection of components that need to be restarted on exception.
      Returns:
      a list of Components that need to be restarted of any exceptions.
      See Also:
    • addExceptionListener

      void addExceptionListener(StateManagedComponent comp)
      Add a component that will be notified upon exception.
      Parameters:
      comp - the component that will be notified.
    • addMessageProducer

      void addMessageProducer(AdaptrisMessageProducer producer) throws CoreException

      Adds a AdaptrisMessageProducer to this connection's internal store of message producers.

      Parameters:
      producer - the AdaptrisMessageProducer to add
      Throws:
      CoreException - wrapping any underlying Exceptions
    • retrieveMessageProducers

      Set<AdaptrisMessageProducer> retrieveMessageProducers()

      Returns a List of this connection's AdaptrisMessageProducers.

      Returns:
      a List of this connection's AdaptrisMessageProducers
    • addMessageConsumer

      void addMessageConsumer(AdaptrisMessageConsumer consumer) throws CoreException

      Adds a AdaptrisMessageConsumer to this connection's internal store of message consumers.

      Parameters:
      consumer - the AdaptrisMessageConsumer to add
      Throws:
      CoreException - wrapping any underlying Exceptions
    • retrieveMessageConsumers

      Set<AdaptrisMessageConsumer> retrieveMessageConsumers()

      Returns a List of this connection's AdaptrisMessageConsumers.

      Returns:
      a List of this connection's AdaptrisMessageConsumers
    • setConnectionErrorHandler

      void setConnectionErrorHandler(ConnectionErrorHandler handler)
      Sets the ConnectionErrorHandler to use.
    • getConnectionErrorHandler

      ConnectionErrorHandler getConnectionErrorHandler()
      Returns the configured ConnectionErrorHandler.
    • connectionErrorHandler

      ConnectionErrorHandler connectionErrorHandler()
      Returns the currently active ConnectionErrorHandler
      Returns:
      the active ConnectionErrorHandler, which may not be the same as the configured...
    • retrieveConnection

      <T> T retrieveConnection(Class<T> type)
      Return the connection as represented by this connection
      Parameters:
      type - the type of connection
      Returns:
      the connection
    • cloneForTesting

      AdaptrisConnection cloneForTesting() throws CoreException
      Make a copy of this object for test purposes.
      Returns:
      a copy of this object
      Throws:
      CoreException - wrapping any exceptions