
public abstract class BlockingActivity extends Object implements Runnable
| Modifier and Type | Field and Description |
|---|---|
protected RuntimeException |
executionException
Exception that occurred while executing the activity
|
protected BlockingFinishState |
launchedFinishState
TODO The FinishState of this activity. !
|
protected BlockingFinishState |
rootFinishState
TODO The FinishState up in the invocation tree within which this activity is being executed.
|
| Modifier | Constructor and Description |
|---|---|
protected |
BlockingActivity(String activityName)
Constructor for BlockingActivity.
|
| Modifier and Type | Method and Description |
|---|---|
static BlockingActivity |
adapt(String activityName,
HjRunnable runnable)
adapt.
|
BlockingFinishState |
currentFinishState()
currentFinishState.
|
abstract void |
executeBody()
This method represents the body of the task.
|
BlockingActivity |
finalizeActivitySpawn(BlockingActivity childActivity)
finalizeActivitySpawn.
|
void |
finalizeTermination()
finalizeTermination.
|
void |
finalizeTermination(Throwable throwable)
finalizeTermination.
|
protected void |
finalizeTerminationCleanup()
finalizeTerminationCleanup.
|
protected void |
handleException(Throwable throwable) |
void |
join()
The method is marked as synchronized as it invokes the wait() method.
|
protected BlockingFinishState |
newFinishState()
A factory method for a finish state.
|
protected void |
notifyActivitySpawn(BlockingActivity childActivity)
notifyActivitySpawn.
|
protected void |
notifyResumption()
notifyResumption.
|
protected void |
notifySuspension()
notifySuspension.
|
void |
prepareToRunInFinish()
prepareToRunInFinish.
|
void |
pushException(Throwable throwable)
pushException.
|
void |
registerListener(ActivityListeners.ActivityListener activityListener)
registerListener.
|
void |
run()
This is the method (indirectly) executed when the task is run by the executor service.
|
void |
setRootActivityFinishState(BlockingFinishState root)
Used by a parent activity on its child activity to update the finish state
|
BlockingFinishState |
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.
|
protected BlockingFinishState rootFinishState
protected BlockingFinishState launchedFinishState
protected RuntimeException executionException
protected BlockingActivity(String activityName)
Constructor for BlockingActivity.
activityName - The name of the activitypublic static BlockingActivity adapt(String activityName, HjRunnable runnable)
adapt.
activityName - The name of the activity.runnable - the runnable action.public final BlockingFinishState currentFinishState()
currentFinishState.
public final void registerListener(ActivityListeners.ActivityListener activityListener)
registerListener.
activityListener - The listener to registerpublic abstract void executeBody()
public final void run()
This is the method (indirectly) executed when the task is run by the executor service.
run in interface RunnableRunnable.run()protected void handleException(Throwable throwable)
public final void prepareToRunInFinish()
prepareToRunInFinish.
public BlockingActivity finalizeActivitySpawn(BlockingActivity childActivity)
finalizeActivitySpawn.
childActivity - The child activity being spawnedBlockingActivity object.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(BlockingActivity childActivity)
notifyActivitySpawn.
childActivity - a BlockingActivity object.protected void notifySuspension()
notifySuspension.
protected void notifyResumption()
notifyResumption.
protected final BlockingFinishState newFinishState()
public final void setRootActivityFinishState(BlockingFinishState root)
root - The root finish state of the activitypublic final BlockingFinishState startFinish()
BlockingFinishState 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.