@ComponentProfile(summary="Runs the configured service/list repeatedly \'WHILE\' the configured condition is met.",
tag="service, conditional")
public class While
extends ServiceImp
This Service allows you to test boolean (true or false) Condition's, which if evaluate to "true" will run a configured set of services continuously until the configured conditions do not evaluate to true.
You can also set a value for the maximum amount of times your services will run regardless of whether your conditions continue to evaluate to true.
The default value for the max-loops is 10. Setting this value to 0, will loop forever until your configured conditions evaluate to false.5
Typically your Condition will test for equality, in-line expressions or whether values exist or not. The values to test will generally come from the payload or message metadata.
Also note that some conditions can be nested, such that you can test that a value is equal to another AND / OR a value is equal/not to another value.
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
log |
CONFIRMATION_ID_KEY| Constructor and Description |
|---|
While() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeService() |
void |
doService(AdaptrisMessage msg) |
Condition |
getCondition() |
java.lang.Integer |
getMaxLoops() |
ThenService |
getThen() |
protected void |
initService() |
void |
prepare() |
void |
setCondition(Condition condition) |
void |
setMaxLoops(java.lang.Integer maxLoops) |
void |
setThen(ThenService ifTrueService) |
void |
start() |
void |
stop() |
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsConfirmation, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isConfirmation, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, rethrowServiceException, retrieveComponentState, setContinueOnFail, setIsConfirmation, setIsTrackingEndpoint, setLookupName, setUniqueIdpublic void doService(AdaptrisMessage msg) throws ServiceException
ServiceExceptionpublic void prepare()
throws CoreException
CoreExceptionprotected void initService()
throws CoreException
initService in class ServiceImpCoreExceptionprotected void closeService()
closeService in class ServiceImppublic void start()
throws CoreException
start in interface ComponentLifecyclestart in class ServiceImpCoreExceptionpublic void stop()
stop in interface ComponentLifecyclestop in class ServiceImppublic Condition getCondition()
public void setCondition(Condition condition)
public ThenService getThen()
public void setThen(ThenService ifTrueService)
public java.lang.Integer getMaxLoops()
public void setMaxLoops(java.lang.Integer maxLoops)