Class CloneMessageServiceList
- java.lang.Object
-
- java.util.AbstractCollection<Service>
-
- com.adaptris.core.ServiceCollectionImp
-
- com.adaptris.core.ServiceListBase
-
- com.adaptris.core.CloneMessageServiceList
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,ConfigComment
,EventHandlerAware
,MessageEventGenerator
,Service
,ServiceCollection
,StateManagedComponent
,java.lang.Iterable<Service>
,java.util.Collection<Service>
,java.util.List<Service>
@ComponentProfile(summary="A collection of services where each service gets a new copy of the message", tag="service,base") public class CloneMessageServiceList extends ServiceListBase
Implementation of ServiceCollection that creates a new clone of AdaptrisMessage for each configured service.The expected use case for this ServiceCollection is that you have a number of services that have to process exactly the same message (e.g. transforming XML to an HTML representation as well as CSV).
If you have a list of services that require the same clone to be used; then use a nested
ServiceList
to wrap all the required Service implementations that require it (e.g. Transforming to HTML and emailing the result of the transform)If there are services configured after this ServiceCollection implementation then they will process the message in its original form.
In the adapter configuration file this class is aliased as clone-message-service-list which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.ServiceCollectionImp
eventHandler, log
-
-
Constructor Summary
Constructors Constructor Description CloneMessageServiceList()
CloneMessageServiceList(Service... list)
CloneMessageServiceList(java.util.Collection<Service> list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyServices(AdaptrisMessage msg)
Apply the required services to the message.MetadataFilter
getOverrideMetadataFilter()
void
setOverrideMetadataFilter(MetadataFilter mf)
Specify theAdaptrisMessage
metadata keys that will be overridden in the original message.-
Methods inherited from class com.adaptris.core.ServiceListBase
doClose, doInit, doStart, doStop, haltProcessing
-
Methods inherited from class com.adaptris.core.ServiceCollectionImp
add, add, addAll, addAll, addService, changeState, clear, close, continueOnFailure, createName, createQualifier, doService, enforceRequirements, enforceRequirements, get, getComments, getContinueOnFail, getIsTrackingEndpoint, getOutOfStateHandler, getRestartAffectedServiceOnException, getServices, getUniqueId, handleException, indexOf, init, isBranching, isTrackingEndpoint, iterator, lastIndexOf, listIterator, listIterator, prepare, registerEventHandler, remove, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, set, setComments, setContinueOnFail, setIsTrackingEndpoint, setOutOfStateHandler, setRestartAffectedServiceOnException, setServices, setUniqueId, size, start, stop, subList, withServices
-
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
-
-
-
Method Detail
-
applyServices
protected void applyServices(AdaptrisMessage msg) throws ServiceException
Description copied from class:ServiceCollectionImp
Apply the required services to the message.- Specified by:
applyServices
in classServiceCollectionImp
- Parameters:
msg
- the message- Throws:
ServiceException
- wrapping any underlying exception.
-
getOverrideMetadataFilter
public MetadataFilter getOverrideMetadataFilter()
-
setOverrideMetadataFilter
public void setOverrideMetadataFilter(MetadataFilter mf)
Specify theAdaptrisMessage
metadata keys that will be overridden in the original message.- Parameters:
mf
- the filter defaults toRemoveAllMetadataFilter
if not specified (which will mean no metadata is preserved).- See Also:
MetadataFilter
-
-