Package org.apache.wayang.core.util
Class OneTimeExecutable
- java.lang.Object
-
- org.apache.wayang.core.util.OneTimeExecutable
-
- Direct Known Subclasses:
Job
,LoopEnumerator
,LoopIsolator
,PushExecutorTemplate.StageExecution
,StageAssignmentTraversal
public abstract class OneTimeExecutable extends java.lang.Object
Method wrapper that ensures that it is called only once.
-
-
Constructor Summary
Constructors Constructor Description OneTimeExecutable()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
doExecute()
Performs the actual work of this instance.protected void
execute()
InvokedoExecute()
.protected boolean
tryExecute()
InvokedoExecute()
unless it has been executed already.
-
-
-
Method Detail
-
tryExecute
protected boolean tryExecute()
InvokedoExecute()
unless it has been executed already. Also, ensure that it will not be invoked a second time.- Returns:
- whether the method invocation resulted in invoking
doExecute()
-
execute
protected void execute() throws java.lang.IllegalStateException
InvokedoExecute()
. Also, ensure that it will not be invoked a second time.- Throws:
java.lang.IllegalStateException
- ifdoExecute()
has been already invoked
-
doExecute
protected abstract void doExecute()
Performs the actual work of this instance. Should only be invoked viaexecute()
andtryExecute()
.
-
-