Package com.adaptris.core
Class BranchingServiceCollection
- java.lang.Object
-
- java.util.AbstractCollection<Service>
-
- com.adaptris.core.ServiceCollectionImp
-
- com.adaptris.core.BranchingServiceCollection
-
- 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 the next service is determined dynamically", tag="service,base,branching") public class BranchingServiceCollection extends ServiceCollectionImpImplementation ofServiceCollectionwhich allowsbranchingservices to select the next service to apply.In the adapter configuration file this class is aliased as branching-service-collection 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 BranchingServiceCollection()BranchingServiceCollection(java.util.Collection<Service> list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyServices(AdaptrisMessage msg)Apply the required services to the message.protected voiddoClose()Close any additional components.protected voiddoInit()Start any additional components.protected voiddoStart()Start any additional components.protected voiddoStop()Stop any additional components.protected ServiceenforceRequirements(Service service)Enforce any requirements of the list.protected java.util.Collection<? extends Service>enforceRequirements(java.util.Collection<? extends Service> collection)Enforce any requirements of the list.java.lang.StringgetFirstServiceId()Returns the unique ID of the firstServiceto apply.voidsetFirstServiceId(java.lang.String s)Sets the unique ID of the firstServiceto apply.BranchingServiceCollectionwithFirstServiceId(java.lang.String s)-
Methods inherited from class com.adaptris.core.ServiceCollectionImp
add, add, addAll, addAll, addService, changeState, clear, close, continueOnFailure, createName, createQualifier, doService, 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
-
-
-
-
Constructor Detail
-
BranchingServiceCollection
public BranchingServiceCollection()
-
BranchingServiceCollection
public BranchingServiceCollection(java.util.Collection<Service> list)
-
-
Method Detail
-
enforceRequirements
protected Service enforceRequirements(Service service)
Description copied from class:ServiceCollectionImpEnforce any requirements of the list.- Overrides:
enforceRequirementsin classServiceCollectionImp- Parameters:
service- the service due to be added.- Returns:
- the service
-
enforceRequirements
protected java.util.Collection<? extends Service> enforceRequirements(java.util.Collection<? extends Service> collection)
Description copied from class:ServiceCollectionImpEnforce any requirements of the list.- Overrides:
enforceRequirementsin classServiceCollectionImp- Parameters:
collection- the services due to be added.- Returns:
- the collection
-
applyServices
protected void applyServices(AdaptrisMessage msg) throws ServiceException
Description copied from class:ServiceCollectionImpApply the required services to the message.- Specified by:
applyServicesin classServiceCollectionImp- Parameters:
msg- the message- Throws:
ServiceException- wrapping any underlying exception.
-
doClose
protected void doClose()
Description copied from class:ServiceCollectionImpClose any additional components.- Specified by:
doClosein classServiceCollectionImp
-
doInit
protected void doInit() throws CoreExceptionDescription copied from class:ServiceCollectionImpStart any additional components.- Specified by:
doInitin classServiceCollectionImp- Throws:
CoreException- wrapping any underlying exception
-
doStart
protected void doStart() throws CoreExceptionDescription copied from class:ServiceCollectionImpStart any additional components.- Specified by:
doStartin classServiceCollectionImp- Throws:
CoreException- wrapping any underlying exception
-
doStop
protected void doStop()
Description copied from class:ServiceCollectionImpStop any additional components.- Specified by:
doStopin classServiceCollectionImp
-
getFirstServiceId
public java.lang.String getFirstServiceId()
Returns the unique ID of the first
Serviceto apply.- Returns:
- the unique ID of the first
Serviceto apply
-
setFirstServiceId
public void setFirstServiceId(java.lang.String s)
Sets the unique ID of the first
Serviceto apply.- Parameters:
s- the unique ID of the firstServiceto apply
-
withFirstServiceId
public BranchingServiceCollection withFirstServiceId(java.lang.String s)
-
-