@ComponentProfile(summary="The base container for integration activity",
tag="base")
public final class Adapter
extends java.lang.Object
implements StateManagedComponentContainer, ComponentLifecycleExtension
Main class in core package. Uses other core components to consume and produce messages. Provides error
and event handling capabilities. Client classes, e.g. com.adaptris.core.management.Bootstrap create and manage
instances of this class.
In the adapter configuration file this class is aliased as adapter which is the preferred alternative to the fully qualified classname when building your configuration.
| Constructor and Description |
|---|
Adapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
castorWorkAround()
Deprecated.
|
void |
changeState(ComponentState newState)
Updates the state for the component
ComponentState. |
void |
close()
Closes the component.
|
ChannelList |
getChannelList()
Returns the
ChannelList. |
EventHandler |
getEventHandler()
Returns the
EventHandler. |
FailedMessageRetrier |
getFailedMessageRetrier()
Returns the
FailedMessageRetrier to use. |
java.lang.String |
getHeartbeatEventImp()
Returns the class name of the heartbeat event imp to use.
|
TimeInterval |
getHeartbeatEventInterval() |
LogHandler |
getLogHandler() |
MessageErrorDigester |
getMessageErrorDigester() |
ProcessingExceptionHandler |
getMessageErrorHandler()
Returns the configured
MessageErrorHandler. |
SharedComponentList |
getSharedComponents() |
java.lang.String |
getStartUpEventImp()
Returns the name of the start up event class to use.
|
java.lang.String |
getUniqueId()
Returns this instances unique id.
|
void |
init()
Initialise the adapter including the
EventHandler. |
java.util.Date |
lastStartTime()
The last time the adapter was started
|
java.util.Date |
lastStopTime()
The last time the adapter was stopped
|
LogHandler |
logHandler() |
void |
prepare()
Ensures that the adapter is ready for initialisation.
|
void |
requestChildClose()
Close any independent sub components.
|
void |
requestChildInit()
Initialise any independent sub-components.
|
void |
requestChildStart()
Start any independent sub components.
|
void |
requestChildStop()
Stop any independent sub components.
|
void |
requestClose()
Request this component is closed.
|
void |
requestInit()
Request this component is init'd.
|
void |
requestStart()
Request this component is started.
|
void |
requestStop()
Request this component is stopped.
|
ComponentState |
retrieveComponentState()
Returns the last recorde
ComponentState. |
void |
setChannelList(ChannelList param)
Sets the
ChannelList. |
void |
setEventHandler(EventHandler param)
Sets the
EventHandler. |
void |
setFailedMessageRetrier(FailedMessageRetrier retrier)
Sets the
FailedMessageRetrier to use. |
void |
setHeartbeatEventImp(java.lang.String name)
Sets the class name of the heartbeat event imp to use.
|
void |
setHeartbeatEventInterval(TimeInterval interval)
Set the event between which heartbeat events are emitted.
|
void |
setLogHandler(LogHandler logHandler) |
void |
setMessageErrorDigester(MessageErrorDigester messageErrorDigest) |
void |
setMessageErrorHandler(ProcessingExceptionHandler param)
Sets the configured
ProcessingExceptionHandler for the Adapter level. |
void |
setSharedComponents(SharedComponentList scl)
Get the shared components that are available for injection into other managed components.
|
void |
setStartUpEventImp(java.lang.String name)
Sets the name of the start up event class to use.
|
void |
setUniqueId(java.lang.String s)
Sets this instance's unique id.
|
void |
start()
Starts the component.
|
void |
stop()
Stop the component
|
@Deprecated
public void castorWorkAround()
throws CoreException
CoreExceptionpublic void prepare()
throws CoreException
Ensures that the adapter is ready for initialisation.
prepare in interface ComponentLifecycleExtensionCoreException - wrapping any underlying Exceptionspublic void init()
throws CoreException
Initialise the adapter including the EventHandler. Implements method defined in AdaptrisMBean, hence
public.
init in interface ComponentLifecycleCoreException - wrapping any underlying ExceptionsAdaptrisComponentpublic void start()
throws CoreException
ComponentLifecycle
Once a component is started it should be ready to process messages. In the case of AdaptrisMessageConsumer, calling start
will begin message delivery.
start in interface ComponentLifecycleCoreException - wrapping any underlying ExceptionsComponentLifecycle.start()public void stop()
ComponentLifecycle
A stopped component is not expected to be ready to process messages. In the case of AdaptrisMessageConsumer, calling stop
will pause message delivery. Throwing a RuntimeException may cause unintended consequences
stop in interface ComponentLifecycleAdaptrisComponentpublic void close()
ComponentLifecycle
A closed component should release any connections it uses, etc. and clean up completely. Throwing a RuntimeException may
cause unintended consequences
close in interface ComponentLifecycleAdaptrisComponentpublic void setChannelList(ChannelList param)
Sets the ChannelList.
param - the ChannelList to use.public ChannelList getChannelList()
Returns the ChannelList.
ChannelListpublic void setUniqueId(java.lang.String s)
Sets this instance's unique id. Unique ids are implementation-specific.
s - the unique id to setpublic java.lang.String getUniqueId()
Returns this instances unique id.
getUniqueId in interface AdaptrisComponentpublic void setEventHandler(EventHandler param)
Sets the EventHandler.
param - the EventHandler to use.public EventHandler getEventHandler()
Returns the EventHandler.
EventHandlerpublic void setMessageErrorHandler(ProcessingExceptionHandler param)
Sets the configured ProcessingExceptionHandler for the Adapter level. May not be null, but need not
be configured at
this level.
param - the MessageErrorHandler to usepublic ProcessingExceptionHandler getMessageErrorHandler()
Returns the configured MessageErrorHandler.
MessageErrorHandlerpublic void setStartUpEventImp(java.lang.String name)
Sets the name of the start up event class to use. May not be null.
name - the name of the start up event class to usepublic java.lang.String getStartUpEventImp()
Returns the name of the start up event class to use.
public void setHeartbeatEventImp(java.lang.String name)
Sets the class name of the heartbeat event imp to use.
name - the class name of the heartbeat event imp to usepublic java.lang.String getHeartbeatEventImp()
Returns the class name of the heartbeat event imp to use.
public void setFailedMessageRetrier(FailedMessageRetrier retrier)
Sets the FailedMessageRetrier to use. May not be null.
retrier - the FailedMessageRetrier to usepublic FailedMessageRetrier getFailedMessageRetrier()
Returns the FailedMessageRetrier to use.
FailedMessageRetrier to usepublic LogHandler logHandler()
public TimeInterval getHeartbeatEventInterval()
public void setHeartbeatEventInterval(TimeInterval interval)
interval - public void requestInit()
throws CoreException
StateManagedComponentRequest this component is init'd.
requestInit in interface StateManagedComponentCoreException - wrapping any underlying Exceptionspublic void requestStart()
throws CoreException
StateManagedComponentRequest this component is started.
requestStart in interface StateManagedComponentCoreException - wrapping any underlying Exceptionspublic void requestStop()
StateManagedComponentRequest this component is stopped.
requestStop in interface StateManagedComponentpublic void requestClose()
StateManagedComponentRequest this component is closed.
requestClose in interface StateManagedComponentpublic ComponentState retrieveComponentState()
StateManagedComponent
Returns the last recorde ComponentState.
retrieveComponentState in interface StateManagedComponentComponentStatepublic void changeState(ComponentState newState)
StateManagedComponent
Updates the state for the component ComponentState.
changeState in interface StateManagedComponentpublic void requestChildInit()
throws CoreException
StateManagedComponentContainerrequestChildInit in interface StateManagedComponentContainerCoreException - wrapping any underlying Exceptionspublic void requestChildStart()
throws CoreException
StateManagedComponentContainerrequestChildStart in interface StateManagedComponentContainerCoreException - wrapping any underlying Exceptionspublic void requestChildStop()
StateManagedComponentContainerrequestChildStop in interface StateManagedComponentContainerpublic void requestChildClose()
StateManagedComponentContainerrequestChildClose in interface StateManagedComponentContainerpublic SharedComponentList getSharedComponents()
public void setSharedComponents(SharedComponentList scl)
scl - the shared components.public MessageErrorDigester getMessageErrorDigester()
public void setMessageErrorDigester(MessageErrorDigester messageErrorDigest)
public java.util.Date lastStartTime()
public java.util.Date lastStopTime()
public LogHandler getLogHandler()
public void setLogHandler(LogHandler logHandler)