org.codehaus.aspectwerkz.proxy
Class Proxy

java.lang.Object
  extended by org.codehaus.aspectwerkz.proxy.Proxy

public class Proxy
extends Object

Compiles proxy classes from target classes and weaves in all matching aspects deployed in the class loader and defined by the META-INF/aop.xml file.

Author:
Jonas BonŽr

Field Summary
static String PROXY_SUFFIX_START
          The suffix for the compiled proxy classes.
 
Constructor Summary
Proxy()
           
 
Method Summary
static Class getProxyClassFor(Class clazz, boolean useCache, boolean makeAdvisable)
          Compiles and returns a proxy class for the class specified.
static String getUniqueClassNameFromProxy(String proxyClassName)
          Returns a unique name for the proxy class.
static Object newInstance(Class clazz)
          Creates a new proxy instance based for the class specified and instantiates it using its default no-argument constructor.
static Object newInstance(Class clazz, boolean useCache, boolean makeAdvisable)
          Creates a new proxy instance based for the class specified and instantiates it using its default no-argument constructor.
static Object newInstance(Class clazz, Class[] argumentTypes, Object[] argumentValues)
          Creates a new proxy instance for the class specified and instantiates it using the constructor matching the argument type array specified.
static Object newInstance(Class clazz, Class[] argumentTypes, Object[] argumentValues, boolean useCache, boolean makeAdvisable)
          Creates a new proxy instance for the class specified and instantiates it using the constructor matching the argument type array specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROXY_SUFFIX_START

public static final String PROXY_SUFFIX_START
The suffix for the compiled proxy classes.

See Also:
Constant Field Values
Constructor Detail

Proxy

public Proxy()
Method Detail

newInstance

public static Object newInstance(Class clazz)
Creates a new proxy instance based for the class specified and instantiates it using its default no-argument constructor.

The proxy will be cached and non-advisable.

Parameters:
clazz - the target class to make a proxy for
Returns:
the proxy instance

newInstance

public static Object newInstance(Class clazz,
                                 Class[] argumentTypes,
                                 Object[] argumentValues)
Creates a new proxy instance for the class specified and instantiates it using the constructor matching the argument type array specified.

The proxy will be cached and non-advisable.

Parameters:
clazz - the target class to make a proxy for
argumentTypes - the argument types matching the signature of the constructor to use when instantiating the proxy
argumentValues - the argument values to use when instantiating the proxy
Returns:
the proxy instance

newInstance

public static Object newInstance(Class clazz,
                                 boolean useCache,
                                 boolean makeAdvisable)
Creates a new proxy instance based for the class specified and instantiates it using its default no-argument constructor.

Parameters:
clazz - the target class to make a proxy for
useCache - true if a cached instance of the proxy classed should be used
makeAdvisable - true if the proxy class should implement the Advisable interface, e.g. be prepared for programmatic, runtime, per instance hot deployement of advice
Returns:
the proxy instance

newInstance

public static Object newInstance(Class clazz,
                                 Class[] argumentTypes,
                                 Object[] argumentValues,
                                 boolean useCache,
                                 boolean makeAdvisable)
Creates a new proxy instance for the class specified and instantiates it using the constructor matching the argument type array specified.

Parameters:
clazz - the target class to make a proxy for
argumentTypes - the argument types matching the signature of the constructor to use when instantiating the proxy
argumentValues - the argument values to use when instantiating the proxy
useCache - true if a cached instance of the proxy classed should be used
makeAdvisable - true if the proxy class should implement the Advisable interface, e.g. be prepared for programmatic, runtime, per instance hot deployement of advice
Returns:
the proxy instance

getProxyClassFor

public static Class getProxyClassFor(Class clazz,
                                     boolean useCache,
                                     boolean makeAdvisable)
Compiles and returns a proxy class for the class specified.

Parameters:
clazz - the target class to make a proxy for
useCache - true if a cached instance of the proxy classed should be used
makeAdvisable - true if the proxy class should implement the Advisable interface, e.g. be prepared for programmatic, runtime, per instance hot deployement of advice
Returns:
the proxy class

getUniqueClassNameFromProxy

public static String getUniqueClassNameFromProxy(String proxyClassName)
Returns a unique name for the proxy class.

Parameters:
proxyClassName -
Returns:
the class name beeing proxied


Copyright © 2002-2005 Jonas Bonér, Alexandre Vasseur. All Rights Reserved.