dynaop
Class ProxyFactory

java.lang.Object
  extended by dynaop.ProxyFactory

public class ProxyFactory
extends java.lang.Object

Manufactures proxies.

Author:
Bob Lee (crazybob@crazybob.org)

Method Summary
 java.lang.Object extend(java.lang.Class parentClass)
          Creates class proxy for the given target class.
static ProxyFactory getInstance()
          Gets default proxy factory instance. Uses default Aspects instance.
static ProxyFactory getInstance(Aspects aspects)
          Creates proxy factory instance configured using given aspects.
 java.lang.Object wrap(java.lang.Object target)
          Creates dynamic proxy for the given target object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

wrap

public java.lang.Object wrap(java.lang.Object target)
Creates dynamic proxy for the given target object. Returns the target object unproxied in the event that no interceptors or mixins are present.

Creates a completely new proxy instance that wraps a target instance and implements the specified interfaces. Keeps proxy separate from target object.


extend

public java.lang.Object extend(java.lang.Class parentClass)
Creates class proxy for the given target class. Returns the target object unproxied in the event that no interceptors or mixins are present.

Extends the parent class and overrides methods to support interception, and implements specified interfaces. Ties proxy and proxied class together but works with classes that don't have interfaces (java.util.Date for example).


getInstance

public static ProxyFactory getInstance(Aspects aspects)
Creates proxy factory instance configured using given aspects.


getInstance

public static ProxyFactory getInstance()
Gets default proxy factory instance. Uses default Aspects instance.