Package com.offbynull.coroutines.user
Class Continuation
java.lang.Object
com.offbynull.coroutines.user.Continuation
- All Implemented Interfaces:
Serializable
This class is used to store and restore the execution state. Any method that takes in this type as a parameter will be instrumented to
have its state saved/restored.
Calls to suspend() will suspend/yield the execution of the coroutine. Calls to setContext(java.lang.Object) /
getContext() can be used to pass data back and forth between the coroutine and its caller. All other methods are for
internal use by the instrumentation logic and should not be used directly..
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Objectprivate MethodStateprivate MethodStateprivate intstatic final intDo not use -- for internal use only.static final intDo not use -- for internal use only.static final intDo not use -- for internal use only.private MethodStateprivate MethodStateprivate static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDo not use -- for internal use only.Get the context.intgetMode()Do not use -- for internal use only.getSaved(int idx) Do not use -- for internal use only.intgetSize()Do not use -- for internal use only.Do not use -- for internal use only.voidpushNewMethodState(MethodState methodState) Do not use -- for internal use only.voidreset()Do not use -- for internal use only.voidsetContext(Object context) Set the context.voidsetMode(int mode) Do not use -- for internal use only.voidDo not use -- for internal use only.voidsuspend()Call to suspend/yield execution.voidDo not use -- for internal use only.voidunloadMethodStateToBefore(MethodState methodState) Do not use -- for internal use only.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
MODE_NORMAL
public static final int MODE_NORMALDo not use -- for internal use only.- See Also:
-
MODE_SAVING
public static final int MODE_SAVINGDo not use -- for internal use only.- See Also:
-
MODE_LOADING
public static final int MODE_LOADINGDo not use -- for internal use only.- See Also:
-
firstPointer
-
nextLoadPointer
-
nextUnloadPointer
-
firstCutpointPointer
-
mode
private int mode -
context
-
-
Constructor Details
-
Continuation
Continuation()
-
-
Method Details
-
getMode
public int getMode()Do not use -- for internal use only.- Returns:
- n/a
-
setMode
public void setMode(int mode) Do not use -- for internal use only.- Parameters:
mode- n/a
-
loadNextMethodState
Do not use -- for internal use only.- Returns:
- n/a
-
unloadCurrentMethodState
public void unloadCurrentMethodState()Do not use -- for internal use only. -
unloadMethodStateToBefore
Do not use -- for internal use only.- Parameters:
methodState- n/a
-
pushNewMethodState
Do not use -- for internal use only.- Parameters:
methodState- n/a
-
reset
public void reset()Do not use -- for internal use only. -
successExecutionCycle
public void successExecutionCycle()Do not use -- for internal use only. -
failedExecutionCycle
public void failedExecutionCycle()Do not use -- for internal use only. -
suspend
public void suspend()Call to suspend/yield execution.- Throws:
UnsupportedOperationException- if the caller has not been instrumented
-
getContext
Get the context.- Returns:
- context
-
setContext
Set the context.- Parameters:
context- context
-
getSaved
Do not use -- for internal use only. For testing.- Parameters:
idx- n/a- Returns:
- n/a
-
getSize
public int getSize()Do not use -- for internal use only. For testing.- Returns:
- n/a
-