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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addExceptionListener(StateManagedComponent comp)
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.AdaptrisConnection
cloneForTesting()
Make a copy of this object for test purposes.ConnectionErrorHandler
connectionErrorHandler()
Returns the currently activeConnectionErrorHandler
ConnectionErrorHandler
getConnectionErrorHandler()
Returns the configuredConnectionErrorHandler
.<T> T
retrieveConnection(java.lang.Class<T> type)
Return the connection as represented by this connectionjava.util.Set<StateManagedComponent>
retrieveExceptionListeners()
Return a collection of components that need to be restarted on exception.java.util.Set<AdaptrisMessageConsumer>
retrieveMessageConsumers()
Returns aList
of this connection'sAdaptrisMessageConsumer
s.java.util.Set<AdaptrisMessageProducer>
retrieveMessageProducers()
Returns aList
of this connection'sAdaptrisMessageProducer
s.void
setConnectionErrorHandler(ConnectionErrorHandler handler)
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 Detail
-
retrieveExceptionListeners
java.util.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:
ConnectionErrorHandler
-
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
- theAdaptrisMessageProducer
to add- Throws:
CoreException
- wrapping any underlyingException
s
-
retrieveMessageProducers
java.util.Set<AdaptrisMessageProducer> retrieveMessageProducers()
Returns a
List
of this connection'sAdaptrisMessageProducer
s.- Returns:
- a
List
of this connection'sAdaptrisMessageProducer
s
-
addMessageConsumer
void addMessageConsumer(AdaptrisMessageConsumer consumer) throws CoreException
Adds a
AdaptrisMessageConsumer
to this connection's internal store of message consumers.- Parameters:
consumer
- theAdaptrisMessageConsumer
to add- Throws:
CoreException
- wrapping any underlyingException
s
-
retrieveMessageConsumers
java.util.Set<AdaptrisMessageConsumer> retrieveMessageConsumers()
Returns a
List
of this connection'sAdaptrisMessageConsumer
s.- Returns:
- a
List
of this connection'sAdaptrisMessageConsumer
s
-
setConnectionErrorHandler
void setConnectionErrorHandler(ConnectionErrorHandler handler)
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
<T> T retrieveConnection(java.lang.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
-
-