|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.uwyn.rife.continuations.ContinuationContext<T>
public class ContinuationContext<T extends ContinuableObject>
Contains all contextual data of one particular continuation.
It also provides some static retrieval methods to be able to access active continuations.
Active continuations are managed in a ContinuationManager so that
they can be easily retrieved.
ContinuationManager| Method Summary | |
|---|---|
void |
addRelatedId(String id)
[PRIVATE AND UNSUPPORTED] Associates the ID of another continuation to this continuation. |
static void |
clearActiveContext()
Clears the active currently continuation context for the executing thread. |
ContinuationContext |
clone()
[PRIVATE AND UNSUPPORTED] Creates a cloned instance of this continuation context, this clone is not a perfect copy but is intended to be a child continuation and all context data is setup for that. |
static ContinuationContext |
createOrResetContext(Object executingInstance)
[PRIVATE AND UNSUPPORTED] Creates a new continuation context or resets its expiration time. |
void |
deactivate()
Makes sure that this ContinuationContext is not the active
one. |
CallState |
getActiveCallState()
Retrieves the call state that is active during this continuation. |
static ContinuationContext |
getActiveContext()
Retrieves the currently active continuation for the executing thread. |
static String |
getActiveContextId()
Retrieves the identifier of the currently active continuation for the current thread. |
Object |
getCallAnswer()
Retrieves the answer that the call continuation stored in this context. |
T |
getContinuable()
Returns the object instance in which this continuation was executing. |
CallState |
getCreatedCallState()
Retrieves this continuation's call continuation creation state. |
String |
getId()
Retrieves the continuation ID. |
int |
getLabel()
[PRIVATE AND UNSUPPORTED] Retrieves the number of the bytecode label where the continuation has to resume execution from. |
static ContinuationContext |
getLastContext()
Retrieves the last active continuation for the executing thread. |
ContinuationStack |
getLocalStack()
[PRIVATE AND UNSUPPORTED] Retrieves the local operand stack of this continuation. |
ContinuationStack |
getLocalVars()
[PRIVATE AND UNSUPPORTED] Retrieves the local variable stack of this continuation. |
ContinuationManager |
getManager()
Retrieves the manager of this ContinuationContext. |
ContinuationContext |
getParentContext()
Retrieves the parent ContinuationContext of this
ContinuationContext instance. |
String |
getParentContextId()
Retrieves the unique identifier of the parent continuation of this ContinuationContext instance. |
String |
getParentId()
Retrieves the ID of this continuation's parent. |
boolean |
isPaused()
Indicates whether this continuation is actually paused and can be resumed. |
void |
registerContext()
Registers this continuation in its manager, so that it can be retrieved later. |
void |
remove()
Removes this ContinuationContext instance from its ContinuationManager. |
void |
removeContextTree()
Removes the entire continuation tree that this ContinuationContext instance belongs to from its ContinuationManager. |
void |
setActiveCallState(CallState callState)
Sets the active call state for this continuation. |
static void |
setActiveContext(ContinuationContext context)
Replaces the active continuation context for the executing thread. |
void |
setCallAnswer(Object answer)
Set the answer to a call continuation. |
void |
setCreatedCallState(CallState createdCallState)
Sets the call continuation's state when a new call continuation is created. |
void |
setLabel(int label)
[PRIVATE AND UNSUPPORTED] Set the number of the bytecode label where the continuation has to resume execution from. |
void |
setParentId(String id)
[PRIVATE AND UNSUPPORTED] Set the ID of this continuation's parent. |
void |
setPaused(boolean paused)
[PRIVATE AND UNSUPPORTED] Sets whether the continuation if paused. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ContinuationContext createOrResetContext(Object executingInstance)
This method is used by the instrumented bytecode that provides continuations support, it's not intended for general use.
ContinuationContext, or the active one with
its expiration time being resetpublic static void clearActiveContext()
public static String getActiveContextId()
null if no continuation is currently active
getActiveContext()public static ContinuationContext getActiveContext()
null if no continuation is currently active
getActiveContextId()public static void setActiveContext(ContinuationContext context)
context - the new ContinuationContext that will be active; or
null if no continuation context should be activesetActiveContext(com.uwyn.rife.continuations.ContinuationContext)public static ContinuationContext getLastContext()
null if no continuation was active
public ContinuationManager getManager()
ContinuationContext.
public void registerContext()
public void deactivate()
ContinuationContext is not the active
one.
public void remove()
ContinuationContext instance from its ContinuationManager.
public void removeContextTree()
ContinuationContext instance belongs to from its ContinuationManager.
public String getParentContextId()
ContinuationContext instance.
null if this ContinuationContext has no
parent
getParentContext()public ContinuationContext getParentContext()
ContinuationContext of this
ContinuationContext instance.
ContinuationContext; or
null if this ContinuationContext has no
parent
getParentContextId()public Object getCallAnswer()
null if no answer was provided or the corresponding
continuation wasn't a call continuation
public void setPaused(boolean paused)
This method is used by the internals that provide continuations support, it's not intended for general use.
paused - true if the continuation is paused; or
false otherwise
isPaused()public boolean isPaused()
true if the continuation is paused; or
false otherwise
public void setLabel(int label)
This method is used by the instrumented bytecode that provides continuations support, it's not intended for general use.
label - the number of the resumed bytecode labelpublic int getLabel()
This method is used by the instrumented bytecode that provides continuations support, it's not intended for general use.
-1 if no label number has been set
public ContinuationStack getLocalVars()
This method is used by the instrumented bytecode that provides continuations support, it's not intended for general use.
public ContinuationStack getLocalStack()
This method is used by the instrumented bytecode that provides continuations support, it's not intended for general use.
public String getId()
Note that this ID is not necessarily present in the manager and that trying to retrieve a continuation afterwards from its ID is never guaranteed to give a result.
public String getParentId()
null if this continuation has no parent.
public void addRelatedId(String id)
This method is used by the instrumented bytecode that provides continuations support, it's not intended for general use.
id - the ID of another continuation that's related to this
continuationpublic void setParentId(String id)
This method is used by the instrumented bytecode that provides continuations support, it's not intended for general use.
id - the ID of this continuation's parentgetParentId()public T getContinuable()
public void setCreatedCallState(CallState createdCallState)
This state initiates a call continuation and should be set when a new call happens, after that it should never be changed.
createdCallState - this call continuation's creation stategetCreatedCallState()public CallState getCreatedCallState()
If this returns a non-null value, you can detect from it that this was a call continuation.
setCreatedCallState(CallState)public void setActiveCallState(CallState callState)
This mainly passes on the call state that was created during a call continuation. It allows quick retrieval of the active call state when an answer occurs.
callState - the active call statesetCreatedCallState(CallState)public CallState getActiveCallState()
CallState; or
null if no call state was active for this continuation
public void setCallAnswer(Object answer)
answer - the object that will be the call continuation's answer; or
null if there was no answer
public ContinuationContext clone()
throws CloneNotSupportedException
This method is used by the instrumented bytecode that provides continuations support, it's not intended for general use.
clone in class ObjectCloneNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||