Package com.adaptris.core
Interface ConnectionStateHandler
- All Superinterfaces:
ComponentLifecycle
- All Known Implementing Classes:
ConnectionStateHandlerImp
Lifecycle extension point for reacting to connection state transitions.
Implementations are attached to an AdaptrisConnection and are invoked by the
standard connection lifecycle (ComponentLifecycle.init(), ComponentLifecycle.start(), ComponentLifecycle.stop(), ComponentLifecycle.close()).
This lets a handler observe external signals (for example reconnecting/reconnected events)
and update connection state via StateManagedComponent.changeState(ComponentState) when appropriate.
-
Method Summary
Modifier and TypeMethodDescriptionvoidregisterConnection(AdaptrisConnection connection) Register the owning connection instance before lifecycle methods are invoked.<T> TretrieveConnection(Class<T> type) Return the registered connection as the requested type.Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init, start, stop
-
Method Details
-
registerConnection
Register the owning connection instance before lifecycle methods are invoked.- Parameters:
connection- the connection that owns this handler
-
retrieveConnection
Return the registered connection as the requested type.- Type Parameters:
T- target type- Parameters:
type- the expected connection type- Returns:
- the registered connection cast to
type
-