@ComponentProfile(summary="Split a message and execute an arbitary number of services on the split message", tag="service,splitter", since="3.7.1") public class PoolingMessageSplitterService extends AdvancedMessageSplitterService
AdvancedMessageSplitterService
that uses a underlying thread and object pool to execute the service on each
split message.
Note that using this splitter may mean that messages become un-ordered; if the order of the split messages is critical, then you
probably shouldn't use this service. Additionally, individual split-message failures will only be reported on after all the split
messages have been processed, so unlike AdvancedMessageSplitterService
; MessageSplitterServiceImp.setIgnoreSplitMessageFailures(Boolean)
will not halt the processing of the subsequent split messages
In the adapter configuration file this class is aliased as pooling-message-splitter-service which is the preferred alternative to the fully qualified classname when building your configuration.
MessageSplitterServiceImp.AlreadyComplete
eventHandler
KEY_CURRENT_SPLIT_MESSAGE_COUNT, KEY_SPLIT_MESSAGE_COUNT
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
PoolingMessageSplitterService() |
Modifier and Type | Method and Description |
---|---|
protected void |
closeService() |
java.lang.Integer |
getMaxThreads() |
java.lang.Boolean |
getWarmStart() |
java.util.concurrent.Future<?> |
handleSplitMessage(AdaptrisMessage msg) |
protected void |
initService() |
void |
setMaxThreads(java.lang.Integer maxThreads) |
void |
setWarmStart(java.lang.Boolean b)
Specify if the underlying object pool should be warmed up on
start() . |
void |
start()
Starts the component.
|
protected void |
waitForCompletion(java.util.List<java.util.concurrent.Future> tasks) |
PoolingMessageSplitterService |
withWarmStart(java.lang.Boolean b) |
executeService, getSendEvents, getService, prepare, registerEventHandler, sendEvents, sendEvents, setSendEvents, setService, stop, wrappedServices
doService, getIgnoreSplitMessageFailures, getSplitter, ignoreSplitMessageFailures, setIgnoreSplitMessageFailures, setSplitter
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 java.util.concurrent.Future<?> handleSplitMessage(AdaptrisMessage msg) throws ServiceException
handleSplitMessage
in class AdvancedMessageSplitterService
ServiceException
MessageSplitterServiceImp.handleSplitMessage(com.adaptris.core.AdaptrisMessage)
protected void initService() throws CoreException
initService
in class AdvancedMessageSplitterService
CoreException
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 AdvancedMessageSplitterService
CoreException
- wrapping any underlying Exception
sComponentLifecycle.start()
protected void closeService()
closeService
in class AdvancedMessageSplitterService
protected void waitForCompletion(java.util.List<java.util.concurrent.Future> tasks) throws ServiceException
waitForCompletion
in class MessageSplitterServiceImp
ServiceException
public java.lang.Integer getMaxThreads()
public void setMaxThreads(java.lang.Integer maxThreads)
public java.lang.Boolean getWarmStart()
public void setWarmStart(java.lang.Boolean b)
start()
.b
- true or false (default false if not specified).public PoolingMessageSplitterService withWarmStart(java.lang.Boolean b)