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 ActivityListeners.ActivityListenerList |
listenerList
AcitivityListener registered with 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 |
---|---|
protected abstract void |
checkSuspendableOperation()
Validates the use of a suspendable operation by this activity.
|
protected abstract boolean |
completedExecution()
Return true if the task completed execution, else return false if the task was suspended.
|
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(Throwable throwable)
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.
|
void |
notifyActivitySpawn(HabaneroActivity childActivity)
notifyActivitySpawn.
|
void |
notifyResumption()
notifyResumption.
|
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 |
shouldBypassExecution()
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 final ActivityListeners.ActivityListenerList listenerList
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 Runnable
Runnable.run()
protected abstract boolean completedExecution()
protected abstract void checkSuspendableOperation()
protected abstract boolean shouldBypassExecution()
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(Throwable throwable)
finalizeTerminationCleanup.
public final void pushException(Throwable throwable)
pushException.
throwable
- The exception that occurred while executing this activitypublic void notifyActivitySpawn(HabaneroActivity childActivity)
notifyActivitySpawn.
childActivity
- a HabaneroActivity
object.public void notifySuspension()
notifySuspension.
public 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() throws SuspendableException
SuspendableException
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 © 2015 Rice University - Department of Computer Science. All rights reserved.