org.jboss.weld.util
Class Proxies

java.lang.Object
  extended by org.jboss.weld.util.Proxies

public class Proxies
extends java.lang.Object

Utilties for working with Javassist proxies

Author:
Nicklas Karlsson, Pete Muir

Nested Class Summary
static class Proxies.TypeInfo
           
 
Constructor Summary
Proxies()
           
 
Method Summary
static javassist.util.proxy.ProxyFactory attachMethodHandler(javassist.util.proxy.ProxyFactory proxyFactory, javassist.util.proxy.MethodHandler methodHandler)
           
static
<T> T
attachMethodHandler(T instance, javassist.util.proxy.MethodHandler methodHandler)
           
static
<T> T
createProxy(javassist.util.proxy.MethodHandler methodHandler, Proxies.TypeInfo typeInfo)
          Create a proxy with a handler, registering the proxy for cleanup
static
<T> java.lang.Class<T>
createProxyClass(javassist.util.proxy.MethodHandler methodHandler, Proxies.TypeInfo typeInfo)
          Create a proxy class You will need to manually register the proxy instances for cleanup
static
<T> java.lang.Class<T>
createProxyClass(Proxies.TypeInfo typeInfo)
          Create a proxy class You will need to manually register the proxy instances for cleanup
static boolean isTypeProxyable(java.lang.reflect.Type type)
          Indicates if a class is proxyable
static boolean isTypesProxyable(java.lang.Iterable<? extends java.lang.reflect.Type> types)
          Indicates if a set of types are all proxyable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Proxies

public Proxies()
Method Detail

createProxy

public static <T> T createProxy(javassist.util.proxy.MethodHandler methodHandler,
                                Proxies.TypeInfo typeInfo)
                     throws java.lang.IllegalAccessException,
                            java.lang.InstantiationException
Create a proxy with a handler, registering the proxy for cleanup

Type Parameters:
T -
Parameters:
methodHandler -
typeInfo -
Returns:
Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException

createProxyClass

public static <T> java.lang.Class<T> createProxyClass(Proxies.TypeInfo typeInfo)
Create a proxy class You will need to manually register the proxy instances for cleanup

Type Parameters:
T -
Parameters:
typeInfo -
Returns:

createProxyClass

public static <T> java.lang.Class<T> createProxyClass(javassist.util.proxy.MethodHandler methodHandler,
                                                      Proxies.TypeInfo typeInfo)
Create a proxy class You will need to manually register the proxy instances for cleanup

Type Parameters:
T -
Parameters:
methodHandler -
typeInfo -
Returns:

isTypeProxyable

public static boolean isTypeProxyable(java.lang.reflect.Type type)
Indicates if a class is proxyable

Parameters:
type - The class to test
Returns:
True if proxyable, false otherwise

isTypesProxyable

public static boolean isTypesProxyable(java.lang.Iterable<? extends java.lang.reflect.Type> types)
Indicates if a set of types are all proxyable

Parameters:
types - The types to test
Returns:
True if proxyable, false otherwise

attachMethodHandler

public static javassist.util.proxy.ProxyFactory attachMethodHandler(javassist.util.proxy.ProxyFactory proxyFactory,
                                                                    javassist.util.proxy.MethodHandler methodHandler)

attachMethodHandler

public static <T> T attachMethodHandler(T instance,
                                        javassist.util.proxy.MethodHandler methodHandler)


Copyright © 2008-2010 Seam Framework. All Rights Reserved.