
public final class PhaserManagerImpl extends Object implements PhaserManager
PhaserManagerImpl class.
| Modifier and Type | Class and Description |
|---|---|
static class |
PhaserManagerImpl.PhaserEventType |
| Constructor and Description |
|---|
PhaserManagerImpl(PropertyChangeListener changeListener)
No-args constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkPhaserUse(InternalPhaser ph,
HjPhaserMode prm)
Validates the use of a phaser in the current context.
|
protected void |
deregisterPhasers(HabaneroActivity activity)
deregisterPhasers.
|
void |
doNext(HabaneroActivity activity)
Performs a next operation with the given activity.
|
protected int |
doNextSinglePhase1(HabaneroActivity activity,
String loc)
doNextSinglePhase1.
|
protected void |
doNextSinglePhase2(HabaneroActivity activity)
doNextSinglePhase2.
|
void |
doSignal(HabaneroActivity activity,
boolean earlySignal)
Performs a phaser signal operation with the given activity.
|
void |
doSignal(HabaneroActivity activity,
InternalPhaser phaser,
boolean earlySignal,
boolean fromDrop)
Performs a signal operation with the given activity.
|
void |
doWait(HabaneroActivity activity)
Performs a phaser wait operation with the given activity.
|
void |
doWait(HabaneroActivity activity,
InternalPhaser phaser)
Performs a wait operation with the given activity.
|
boolean |
doWaitForNextSinglePhase1(HabaneroActivity activity,
InternalPhaser phaser,
String loc)
Performs the first stage wait operation with the given activity in next-with-signal mode.
|
void |
doWaitForNextSinglePhase2(HabaneroActivity activity,
InternalPhaser phaser)
Performs the second stage wait operation with the given activity in next-with-signal mode.
|
boolean |
dropPhaser(HabaneroActivity activity,
InternalPhaser phaser,
boolean activityEndSignal)
Drops the phaser registered with an activity.
|
int |
getSigPhase(HabaneroActivity activity,
InternalPhaser phaser)
getSigPhase.
|
int |
getWaitPhase(HabaneroActivity activity,
InternalPhaser phaser)
getWaitPhase.
|
void |
inheritPhasers(HabaneroActivity parentActivity,
HabaneroActivity childActivity)
Registers a phaser to the specified activity.
|
<T> void |
onActivityDependenciesReady(HabaneroActivity activity,
List<HjFuture<T>> dependencies)
Callback for the event when all the activities dependencies are ready.
|
void |
onActivityEnd(HabaneroActivity activity,
FinishState finishState,
Throwable throwable)
Callback for when the event ends execution.
|
void |
onActivityResume(HabaneroActivity activity)
Callback for when the event execution is resumed.
|
void |
onActivitySpawn(HabaneroActivity parentActivity,
HabaneroActivity childActivity)
Callback for when the event ends execution.
|
void |
onActivityStart(HabaneroActivity activity)
Callback for when the event starts execution.
|
void |
onActivitySuspend(HabaneroActivity activity)
Callback for when the event execution is suspended.
|
void |
onFinishScopeStart(HabaneroActivity activity,
FinishState finishState) |
void |
onPhaserReady(HabaneroActivity activity,
List<HjPhaserPair> phaserPairList)
Callback for the event when phasers are created
|
void |
onPostFinishScopeEnd(HabaneroActivity activity,
FinishState finishState) |
void |
onPreFinishScopeEnd(HabaneroActivity activity,
FinishState finishState) |
HjPhaserMode |
phaserMode(HabaneroActivity activity,
InternalPhaser phaser)
phaserMode.
|
void |
register(HabaneroActivity parentActivity,
HabaneroActivity childActivity,
InternalPhaser phaser,
HjPhaserMode phaserMode)
register.
|
boolean |
registered(HabaneroActivity activity,
InternalPhaser phaser)
registered.
|
void |
registerPhaserToIEF(HabaneroActivity activity,
InternalPhaser phaser)
Registers a phaser to the immediately enclosing finish defined by the activity.
|
protected void |
resume(HabaneroActivity activity,
InternalPhaser phaser,
boolean newValue)
resume.
|
boolean |
resumed(HabaneroActivity activity,
InternalPhaser phaser)
resumed.
|
protected static void |
throwPhaserException(String message)
Drops all phasers registered with the current finish state. throws
PhaserException
with the specified message |
String |
toString() |
void |
updateActivityFromCompanion(HabaneroActivity activity,
CompanionMetrics companionMetrics) |
void |
updateCompanionFromActivity(HabaneroActivity activity,
CompanionMetrics companionMetrics) |
public PhaserManagerImpl(PropertyChangeListener changeListener)
changeListener - a PropertyChangeListener object.public void checkPhaserUse(InternalPhaser ph, HjPhaserMode prm)
PhaserManagercheckPhaserUse in interface PhaserManagerph - The phaserprm - The phaser modeprotected static void throwPhaserException(String message)
PhaserException
with the specified messagemessage - The Exception messagePhaserException - with the specified messagepublic void inheritPhasers(HabaneroActivity parentActivity, HabaneroActivity childActivity)
inheritPhasers in interface PhaserManagerparentActivity - The activity to inherit phasers from.childActivity - The new child activity.public void register(HabaneroActivity parentActivity, HabaneroActivity childActivity, InternalPhaser phaser, HjPhaserMode phaserMode)
register.
register in interface PhaserManagerparentActivity - The activity to inherit phasers from.childActivity - The new child activity.phaser - The new phaser to inheritphaserMode - The phaser registration modepublic void registerPhaserToIEF(HabaneroActivity activity, InternalPhaser phaser)
registerPhaserToIEF in interface PhaserManageractivity - The activity which determines the IEF.phaser - The phaser to register to the IEF.public boolean dropPhaser(HabaneroActivity activity, InternalPhaser phaser, boolean activityEndSignal)
dropPhaser in interface PhaserManageractivity - The activity from which to drop the phaser.phaser - The phaser to drop.activityEndSignal - Whether the phaser is dropped in an activity end eventpublic boolean registered(HabaneroActivity activity, InternalPhaser phaser)
registered.
registered in interface PhaserManageractivity - The activity.phaser - The phaser.public boolean resumed(HabaneroActivity activity, InternalPhaser phaser)
resumed.
resumed in interface PhaserManageractivity - The activity.phaser - The phaser.public HjPhaserMode phaserMode(HabaneroActivity activity, InternalPhaser phaser)
phaserMode.
phaserMode in interface PhaserManageractivity - The activity.phaser - The phaser.public int getSigPhase(HabaneroActivity activity, InternalPhaser phaser)
getSigPhase.
getSigPhase in interface PhaserManageractivity - The activity.phaser - The phaser.public int getWaitPhase(HabaneroActivity activity, InternalPhaser phaser)
getWaitPhase.
getWaitPhase in interface PhaserManageractivity - The activity.phaser - The phaser.public void doNext(HabaneroActivity activity) throws SuspendableException
doNext in interface PhaserManageractivity - The activity.SuspendableExceptionpublic void doSignal(HabaneroActivity activity, boolean earlySignal)
doSignal in interface PhaserManageractivity - The activity.earlySignal - Flag determining whether this is an eager signalpublic void doSignal(HabaneroActivity activity, InternalPhaser phaser, boolean earlySignal, boolean fromDrop)
doSignal in interface PhaserManageractivity - The activity.phaser - The phaser.earlySignal - Flag determining whether this is an eager signalfromDrop - Flag determining whether this signal came from a drop call (to prevent double signal logging)public void doWait(HabaneroActivity activity) throws SuspendableException
doWait in interface PhaserManageractivity - The activity.SuspendableExceptionpublic void doWait(HabaneroActivity activity, InternalPhaser phaser) throws SuspendableException
doWait in interface PhaserManageractivity - The activity.phaser - The phaser.SuspendableExceptionpublic boolean doWaitForNextSinglePhase1(HabaneroActivity activity, InternalPhaser phaser, String loc) throws SuspendableException
doWaitForNextSinglePhase1 in interface PhaserManageractivity - The activity.phaser - The phaser.loc - The location of the next operationSuspendableExceptionpublic void doWaitForNextSinglePhase2(HabaneroActivity activity, InternalPhaser phaser) throws SuspendableException
doWaitForNextSinglePhase2 in interface PhaserManageractivity - The activity.phaser - The phaser.SuspendableExceptionpublic void onActivityStart(HabaneroActivity activity)
onActivityStart in interface ActivityListeners.ActivityListeneractivity - The activity being started.public void onActivitySuspend(HabaneroActivity activity)
onActivitySuspend in interface ActivityListeners.ActivityListeneractivity - The activity being suspended.public void onActivityResume(HabaneroActivity activity)
onActivityResume in interface ActivityListeners.ActivityListeneractivity - The activity being resumed.public void onActivityEnd(HabaneroActivity activity, FinishState finishState, Throwable throwable)
onActivityEnd in interface ActivityListeners.ActivityListeneractivity - The activity that is ending.finishState - The root finish state associated with the activitypublic <T> void onActivityDependenciesReady(HabaneroActivity activity, List<HjFuture<T>> dependencies)
onActivityDependenciesReady in interface ActivityListeners.ActivityListeneractivity - The activity that is ready to execute.dependencies - The dependencies of the activitypublic void onPhaserReady(HabaneroActivity activity, List<HjPhaserPair> phaserPairList)
ActivityListeners.ActivityListeneronPhaserReady in interface ActivityListeners.ActivityListeneractivity - The activity that is ready to execute.phaserPairList - The a list of phasers of HjPhaserPair typepublic void onActivitySpawn(HabaneroActivity parentActivity, HabaneroActivity childActivity)
onActivitySpawn in interface ActivityListeners.ActivityListenerparentActivity - The parent activity.childActivity - The child activity that was spawned.public void onFinishScopeStart(HabaneroActivity activity, FinishState finishState)
onFinishScopeStart in interface ActivityListeners.ActivityListeneractivity - The activity running the finish scopefinishState - The finish state associated with the activitypublic void onPreFinishScopeEnd(HabaneroActivity activity, FinishState finishState)
onPreFinishScopeEnd in interface ActivityListeners.ActivityListeneractivity - The activity that ran the finish scopefinishState - The finish state associated with the activitypublic void onPostFinishScopeEnd(HabaneroActivity activity, FinishState finishState)
onPostFinishScopeEnd in interface ActivityListeners.ActivityListeneractivity - The activity that ran the finish scopefinishState - The finish state associated with the activitypublic void updateCompanionFromActivity(HabaneroActivity activity, CompanionMetrics companionMetrics)
updateCompanionFromActivity in interface ActivityListeners.ActivityListenerpublic void updateActivityFromCompanion(HabaneroActivity activity, CompanionMetrics companionMetrics)
updateActivityFromCompanion in interface ActivityListeners.ActivityListenerprotected void deregisterPhasers(HabaneroActivity activity)
deregisterPhasers.
activity - a HabaneroActivity object.protected void resume(HabaneroActivity activity, InternalPhaser phaser, boolean newValue)
resume.
activity - a HabaneroActivity object.phaser - a InternalPhaser object.newValue - a boolean.protected int doNextSinglePhase1(HabaneroActivity activity, String loc) throws SuspendableException
doNextSinglePhase1.
activity - a HabaneroActivity object.loc - a String object.SuspendableExceptionprotected void doNextSinglePhase2(HabaneroActivity activity) throws SuspendableException
doNextSinglePhase2.
activity - a HabaneroActivity object.SuspendableExceptionCopyright © 2015 Rice University - Department of Computer Science. All rights reserved.