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
ComponentLifecycleExtensionto satisfy any underlying pre-initialisation activities.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd 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.Make a copy of this object for test purposes.Returns the currently activeConnectionErrorHandlerdefault ConnectionStateHandlerReturns the currently activeConnectionStateHandler.Returns the configuredConnectionErrorHandler.default ConnectionStateHandlerReturns the configuredConnectionStateHandler.default BooleanReturns whether this connection should be exposed as a runtime component.<T> TretrieveConnection(Class<T> type) Return the connection as represented by this connectionReturn a collection of components that need to be restarted on exception.Returns aListof this connection'sAdaptrisMessageConsumers.Returns aListof this connection'sAdaptrisMessageProducers.voidSets theConnectionErrorHandlerto use.default voidSets theConnectionStateHandlerto use.default voidsetRuntimeComponent(Boolean runtimeComponent) Sets whether this connection should be exposed as a runtime component.Methods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueIdMethods inherited from interface com.adaptris.core.ComponentLifecycle
close, init, start, stopMethods inherited from interface com.adaptris.core.ComponentLifecycleExtension
prepareMethods 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
AdaptrisMessageProducerto this connection's internal store of message producers.- Parameters:
producer- theAdaptrisMessageProducerto add- Throws:
CoreException- wrapping any underlyingExceptions
-
retrieveMessageProducers
Set<AdaptrisMessageProducer> retrieveMessageProducers()Returns a
Listof this connection'sAdaptrisMessageProducers.- Returns:
- a
Listof this connection'sAdaptrisMessageProducers
-
addMessageConsumer
Adds a
AdaptrisMessageConsumerto this connection's internal store of message consumers.- Parameters:
consumer- theAdaptrisMessageConsumerto add- Throws:
CoreException- wrapping any underlyingExceptions
-
retrieveMessageConsumers
Set<AdaptrisMessageConsumer> retrieveMessageConsumers()Returns a
Listof this connection'sAdaptrisMessageConsumers.- Returns:
- a
Listof this connection'sAdaptrisMessageConsumers
-
setConnectionErrorHandler
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...
-
setConnectionStateHandler
Sets theConnectionStateHandlerto use. -
getConnectionStateHandler
Returns the configuredConnectionStateHandler. -
connectionStateHandler
Returns the currently activeConnectionStateHandler.- Returns:
- the active
ConnectionStateHandler, which may not be the same as the configured one.
-
getRuntimeComponent
Returns whether this connection should be exposed as a runtime component. -
setRuntimeComponent
Sets whether this connection should be exposed as a runtime component. -
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
-