Package org.jvnet.hk2.internal
Class ProxyUtilities
- java.lang.Object
-
- org.jvnet.hk2.internal.ProxyUtilities
-
public class ProxyUtilities extends java.lang.Object
Utilities around proxying
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.Object
proxyCreationLock
private java.util.HashMap<java.lang.ClassLoader,DelegatingClassLoader>
superClassToDelegator
-
Constructor Summary
Constructors Constructor Description ProxyUtilities()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
generateProxy(java.lang.Class<?> requestedClass, ServiceLocatorImpl locator, ActiveDescriptor<T> root, ServiceHandleImpl<T> handle, Injectee injectee)
void
releaseCache()
private <T> T
secureCreate(java.lang.Class<?> superclass, java.lang.Class<?>[] interfaces, javassist.util.proxy.MethodHandler callback, boolean useJDKProxy, ServiceLocator anchor)
We put the anchor as the value even though we don't use it in order to make it easier to catch memory leaks here.
-
-
-
Field Detail
-
proxyCreationLock
private static final java.lang.Object proxyCreationLock
-
superClassToDelegator
private final java.util.HashMap<java.lang.ClassLoader,DelegatingClassLoader> superClassToDelegator
-
-
Method Detail
-
secureCreate
private <T> T secureCreate(java.lang.Class<?> superclass, java.lang.Class<?>[] interfaces, javassist.util.proxy.MethodHandler callback, boolean useJDKProxy, ServiceLocator anchor)
We put the anchor as the value even though we don't use it in order to make it easier to catch memory leaks here. See MemoryTest- Parameters:
superclass
-interfaces
-callback
-useJDKProxy
-anchor
- This is put into the WeakMap to make sure that IF this map should leak that it will leak big, making it easier to detect- Returns:
-
generateProxy
public <T> T generateProxy(java.lang.Class<?> requestedClass, ServiceLocatorImpl locator, ActiveDescriptor<T> root, ServiceHandleImpl<T> handle, Injectee injectee)
-
releaseCache
public void releaseCache()
-
-