Class MessageSplitterServiceImp
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.services.splitter.MessageSplitterServiceImp
-
- All Implemented Interfaces:
AdaptrisComponent,ComponentLifecycle,ComponentLifecycleExtension,MessageEventGenerator,Service,StateManagedComponent
- Direct Known Subclasses:
AdvancedMessageSplitterService,BasicMessageSplitterService
public abstract class MessageSplitterServiceImp extends ServiceImp
Abstract base class for splitting messages based on some criteria.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringKEY_CURRENT_SPLIT_MESSAGE_COUNTstatic java.lang.StringKEY_SPLIT_MESSAGE_COUNT-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description MessageSplitterServiceImp()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcloseService()voiddoService(AdaptrisMessage msg)Apply the service to the message.java.lang.BooleangetIgnoreSplitMessageFailures()MessageSplittergetSplitter()Returns theMessageSplitterto use.protected abstract voidhandleSplitMessage(AdaptrisMessage msg, java.util.function.Consumer<java.lang.Exception> successOrFailure)booleanignoreSplitMessageFailures()protected voidinitService()voidsetIgnoreSplitMessageFailures(java.lang.Boolean b)Whether or not to ignore errors on messages that are split.voidsetSplitter(MessageSplitter ms)Sets theMessageSplitterto use.protected voidwaitForCompletion(com.adaptris.core.services.splitter.MessageSplitterServiceImp.SplitterCallback tasks, long expected)-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, 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 Detail
-
KEY_SPLIT_MESSAGE_COUNT
public static final java.lang.String KEY_SPLIT_MESSAGE_COUNT
- See Also:
- Constant Field Values
-
KEY_CURRENT_SPLIT_MESSAGE_COUNT
public static final java.lang.String KEY_CURRENT_SPLIT_MESSAGE_COUNT
- See Also:
- Constant Field Values
-
-
Method Detail
-
doService
public final void doService(AdaptrisMessage msg) throws ServiceException
Description copied from interface:ServiceApply the service to the message.
- Parameters:
msg- theAdaptrisMessageto process- Throws:
ServiceException- wrapping any underlyingExceptions- See Also:
#doService(com.adaptris.core.AdaptrisMessage)
-
handleSplitMessage
protected abstract void handleSplitMessage(AdaptrisMessage msg, java.util.function.Consumer<java.lang.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
protected void initService() throws CoreException- Specified by:
initServicein classServiceImp- Throws:
CoreException
-
closeService
protected void closeService()
- Specified by:
closeServicein classServiceImp
-
setSplitter
public void setSplitter(MessageSplitter ms)
Sets the
MessageSplitterto use.- Parameters:
ms- theMessageSplitterto use, may not be null
-
getSplitter
public MessageSplitter getSplitter()
Returns the
MessageSplitterto use.- Returns:
- the
MessageSplitterto use
-
getIgnoreSplitMessageFailures
public java.lang.Boolean getIgnoreSplitMessageFailures()
- Returns:
- the ignoreSplitMessageFailures
-
ignoreSplitMessageFailures
public boolean ignoreSplitMessageFailures()
-
setIgnoreSplitMessageFailures
public void setIgnoreSplitMessageFailures(java.lang.Boolean b)
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)
-
-