public class RepeatContextSupport extends SynchronizedAttributeAccessor implements RepeatContext
| Constructor and Description |
|---|
RepeatContextSupport(RepeatContext parent)
Constructor for
RepeatContextSupport. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Allow resources to be cleared, especially in destruction callbacks.
|
RepeatContext |
getParent()
If batches are nested, then the inner batch will be created with the
outer one as a parent.
|
int |
getStartedCount()
Public access to a counter for the number of operations attempted.
|
void |
increment()
Used by clients to increment the started count.
|
boolean |
isCompleteOnly()
Public accessor for the complete flag.
|
boolean |
isTerminateOnly()
Public accessor for the termination flag.
|
void |
registerDestructionCallback(java.lang.String name,
java.lang.Runnable callback)
Register a callback to be executed on close, associated with the
attribute having the given name.
|
void |
setCompleteOnly()
Signal to the framework that the current batch should complete normally,
independent of the current
CompletionPolicy. |
void |
setTerminateOnly()
Signal to the framework that the current batch should complete
abnormally, independent of the current
CompletionPolicy. |
attributeNames, equals, getAttribute, hasAttribute, hashCode, removeAttribute, setAttribute, setAttributeIfAbsent, toStringpublic RepeatContextSupport(RepeatContext parent)
RepeatContextSupport. The parent can be null, but
should be set to the enclosing repeat context if there is one, e.g. if
this context is an inner loop.parent - RepeatContext to be used as the parent context.public boolean isCompleteOnly()
RepeatContextisCompleteOnly in interface RepeatContextpublic void setCompleteOnly()
RepeatContextCompletionPolicy.setCompleteOnly in interface RepeatContextpublic boolean isTerminateOnly()
RepeatContextisTerminateOnly in interface RepeatContextpublic void setTerminateOnly()
RepeatContextCompletionPolicy.setTerminateOnly in interface RepeatContextpublic RepeatContext getParent()
RepeatContextgetParent in interface RepeatContextpublic void increment()
public int getStartedCount()
RepeatContextgetStartedCount in interface RepeatContextpublic void registerDestructionCallback(java.lang.String name,
java.lang.Runnable callback)
RepeatContextRunnable callback should not
throw any exceptions.registerDestructionCallback in interface RepeatContextname - the name of the attribute to associated this callback with.
If this attribute is removed the callback should never be called.callback - a Runnable to execute when the context is closed.public void close()
RepeatContextclose in interface RepeatContext