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
AdaptrisMessageConsumerinstances.- Since:
- 3.0.3 extends
ComponentLifecycleExtensionto satisfy any underlying pre-initialisation activities.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddExceptionListener(StateManagedComponent comp)Add a component that will be notified upon exception.voidaddMessageConsumer(AdaptrisMessageConsumer consumer)Adds aAdaptrisMessageConsumerto this connection's internal store of message consumers.voidaddMessageProducer(AdaptrisMessageProducer producer)Adds aAdaptrisMessageProducerto this connection's internal store of message producers.AdaptrisConnectioncloneForTesting()Make a copy of this object for test purposes.ConnectionErrorHandlerconnectionErrorHandler()Returns the currently activeConnectionErrorHandlerConnectionErrorHandlergetConnectionErrorHandler()Returns the configuredConnectionErrorHandler.<T> TretrieveConnection(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 aListof this connection'sAdaptrisMessageConsumers.java.util.Set<AdaptrisMessageProducer>retrieveMessageProducers()Returns aListof this connection'sAdaptrisMessageProducers.voidsetConnectionErrorHandler(ConnectionErrorHandler handler)Sets theConnectionErrorHandlerto 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
AdaptrisMessageProducerto this connection's internal store of message producers.- Parameters:
producer- theAdaptrisMessageProducerto add- Throws:
CoreException- wrapping any underlyingExceptions
-
retrieveMessageProducers
java.util.Set<AdaptrisMessageProducer> retrieveMessageProducers()
Returns a
Listof this connection'sAdaptrisMessageProducers.- Returns:
- a
Listof this connection'sAdaptrisMessageProducers
-
addMessageConsumer
void addMessageConsumer(AdaptrisMessageConsumer consumer) throws CoreException
Adds a
AdaptrisMessageConsumerto this connection's internal store of message consumers.- Parameters:
consumer- theAdaptrisMessageConsumerto add- Throws:
CoreException- wrapping any underlyingExceptions
-
retrieveMessageConsumers
java.util.Set<AdaptrisMessageConsumer> retrieveMessageConsumers()
Returns a
Listof this connection'sAdaptrisMessageConsumers.- Returns:
- a
Listof this connection'sAdaptrisMessageConsumers
-
setConnectionErrorHandler
void setConnectionErrorHandler(ConnectionErrorHandler handler)
Sets theConnectionErrorHandlerto 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
-
-