Class SharedConnection
- All Implemented Interfaces:
AdaptrisComponent,AdaptrisConnection,ComponentLifecycle,ComponentLifecycleExtension,StateManagedComponent
SharedComponentList.In the adapter configuration file this class is aliased as shared-connection which is the preferred alternative to the fully qualified classname when building your configuration.
-
Constructor Summary
Constructors -
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.voidchangeState(ComponentState newState) Updates the state for the componentComponentState.Make a copy of this object for test purposes.voidclose()Closes the component.Returns the currently activeConnectionErrorHandlerReturns the configuredConnectionErrorHandler.Get the unique-id that is associated with this component.voidinit()Initialises the component.voidprepare()Prepare for initialisation.voidRequest this component is closed.voidRequest this component is init'd.voidRequest this component is started.voidRequest this component is stopped.Returns the last recordeComponentState.<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.voidsetLookupName(String jndiName) Set the unique-id of the connection that we will lookup.voidstart()Starts the component.voidstop()Stop the componentMethods inherited from class com.adaptris.core.SharedComponent
triggerJndiLookup
-
Constructor Details
-
SharedConnection
public SharedConnection() -
SharedConnection
-
-
Method Details
-
init
Description copied from interface:ComponentLifecycleInitialises the component.Component initialisation includes config verification, creation of connections etc.
- Specified by:
initin interfaceComponentLifecycle- Throws:
CoreException- wrapping any underlyingExceptions
-
start
Description copied from interface:ComponentLifecycleStarts the component.Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer, calling start will begin message delivery.- Specified by:
startin interfaceComponentLifecycle- Throws:
CoreException- wrapping any underlyingExceptions
-
stop
public void stop()Description copied from interface:ComponentLifecycleStop the componentA stopped component is not expected to be ready to process messages. In the case of
AdaptrisMessageConsumer, calling stop will pause message delivery. Throwing aRuntimeExceptionmay cause unintended consequences- Specified by:
stopin interfaceComponentLifecycle
-
close
public void close()Description copied from interface:ComponentLifecycleCloses the component.A closed component should release any connections it uses, etc. and clean up completely. Throwing a
RuntimeExceptionmay cause unintended consequences- Specified by:
closein interfaceComponentLifecycle
-
changeState
Description copied from interface:StateManagedComponentUpdates the state for the component
ComponentState.- Specified by:
changeStatein interfaceStateManagedComponent
-
retrieveComponentState
Description copied from interface:StateManagedComponentReturns the last recorde
ComponentState.- Specified by:
retrieveComponentStatein interfaceStateManagedComponent- Returns:
- the current
ComponentState
-
requestInit
Description copied from interface:StateManagedComponentRequest this component is init'd.
- Specified by:
requestInitin interfaceStateManagedComponent- Throws:
CoreException- wrapping any underlying Exceptions
-
requestStart
Description copied from interface:StateManagedComponentRequest this component is started.
- Specified by:
requestStartin interfaceStateManagedComponent- Throws:
CoreException- wrapping any underlying Exceptions
-
requestStop
public void requestStop()Description copied from interface:StateManagedComponentRequest this component is stopped.
- Specified by:
requestStopin interfaceStateManagedComponent
-
requestClose
public void requestClose()Description copied from interface:StateManagedComponentRequest this component is closed.
- Specified by:
requestClosein interfaceStateManagedComponent
-
getUniqueId
Description copied from interface:AdaptrisComponentGet the unique-id that is associated with this component.- Specified by:
getUniqueIdin interfaceAdaptrisComponent- Returns:
- the unique-id
-
retrieveExceptionListeners
Description copied from interface:AdaptrisConnectionReturn a collection of components that need to be restarted on exception.- Specified by:
retrieveExceptionListenersin interfaceAdaptrisConnection- Returns:
- a list of Components that need to be restarted of any exceptions.
- See Also:
-
addExceptionListener
Description copied from interface:AdaptrisConnectionAdd a component that will be notified upon exception.- Specified by:
addExceptionListenerin interfaceAdaptrisConnection- Parameters:
comp- the component that will be notified.
-
addMessageProducer
Description copied from interface:AdaptrisConnectionAdds a
AdaptrisMessageProducerto this connection's internal store of message producers.- Specified by:
addMessageProducerin interfaceAdaptrisConnection- Parameters:
producer- theAdaptrisMessageProducerto add- Throws:
CoreException- wrapping any underlyingExceptions
-
retrieveMessageProducers
Description copied from interface:AdaptrisConnectionReturns a
Listof this connection'sAdaptrisMessageProducers.- Specified by:
retrieveMessageProducersin interfaceAdaptrisConnection- Returns:
- a
Listof this connection'sAdaptrisMessageProducers
-
addMessageConsumer
Description copied from interface:AdaptrisConnectionAdds a
AdaptrisMessageConsumerto this connection's internal store of message consumers.- Specified by:
addMessageConsumerin interfaceAdaptrisConnection- Parameters:
consumer- theAdaptrisMessageConsumerto add- Throws:
CoreException- wrapping any underlyingExceptions
-
retrieveMessageConsumers
Description copied from interface:AdaptrisConnectionReturns a
Listof this connection'sAdaptrisMessageConsumers.- Specified by:
retrieveMessageConsumersin interfaceAdaptrisConnection- Returns:
- a
Listof this connection'sAdaptrisMessageConsumers
-
setConnectionErrorHandler
Description copied from interface:AdaptrisConnectionSets theConnectionErrorHandlerto use.- Specified by:
setConnectionErrorHandlerin interfaceAdaptrisConnection
-
getConnectionErrorHandler
Description copied from interface:AdaptrisConnectionReturns the configuredConnectionErrorHandler.- Specified by:
getConnectionErrorHandlerin interfaceAdaptrisConnection
-
connectionErrorHandler
Description copied from interface:AdaptrisConnectionReturns the currently activeConnectionErrorHandler- Specified by:
connectionErrorHandlerin interfaceAdaptrisConnection- Returns:
- the active
ConnectionErrorHandler, which may not be the same as the configured...
-
retrieveConnection
Description copied from interface:AdaptrisConnectionReturn the connection as represented by this connection- Specified by:
retrieveConnectionin interfaceAdaptrisConnection- Parameters:
type- the type of connection- Returns:
- the connection
-
getLookupName
-
setLookupName
Set the unique-id of the connection that we will lookup.- Parameters:
jndiName- the name
-
prepare
Description copied from interface:ComponentLifecycleExtensionPrepare for initialisation.- Specified by:
preparein interfaceComponentLifecycleExtension- Throws:
CoreException
-
cloneForTesting
Description copied from interface:AdaptrisConnectionMake a copy of this object for test purposes.- Specified by:
cloneForTestingin interfaceAdaptrisConnection- Returns:
- a copy of this object
- Throws:
CoreException- wrapping any exceptions
-