@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()
Return the configured LogHandler.
|
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 lh)
Set the LogHandler implementation.
|
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
CoreException
public void prepare() throws CoreException
Ensures that the adapter is ready for initialisation.
prepare
in interface ComponentLifecycleExtension
CoreException
- wrapping any underlying Exceptionspublic void init() throws CoreException
Initialise the adapter including the EventHandler
. Implements method defined in AdaptrisMBean
, hence
public.
init
in interface ComponentLifecycle
CoreException
- wrapping any underlying Exception
sAdaptrisComponent
public 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 ComponentLifecycle
CoreException
- wrapping any underlying Exception
sComponentLifecycle.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 ComponentLifecycle
AdaptrisComponent
public 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 ComponentLifecycle
AdaptrisComponent
public void setChannelList(ChannelList param)
Sets the ChannelList
.
param
- the ChannelList
to use.public ChannelList getChannelList()
Returns the ChannelList
.
ChannelList
public 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 AdaptrisComponent
public void setEventHandler(EventHandler param)
Sets the EventHandler
.
param
- the EventHandler
to use.public EventHandler getEventHandler()
Returns the EventHandler
.
EventHandler
public 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
.
MessageErrorHandler
public 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 void setLogHandler(LogHandler lh)
lh
- the log handler implementation.public LogHandler getLogHandler()
public LogHandler logHandler()
public TimeInterval getHeartbeatEventInterval()
public void setHeartbeatEventInterval(TimeInterval interval)
interval
- public void requestInit() throws CoreException
StateManagedComponent
Request this component is init'd.
requestInit
in interface StateManagedComponent
CoreException
- wrapping any underlying Exceptionspublic void requestStart() throws CoreException
StateManagedComponent
Request this component is started.
requestStart
in interface StateManagedComponent
CoreException
- wrapping any underlying Exceptionspublic void requestStop()
StateManagedComponent
Request this component is stopped.
requestStop
in interface StateManagedComponent
public void requestClose()
StateManagedComponent
Request this component is closed.
requestClose
in interface StateManagedComponent
public ComponentState retrieveComponentState()
StateManagedComponent
Returns the last recorde ComponentState
.
retrieveComponentState
in interface StateManagedComponent
ComponentState
public void changeState(ComponentState newState)
StateManagedComponent
Updates the state for the component ComponentState
.
changeState
in interface StateManagedComponent
public void requestChildInit() throws CoreException
StateManagedComponentContainer
requestChildInit
in interface StateManagedComponentContainer
CoreException
- wrapping any underlying Exceptionspublic void requestChildStart() throws CoreException
StateManagedComponentContainer
requestChildStart
in interface StateManagedComponentContainer
CoreException
- wrapping any underlying Exceptionspublic void requestChildStop()
StateManagedComponentContainer
requestChildStop
in interface StateManagedComponentContainer
public void requestChildClose()
StateManagedComponentContainer
requestChildClose
in interface StateManagedComponentContainer
public 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()