public abstract class MessageSplitterServiceImp extends ServiceImp
Abstract base class for splitting messages based on some criteria.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
KEY_CURRENT_SPLIT_MESSAGE_COUNT |
static java.lang.String |
KEY_SPLIT_MESSAGE_COUNT |
log
Constructor and Description |
---|
MessageSplitterServiceImp() |
Modifier and Type | Method and Description |
---|---|
protected void |
closeService() |
void |
doService(AdaptrisMessage msg)
Apply the service to the message.
|
java.lang.Boolean |
getIgnoreSplitMessageFailures() |
MessageSplitter |
getSplitter()
Returns the
MessageSplitter to use. |
protected abstract void |
handleSplitMessage(AdaptrisMessage msg,
java.util.function.Consumer<java.lang.Exception> successOrFailure) |
boolean |
ignoreSplitMessageFailures() |
protected void |
initService() |
void |
setIgnoreSplitMessageFailures(java.lang.Boolean b)
Whether or not to ignore errors on messages that are split.
|
void |
setSplitter(MessageSplitter ms)
Sets the
MessageSplitter to use. |
protected void |
waitForCompletion(com.adaptris.core.services.splitter.MessageSplitterServiceImp.SplitterCallback tasks,
long expected) |
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
prepare
public static final java.lang.String KEY_SPLIT_MESSAGE_COUNT
public static final java.lang.String KEY_CURRENT_SPLIT_MESSAGE_COUNT
public final void doService(AdaptrisMessage msg) throws ServiceException
Service
Apply the service to the message.
msg
- the AdaptrisMessage
to processServiceException
- wrapping any underlying Exception
s#doService(com.adaptris.core.AdaptrisMessage)
protected abstract void handleSplitMessage(AdaptrisMessage msg, java.util.function.Consumer<java.lang.Exception> successOrFailure) throws ServiceException
ServiceException
protected void waitForCompletion(com.adaptris.core.services.splitter.MessageSplitterServiceImp.SplitterCallback tasks, long expected) throws ServiceException
ServiceException
protected void initService() throws CoreException
initService
in class ServiceImp
CoreException
protected void closeService()
closeService
in class ServiceImp
public void setSplitter(MessageSplitter ms)
Sets the MessageSplitter
to use.
ms
- the MessageSplitter
to use, may not be nullpublic MessageSplitter getSplitter()
Returns the MessageSplitter
to use.
MessageSplitter
to usepublic java.lang.Boolean getIgnoreSplitMessageFailures()
public boolean ignoreSplitMessageFailures()
public void setIgnoreSplitMessageFailures(java.lang.Boolean b)
b
- if true, then all split messages will be processed; failures are
simply logged (default false)