public static class Once.RunOnce extends Object
CheckedRunnable
only once.
Once the runOnce()
method has been successfully executed, subsequent invocations to
such method will have no effect. Notice that the key word here is successfully
. If the method fails,
each invocation to runOnce()
WILL run the delegate until it completes successfully.
Instances are thread safe, which means that if two threads are competing for the first successful invocation, only one will prevail and the other one will get a no-op execution.
Modifier and Type | Method and Description |
---|---|
void |
runOnce()
Runs (or not) the delegate according to the behaviour described on the class javadoc
|
Copyright © 2018. All rights reserved.