Interface RecorderContext

All Known Implementing Classes:
BytecodeRecorderImpl

public interface RecorderContext
An injectable utility class that contains methods that can be needed for dealing with recorders.
  • Method Details

    • registerNonDefaultConstructor

      <T> void registerNonDefaultConstructor(Constructor<T> constructor, Function<T,List<Object>> parameters)
      Registers a way to construct an object via a non-default constructor. Each object may only have at most one non-default constructor registered
      Type Parameters:
      T - The type of the object
      Parameters:
      constructor - The constructor
      parameters - A function that maps the object to a list of constructor parameters
    • registerSubstitution

      <F, T> void registerSubstitution(Class<F> from, Class<T> to, Class<? extends ObjectSubstitution<? super F,? super T>> substitution)
      Registers a substitution to allow objects that are not serializable to bytecode to be substituted for an object that is.
      Parameters:
      from - The class of the non-serializable object
      to - The class to serialize to
      substitution - The subclass of ObjectSubstitution that performs the substitution
    • registerObjectLoader

      void registerObjectLoader(ObjectLoader loader)
      Register an object loader.
      Parameters:
      loader - the object loader (must not be null)
    • classProxy

      @Deprecated(forRemoval=false) Class<?> classProxy(String name)
      Deprecated.
      This construct should not be needed in most use cases since directly loading deployment/application classes at processing time in build steps is safe. However, there are use cases where this method comes in handy, such as referring to classes that were generated in previous build steps using GeneratedClassBuildItem.
      Creates a Class instance that can be passed to a recording proxy as a substitute for a class that is not loadable at processing time. At runtime the actual class will be passed into the invoked method.
      Parameters:
      name - The fully-qualified class name
      Returns:
      A Class instance that can be passed to a recording proxy
    • newInstance

      <T> RuntimeValue<T> newInstance(String name)
      Creates a RuntimeValue object that represents an object created via the default constructor.

      This object can be passed into recorders, but must not be used directly at deployment time

      Type Parameters:
      T - The type of the class
      Parameters:
      name - The name of the class
      Returns:
      The class instance proxy