Interface ConstructorCallback<T>
-
- Type Parameters:
T
- The class that will be sampled with this ConstructorCallback
public interface ConstructorCallback<T>
This interface describes a function that is used to sample a constructor. It is intended to be invoked every time a constructor for class T is invoked. This will not be invoked when subclasses of T are instantiated. This mechanism works independently of whether the class is part of the JDK core library.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
sample(T newObj)
When an object implementing interfaceConstructorCallback
is passed toConstructorInstrumenter.instrumentClass(Class, ConstructorCallback)
, it will get executed whenever a constructor for type T is invoked.
-
-
-
Method Detail
-
sample
void sample(T newObj)
When an object implementing interfaceConstructorCallback
is passed toConstructorInstrumenter.instrumentClass(Class, ConstructorCallback)
, it will get executed whenever a constructor for type T is invoked.- Parameters:
newObj
- the newObject
whose construction we're recording. The object is not fully constructed; any references to this object that are stored in this callback are subject to the memory model constraints related to such objects.
-
-