Class MessageSplitterServiceImp
java.lang.Object
com.adaptris.core.ServiceImp
com.adaptris.core.services.splitter.MessageSplitterServiceImp
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,ConfigComment
,MessageEventGenerator
,Service
,StateManagedComponent
- Direct Known Subclasses:
AdvancedMessageSplitterService
,BasicMessageSplitterService
Abstract base class for splitting messages based on some criteria.
-
Field Summary
Fields inherited from class com.adaptris.core.ServiceImp
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
final void
doService
(AdaptrisMessage msg) Apply the service to the message.Returns theMessageSplitter
to use.protected abstract void
handleSplitMessage
(AdaptrisMessage msg, Consumer<Exception> successOrFailure) boolean
protected void
void
Whether or not to ignore errors on messages that are split.void
Sets theMessageSplitter
to use.protected void
waitForCompletion
(com.adaptris.core.services.splitter.MessageSplitterServiceImp.SplitterCallback tasks, long expected) Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getComments, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setComments, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.adaptris.core.ComponentLifecycleExtension
prepare
-
Field Details
-
KEY_SPLIT_MESSAGE_COUNT
- See Also:
-
KEY_CURRENT_SPLIT_MESSAGE_COUNT
- See Also:
-
-
Constructor Details
-
MessageSplitterServiceImp
public MessageSplitterServiceImp()
-
-
Method Details
-
doService
Description copied from interface:Service
Apply the service to the message.
- Parameters:
msg
- theAdaptrisMessage
to process- Throws:
ServiceException
- wrapping any underlyingException
s- See Also:
-
handleSplitMessage
protected abstract void handleSplitMessage(AdaptrisMessage msg, Consumer<Exception> successOrFailure) throws ServiceException - Throws:
ServiceException
-
waitForCompletion
protected void waitForCompletion(com.adaptris.core.services.splitter.MessageSplitterServiceImp.SplitterCallback tasks, long expected) throws ServiceException - Throws:
ServiceException
-
initService
- Specified by:
initService
in classServiceImp
- Throws:
CoreException
-
closeService
protected void closeService()- Specified by:
closeService
in classServiceImp
-
setSplitter
Sets the
MessageSplitter
to use.- Parameters:
ms
- theMessageSplitter
to use, may not be null
-
getSplitter
Returns the
MessageSplitter
to use.- Returns:
- the
MessageSplitter
to use
-
getIgnoreSplitMessageFailures
- Returns:
- the ignoreSplitMessageFailures
-
ignoreSplitMessageFailures
public boolean ignoreSplitMessageFailures() -
setIgnoreSplitMessageFailures
Whether or not to ignore errors on messages that are split.- Parameters:
b
- if true, then all split messages will be processed; failures are simply logged (default false)
-