com.google.monitoring.runtime.instrumentation
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.
- Author:
- Jeremy Manson
sample
void sample(T newObj)
- When registered with
ConstructorInstrumenter
, will be called whenever a constructor for type T is invoked.
- Parameters:
newObj - the new Object 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.
Copyright © 2015. All Rights Reserved.