Interface ContinuationConfigInstrument

All Known Implementing Classes:
ContinuationInstrument, EngineContinuationConfigInstrument

public interface ContinuationConfigInstrument
This interface needs to be implemented to configure the bytecode instrumentation that enables the continuations functionalities.

IMPORTANT: Do not load any classes here, only return string literals.

Since:
1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    The name of the method that will trigger the answer to a call continuation, for instance "answer".
    default String
    The ASM method descriptor of the call method, this includes the arguments and the return types.
    default String
    The name of the method that will trigger a call continuation, for instance "call".
    default String
    The ASM return type name of the call method, for instance "java/lang/Object".
    The name of the interface that will indicate that a class should be instrumented for continuations functionalities, for instance ContinuableObject.class.getName().
    default String
    The class name of the support class that contains dummy implementations of the continuation methods that are configured below, for instance ContinuableSupport.class.getName().
    The ASM method descriptor of the entry method, this includes the arguments and the return types.
    The name of the entry method that will be invoked when a new instance of a continuable class is created and its execution is started, for instance "execute".
    default String
    The name of the method that will trigger a pause continuation, for instance "pause".
    default String
    The name of the method that will trigger a step-back continuation, for instance "stepBack".
  • Method Details

    • getContinuableMarkerInterfaceName

      String getContinuableMarkerInterfaceName()
      The name of the interface that will indicate that a class should be instrumented for continuations functionalities, for instance ContinuableObject.class.getName().
      Returns:
      the name of the marker interface
      Since:
      1.0
    • getContinuableSupportClassName

      default String getContinuableSupportClassName()
      The class name of the support class that contains dummy implementations of the continuation methods that are configured below, for instance ContinuableSupport.class.getName().

      If you implement these methods in your continuable classes or extend these classes from a common base class with those methods that are then called locally, this configuration can return null since it will not be used. A class name only needs to be provided if your continuable classes only implement the marker interface, and you call the continuation methods on an instance of this support inside your continuations logic.

      Returns:
      the name of the continuable support class; or

      null if such a support class isn't used

      Since:
      1.0
    • getEntryMethodName

      String getEntryMethodName()
      The name of the entry method that will be invoked when a new instance of a continuable class is created and its execution is started, for instance "execute".
      Returns:
      the name of the entry method
      Since:
      1.0
    • getEntryMethodDescriptor

      String getEntryMethodDescriptor()
      The ASM method descriptor of the entry method, this includes the arguments and the return types. If there's no arguments nor return types, this is "()V".
      Returns:
      the ASM method descriptor for the entry method
      Since:
      1.2
    • getPauseMethodName

      default String getPauseMethodName()
      The name of the method that will trigger a pause continuation, for instance "pause".

      This method should have a void return type and take no arguments.

      Returns:
      the name of the pause method or null if you don't use pause continuations
      Since:
      1.0
    • getStepBackMethodName

      default String getStepBackMethodName()
      The name of the method that will trigger a step-back continuation, for instance "stepBack".

      This method should have a void return type and take no arguments.

      Returns:
      the name of the step-back method; or null if you don't use step-back continuations
      Since:
      1.0
    • getCallMethodName

      default String getCallMethodName()
      The name of the method that will trigger a call continuation, for instance "call".
      Returns:
      the name of the call method; or null if you don't use call/answer continuations
      Since:
      1.0
    • getCallMethodReturnTypeName

      default String getCallMethodReturnTypeName()
      The ASM return type name of the call method, for instance "java/lang/Object".

      This needs to be an object, not a primitive, and you have to be certain that it's compatible with the values that are sent through the answer to the call continuation. It's just recommended to keep this as generic as possible (hence "java/lang/Object").

      Returns:
      the ASM return type name of the call method
      Since:
      1.2
    • getCallMethodDescriptor

      default String getCallMethodDescriptor()
      The ASM method descriptor of the call method, this includes the arguments and the return types. For instance ""(Ljava/lang/Object;)Ljava/lang/Object;""

      This includes the return type name that's also provided by getCallMethodReturnTypeName().

      The array argument types that the call method takes, needs to be a single object argument, not more or less than one, and not a primitive. You will use this yourself in the implementation of the runner that executes the continuations. If the BasicContinuableRunner is used, CallTargetRetriever will be used to resolve the target of the call continuation by using the what's provided as the argument of the method call.

      Returns:
      the ASM method descriptor of the call method
      Since:
      1.2
    • getAnswerMethodName

      default String getAnswerMethodName()
      The name of the method that will trigger the answer to a call continuation, for instance "answer".

      This method should have a void return type and take one argument with the type java.lang.Object.

      Returns:
      the name of the answer method; or null if you don't use call/answer continuations
      Since:
      1.0