Top Description Fields Constructors Methods
org.jvnet.hk2.internal

public Class ProxyUtilities

extends Object
Class Inheritance
Imports
java.lang.reflect.Proxy, java.security.AccessController, .PrivilegedAction, java.util.HashMap, java.util.concurrent.locks.ReentrantLock, org.glassfish.hk2.api.ActiveDescriptor, .Injectee, .MultiException, .ProxyCtl, .ServiceLocator, javassist.util.proxy.MethodHandler, .ProxyFactory, .ProxyObject

Utilities around proxying
Author
jwells

Field Summary

Modifier and TypeField and Description
private final ReentrantLock
private static final ReentrantLock
private final HashMap<ClassLoader, DelegatingClassLoader>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public <T> T
generateProxy(Class<?> requestedClass, ServiceLocatorImpl locator, ActiveDescriptor<T> root, ServiceHandleImpl<T> handle, Injectee injectee)

public void
private <T> T
secureCreate(final Class<?> superclass, final Class<?>[] interfaces, final MethodHandler callback, boolean useJDKProxy, ServiceLocator
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
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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lockback to summary
private final ReentrantLock lock
proxyCreationLockback to summary
private static final ReentrantLock proxyCreationLock
superClassToDelegatorback to summary
private final HashMap<ClassLoader, DelegatingClassLoader> superClassToDelegator

Constructor Detail

ProxyUtilitiesback to summary
public ProxyUtilities()

Method Detail

generateProxyback to summary
public <T> T generateProxy(Class<?> requestedClass, ServiceLocatorImpl locator, ActiveDescriptor<T> root, ServiceHandleImpl<T> handle, Injectee injectee)
Annotations
@SuppressWarnings:unchecked
releaseCacheback to summary
public void releaseCache()
secureCreateback to summary
private <T> T secureCreate(final Class<?> superclass, final Class<?>[] interfaces, final 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
anchor:ServiceLocator

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