Package rife.continuations.instrument
Class ContinuationsBytecodeTransformer
java.lang.Object
rife.continuations.instrument.ContinuationsBytecodeTransformer
Abstract class that transforms the bytecode of regular classes so that
they support continuations functionalities.
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]transformIntoResumableBytes(ContinuationConfigInstrument configInstrument, byte[] rawBytes, String classname) Perform the class transformation.static byte[]transformIntoResumableBytes(ContinuationConfigInstrument configInstrument, byte[] rawBytes, String classname, ClassLoader classLoader) Perform the class transformation using the provided class loader when computing stack map frames.
-
Constructor Details
-
ContinuationsBytecodeTransformer
public ContinuationsBytecodeTransformer()
-
-
Method Details
-
transformIntoResumableBytes
public static byte[] transformIntoResumableBytes(ContinuationConfigInstrument configInstrument, byte[] rawBytes, String classname) throws ClassNotFoundException Perform the class transformation.If the class doesn't implement the marker interface that is set up in the instrumentation config, the original bytes will be returned.
- Parameters:
configInstrument- the configuration for the instrumentationrawBytes- the raw bytes of the class to instrumentclassname- the name of the class to instrument- Returns:
- a byte array with the instrumented bytecode; or
the original raw byte array if the class didn't need to be instrumented
- Throws:
ClassNotFoundException- when an error occurs during the inspection or transformation- Since:
- 1.0
-
transformIntoResumableBytes
public static byte[] transformIntoResumableBytes(ContinuationConfigInstrument configInstrument, byte[] rawBytes, String classname, ClassLoader classLoader) throws ClassNotFoundException Perform the class transformation using the provided class loader when computing stack map frames.- Parameters:
configInstrument- the instrumentation configurationrawBytes- the original class bytesclassname- the class nameclassLoader- the loader that resolves application classes- Returns:
- the transformed bytes, or
nullwhen no transformation is needed - Throws:
ClassNotFoundException- when an error occurs- Since:
- 1.10
-