@InterfaceAudience.Private public class ProcedureEvent<T> extends Object
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
private T |
object |
private boolean |
ready |
private ProcedureDeque |
suspendedProcedures |
Constructor and Description |
---|
ProcedureEvent(T object) |
Modifier and Type | Method and Description |
---|---|
ProcedureDeque |
getSuspendedProcedures()
Access to suspendedProcedures is 'synchronized' on this object, but it's fine to return it
here for tests.
|
boolean |
isReady() |
void |
suspend()
Mark the event as not ready.
|
boolean |
suspendIfNotReady(Procedure proc) |
String |
toString() |
void |
wake(AbstractProcedureScheduler procedureScheduler)
Wakes up the suspended procedures by pushing them back into scheduler queues and sets the
event as ready.
|
static void |
wakeEvents(AbstractProcedureScheduler scheduler,
ProcedureEvent... events)
Wakes up all the given events and puts the procedures waiting on them back into
ProcedureScheduler queues.
|
(package private) void |
wakeInternal(AbstractProcedureScheduler procedureScheduler)
Only to be used by ProcedureScheduler implementations.
|
private static final org.slf4j.Logger LOG
private boolean ready
private ProcedureDeque suspendedProcedures
public ProcedureEvent(T object)
public boolean isReady()
public boolean suspendIfNotReady(Procedure proc)
public void suspend()
public void wake(AbstractProcedureScheduler procedureScheduler)
wakeInternal(AbstractProcedureScheduler)
for why this is not synchronized.public static void wakeEvents(AbstractProcedureScheduler scheduler, ProcedureEvent... events)
void wakeInternal(AbstractProcedureScheduler procedureScheduler)
wake(AbstractProcedureScheduler)
above uses the same code path as used
when waking up multiple events.
Access should remain package-private.public ProcedureDeque getSuspendedProcedures()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.