Package io.confluent.telemetry.exporter
Class ReferenceTrackingProxy<R,T extends Closeable>
java.lang.Object
io.confluent.telemetry.exporter.ReferenceTrackingProxy<R,T>
- All Implemented Interfaces:
InvocationHandler
public class ReferenceTrackingProxy<R,T extends Closeable>
extends Object
implements InvocationHandler
A proxy class that wraps a closeable resource and keeps track of the number of references to it.
The producer is closed when the reference count reaches zero.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <R,T extends Closeable>
TcreateProxy(CloseableReferenceTracker<R, T> referenceTracker)
-
Method Details
-
createProxy
public static <R,T extends Closeable> T createProxy(CloseableReferenceTracker<R, T> referenceTracker) -
invoke
- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-