Package io.grpc.internal
Class ManagedChannelOrphanWrapper.ManagedChannelReference
- java.lang.Object
-
- java.lang.ref.Reference<T>
-
- java.lang.ref.WeakReference<ManagedChannelOrphanWrapper>
-
- io.grpc.internal.ManagedChannelOrphanWrapper.ManagedChannelReference
-
- Enclosing class:
- ManagedChannelOrphanWrapper
static final class ManagedChannelOrphanWrapper.ManagedChannelReference extends java.lang.ref.WeakReference<ManagedChannelOrphanWrapper>
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
ALLOCATION_SITE_PROPERTY_NAME
private java.lang.ref.Reference<java.lang.RuntimeException>
allocationSite
private java.lang.String
channelStr
private static boolean
ENABLE_ALLOCATION_TRACKING
private static java.lang.RuntimeException
missingCallSite
private java.lang.ref.ReferenceQueue<ManagedChannelOrphanWrapper>
refqueue
private java.util.concurrent.ConcurrentMap<ManagedChannelOrphanWrapper.ManagedChannelReference,ManagedChannelOrphanWrapper.ManagedChannelReference>
refs
private java.util.concurrent.atomic.AtomicBoolean
shutdown
-
Constructor Summary
Constructors Constructor Description ManagedChannelReference(ManagedChannelOrphanWrapper orphanable, ManagedChannel channel, java.lang.ref.ReferenceQueue<ManagedChannelOrphanWrapper> refqueue, java.util.concurrent.ConcurrentMap<ManagedChannelOrphanWrapper.ManagedChannelReference,ManagedChannelOrphanWrapper.ManagedChannelReference> refs)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static int
cleanQueue(java.lang.ref.ReferenceQueue<ManagedChannelOrphanWrapper> refqueue)
void
clear()
This clear() is *not* called automatically by the JVM.private void
clearInternal()
private void
clearSafely()
Safe to call concurrently.private static java.lang.RuntimeException
missingCallSite()
-
-
-
Field Detail
-
ALLOCATION_SITE_PROPERTY_NAME
private static final java.lang.String ALLOCATION_SITE_PROPERTY_NAME
- See Also:
- Constant Field Values
-
ENABLE_ALLOCATION_TRACKING
private static final boolean ENABLE_ALLOCATION_TRACKING
-
missingCallSite
private static final java.lang.RuntimeException missingCallSite
-
refqueue
private final java.lang.ref.ReferenceQueue<ManagedChannelOrphanWrapper> refqueue
-
refs
private final java.util.concurrent.ConcurrentMap<ManagedChannelOrphanWrapper.ManagedChannelReference,ManagedChannelOrphanWrapper.ManagedChannelReference> refs
-
channelStr
private final java.lang.String channelStr
-
allocationSite
private final java.lang.ref.Reference<java.lang.RuntimeException> allocationSite
-
shutdown
private final java.util.concurrent.atomic.AtomicBoolean shutdown
-
-
Constructor Detail
-
ManagedChannelReference
ManagedChannelReference(ManagedChannelOrphanWrapper orphanable, ManagedChannel channel, java.lang.ref.ReferenceQueue<ManagedChannelOrphanWrapper> refqueue, java.util.concurrent.ConcurrentMap<ManagedChannelOrphanWrapper.ManagedChannelReference,ManagedChannelOrphanWrapper.ManagedChannelReference> refs)
-
-
Method Detail
-
clear
public void clear()
This clear() is *not* called automatically by the JVM. As this is a weak ref, the reference will be cleared automatically by the JVM, but will not be removed fromrefs
. We do it here to avoid this ending up on the reference queue.- Overrides:
clear
in classjava.lang.ref.Reference<ManagedChannelOrphanWrapper>
-
clearSafely
private void clearSafely()
Safe to call concurrently.
-
clearInternal
private void clearInternal()
-
missingCallSite
private static java.lang.RuntimeException missingCallSite()
-
cleanQueue
static int cleanQueue(java.lang.ref.ReferenceQueue<ManagedChannelOrphanWrapper> refqueue)
-
-