Package com.adaptris.core
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 Summary
Modifier and TypeMethodDescriptionvoid
Add a component that will be notified upon exception.void
addMessageConsumer
(AdaptrisMessageConsumer consumer) Adds aAdaptrisMessageConsumer
to this connection's internal store of message consumers.void
addMessageProducer
(AdaptrisMessageProducer producer) Adds aAdaptrisMessageProducer
to this connection's internal store of message producers.Make a copy of this object for test purposes.Returns the currently activeConnectionErrorHandler
Returns the configuredConnectionErrorHandler
.<T> T
retrieveConnection
(Class<T> type) Return the connection as represented by this connectionReturn a collection of components that need to be restarted on exception.Returns aList
of this connection'sAdaptrisMessageConsumer
s.Returns aList
of this connection'sAdaptrisMessageProducer
s.void
Sets theConnectionErrorHandler
to use.Methods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueId
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init, start, stop
Methods inherited from interface com.adaptris.core.ComponentLifecycleExtension
prepare
Methods inherited from interface com.adaptris.core.StateManagedComponent
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
-
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
Add a component that will be notified upon exception.- Parameters:
comp
- the component that will be notified.
-
addMessageProducer
Adds a
AdaptrisMessageProducer
to this connection's internal store of message producers.- Parameters:
producer
- theAdaptrisMessageProducer
to add- Throws:
CoreException
- wrapping any underlyingException
s
-
retrieveMessageProducers
Set<AdaptrisMessageProducer> retrieveMessageProducers()Returns a
List
of this connection'sAdaptrisMessageProducer
s.- Returns:
- a
List
of this connection'sAdaptrisMessageProducer
s
-
addMessageConsumer
Adds a
AdaptrisMessageConsumer
to this connection's internal store of message consumers.- Parameters:
consumer
- theAdaptrisMessageConsumer
to add- Throws:
CoreException
- wrapping any underlyingException
s
-
retrieveMessageConsumers
Set<AdaptrisMessageConsumer> retrieveMessageConsumers()Returns a
List
of this connection'sAdaptrisMessageConsumer
s.- Returns:
- a
List
of this connection'sAdaptrisMessageConsumer
s
-
setConnectionErrorHandler
Sets theConnectionErrorHandler
to use. -
getConnectionErrorHandler
ConnectionErrorHandler getConnectionErrorHandler()Returns the configuredConnectionErrorHandler
. -
connectionErrorHandler
ConnectionErrorHandler connectionErrorHandler()Returns the currently activeConnectionErrorHandler
- Returns:
- the active
ConnectionErrorHandler
, which may not be the same as the configured...
-
retrieveConnection
Return the connection as represented by this connection- Parameters:
type
- the type of connection- Returns:
- the connection
-
cloneForTesting
Make a copy of this object for test purposes.- Returns:
- a copy of this object
- Throws:
CoreException
- wrapping any exceptions
-