@ComponentProfile(summary="Split a message and produce each split message somewhere", tag="service,splitter") public class BasicMessageSplitterService extends MessageSplitterServiceImp implements ConnectedService
Splits incoming AdaptrisMessage
s into several AdaptrisMessage
s using an implementation of
MessageSplitter
.
This implementation simply uses the configured producer and connection to produce the split message.
In the adapter configuration file this class is aliased as basic-message-splitter-service which is the preferred alternative to the fully qualified classname when building your configuration.
MessageSplitterServiceImp.AlreadyComplete
KEY_CURRENT_SPLIT_MESSAGE_COUNT, KEY_SPLIT_MESSAGE_COUNT
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
BasicMessageSplitterService()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
closeService() |
AdaptrisConnection |
getConnection()
Returns the
AdaptrisConnection to use for producing split
messages. |
AdaptrisMessageProducer |
getProducer()
Returns the
AdaptrisMessageProducer to use for producing split
messages. |
protected java.util.concurrent.Future<?> |
handleSplitMessage(AdaptrisMessage msg) |
protected void |
initService() |
void |
prepare()
Prepare for initialisation.
|
void |
setConnection(AdaptrisConnection conn)
Sets the
AdaptrisConnection to use for producing split
messages. |
void |
setProducer(AdaptrisMessageProducer prod)
Sets the
AdaptrisMessageProducer to use for producing split
messages. |
void |
start()
Starts the component.
|
void |
stop()
Stop the component
|
doService, getIgnoreSplitMessageFailures, getSplitter, ignoreSplitMessageFailures, setIgnoreSplitMessageFailures, setSplitter, waitForCompletion
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setLookupName, setUniqueId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
continueOnFailure, doService, isBranching, setUniqueId
createName, createQualifier, isTrackingEndpoint
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
getUniqueId
close, init
getLookupName
public BasicMessageSplitterService()
Creates a new instance. Defaults to copying all metadata from the original message to the new, split messages.
protected java.util.concurrent.Future<?> handleSplitMessage(AdaptrisMessage msg) throws ServiceException
handleSplitMessage
in class MessageSplitterServiceImp
ServiceException
MessageSplitterServiceImp.handleSplitMessage(AdaptrisMessage)
protected void initService() throws CoreException
initService
in class MessageSplitterServiceImp
CoreException
protected void closeService()
closeService
in class MessageSplitterServiceImp
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
start
in class ServiceImp
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
stop
in class ServiceImp
ComponentLifecycle.stop()
public void setConnection(AdaptrisConnection conn)
Sets the AdaptrisConnection
to use for producing split
messages.
setConnection
in interface ConnectedService
conn
- the AdaptrisConnection
to use for producing split
messages, may not be nullpublic AdaptrisConnection getConnection()
Returns the AdaptrisConnection
to use for producing split
messages.
getConnection
in interface ConnectedService
AdaptrisConnection
to use for producing split
messagespublic void setProducer(AdaptrisMessageProducer prod)
Sets the AdaptrisMessageProducer
to use for producing split
messages.
prod
- the AdaptrisMessageProducer
to use for producing
split messages, may not be nullpublic AdaptrisMessageProducer getProducer()
Returns the AdaptrisMessageProducer
to use for producing split
messages.
AdaptrisMessageProducer
to use for producing split
messagespublic void prepare() throws CoreException
ComponentLifecycleExtension
prepare
in interface ComponentLifecycleExtension
CoreException