public class EventhandlingBarrier extends Object
Lock on which the event handlers changing the
framework state (e.g. registered models or self tests)
may synchronize to prevent undefined state due to concurrent modifications.begin() must always be followed by end(), i.e. end() should
be included in a finally block like so:
EventHandling.begin();
try {
// do something
} finally {
EventHandling.end();
}
public static void begin()
IllegalStateException. Rationale: Waiting indefinitely for a lock is bad practice,
since it enables deadlocks.public static boolean tryBegin()
false if this
does not succeed. This method can be used if the
execution of the synchronous code is optional and may otherwise
result in a deadlock.public static void end()
begin()Copyright © 2014–2015. All rights reserved.