Class BasicMessageSplitterService
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,ConnectedService
,MessageEventGenerator
,Service
,StateManagedComponent
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.
-
Field Summary
Fields inherited from class com.adaptris.core.services.splitter.MessageSplitterServiceImp
KEY_CURRENT_SPLIT_MESSAGE_COUNT, KEY_SPLIT_MESSAGE_COUNT
Fields inherited from class com.adaptris.core.ServiceImp
log
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Returns theAdaptrisConnection
to use for producing split messages.Returns theAdaptrisMessageProducer
to use for producing split messages.protected void
handleSplitMessage
(AdaptrisMessage msg, Consumer<Exception> callback) protected void
void
prepare()
Prepare for initialisation.void
Sets theAdaptrisConnection
to use for producing split messages.void
Sets theAdaptrisMessageProducer
to use for producing split messages.void
start()
Starts the component.void
stop()
Stop the componentMethods inherited from class com.adaptris.core.services.splitter.MessageSplitterServiceImp
doService, getIgnoreSplitMessageFailures, getSplitter, ignoreSplitMessageFailures, setIgnoreSplitMessageFailures, setSplitter, waitForCompletion
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
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.AdaptrisComponent
getUniqueId
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createName, createQualifier, isTrackingEndpoint
Methods inherited from interface com.adaptris.core.Service
continueOnFailure, doService, isBranching, setUniqueId
Methods inherited from interface com.adaptris.core.StateManagedComponent
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
-
Constructor Details
-
BasicMessageSplitterService
public BasicMessageSplitterService()Creates a new instance. Defaults to copying all metadata from the original message to the new, split messages.
-
-
Method Details
-
handleSplitMessage
protected void handleSplitMessage(AdaptrisMessage msg, Consumer<Exception> callback) throws ServiceException - Specified by:
handleSplitMessage
in classMessageSplitterServiceImp
- Throws:
ServiceException
-
initService
- Overrides:
initService
in classMessageSplitterServiceImp
- Throws:
CoreException
-
closeService
protected void closeService()- Overrides:
closeService
in classMessageSplitterServiceImp
-
start
Description copied from interface:ComponentLifecycle
Starts the component.Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling start will begin message delivery.- Specified by:
start
in interfaceComponentLifecycle
- Overrides:
start
in classServiceImp
- Throws:
CoreException
- wrapping any underlyingException
s- See Also:
-
stop
public void stop()Description copied from interface:ComponentLifecycle
Stop the componentA stopped component is not expected to be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling stop will pause message delivery. Throwing aRuntimeException
may cause unintended consequences- Specified by:
stop
in interfaceComponentLifecycle
- Overrides:
stop
in classServiceImp
- See Also:
-
setConnection
Sets the
AdaptrisConnection
to use for producing split messages.- Specified by:
setConnection
in interfaceConnectedService
- Parameters:
conn
- theAdaptrisConnection
to use for producing split messages, may not be null
-
getConnection
Returns the
AdaptrisConnection
to use for producing split messages.- Specified by:
getConnection
in interfaceConnectedService
- Returns:
- the
AdaptrisConnection
to use for producing split messages
-
setProducer
Sets the
AdaptrisMessageProducer
to use for producing split messages.- Parameters:
prod
- theAdaptrisMessageProducer
to use for producing split messages, may not be null
-
getProducer
Returns the
AdaptrisMessageProducer
to use for producing split messages.- Returns:
- the
AdaptrisMessageProducer
to use for producing split messages
-
prepare
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Specified by:
prepare
in interfaceComponentLifecycleExtension
- Throws:
CoreException
-