
public abstract class HabaneroActivity extends Object implements Runnable
| Modifier and Type | Field and Description |
|---|---|
protected RuntimeException |
executionException
Exception that occurred while executing the activity
|
protected FinishState |
launchedFinishState
TODO The FinishState of this activity. !
|
protected FinishState |
rootFinishState
TODO The FinishState up in the invocation tree within which this activity is being executed.
|
| Modifier | Constructor and Description |
|---|---|
protected |
HabaneroActivity(String activityName,
HjPlace hjPlace)
Constructor for HabaneroActivity.
|
| Modifier and Type | Method and Description |
|---|---|
FinishState |
currentFinishState()
Return the current FinishState being run by the activity.
|
protected abstract void |
executeTask() |
HabaneroActivity |
finalizeActivitySpawn(HabaneroActivity childActivity)
finalizeActivitySpawn.
|
void |
finalizeTermination()
finalizeTermination.
|
void |
finalizeTermination(Throwable throwable)
finalizeTermination.
|
protected void |
finalizeTerminationCleanup()
finalizeTerminationCleanup.
|
protected void |
handleException(Throwable throwable) |
long |
id()
Returns the id of the activity.
|
void |
join()
The method is marked as synchronized as it invokes the wait() method.
|
String |
name()
Returns the name of the activity.
|
protected FinishState |
newFinishState()
A factory method for a finish state.
|
protected void |
notifyActivitySpawn(HabaneroActivity childActivity)
notifyActivitySpawn.
|
protected void |
notifyResumption()
notifyResumption.
|
protected void |
notifySuspension()
notifySuspension.
|
HjPlace |
place()
Returns the place of the activity.
|
abstract void |
prepareToRunInFinish()
prepareToRunInFinish.
|
void |
pushException(Throwable throwable)
pushException.
|
void |
registerListener(ActivityListeners.ActivityListener activityListener)
registerListener.
|
protected FinishState |
retrieveTargetFinishState() |
void |
run()
This is the method (indirectly) executed when the task is run by the executor service.
|
void |
setRootActivityFinishState(FinishState root)
Used by a parent activity on its child activity to update the finish state
|
protected abstract boolean |
shouldBypass()
Returns true if the activity should be skipped as it has already been executed.
|
FinishState |
startFinish()
This method is invoked when a new finish scope is encountered.
|
void |
stopFinish()
This method is invoked when a finish scope is being exited.
|
String |
toString() |
protected FinishState rootFinishState
protected FinishState launchedFinishState
protected RuntimeException executionException
public long id()
public String name()
public HjPlace place()
public final FinishState currentFinishState()
public final void registerListener(ActivityListeners.ActivityListener activityListener)
registerListener.
activityListener - The listener to registerpublic final void run()
This is the method (indirectly) executed when the task is run by the executor service.
run in interface RunnableRunnable.run()protected abstract boolean shouldBypass()
public abstract void prepareToRunInFinish()
prepareToRunInFinish.
protected abstract void executeTask()
protected void handleException(Throwable throwable)
public HabaneroActivity finalizeActivitySpawn(HabaneroActivity childActivity)
finalizeActivitySpawn.
childActivity - The child activity being spawnedHabaneroActivity object.protected FinishState retrieveTargetFinishState()
public void finalizeTermination()
finalizeTermination.
public void finalizeTermination(Throwable throwable)
finalizeTermination.
throwable - The exception thrown while executing the body of the activity.protected void finalizeTerminationCleanup()
finalizeTerminationCleanup.
public final void pushException(Throwable throwable)
pushException.
throwable - The exception that occurred while executing this activityprotected void notifyActivitySpawn(HabaneroActivity childActivity)
notifyActivitySpawn.
childActivity - a HabaneroActivity object.protected void notifySuspension()
notifySuspension.
protected void notifyResumption()
notifyResumption.
protected final FinishState newFinishState()
public final void setRootActivityFinishState(FinishState root)
root - The root finish state of the activitypublic final FinishState startFinish()
FinishState object.public final void stopFinish()
public final void join()
throws InterruptedException
InterruptedException - if any thread interrupted the
current thread before or while the current thread
was waiting for a notification.Copyright © 2014 Rice University - Department of Computer Science. All rights reserved.