spin.proxy
Class JDKProxyFactory

java.lang.Object
  extended by spin.ProxyFactory
      extended by spin.proxy.JDKProxyFactory

public class JDKProxyFactory
extends ProxyFactory

A factory of proxies utilizing JDK virtual proxies.


Constructor Summary
JDKProxyFactory()
           
 
Method Summary
protected  boolean areProxyEqual(java.lang.Object proxy1, java.lang.Object proxy2)
          Test if the given proxies of this factory are intercepting the same object.
 java.lang.Object createProxy(java.lang.Object object, Evaluator evaluator)
          The created proxy will not implement non-public interfaces from different class loaders since these yield an IllegalAccessError on construction of a proxy.
 boolean isProxy(java.lang.Object object)
          Test if the given object is a proxy created by this factory.
 
Methods inherited from class spin.ProxyFactory
evaluteInvocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDKProxyFactory

public JDKProxyFactory()
Method Detail

createProxy

public java.lang.Object createProxy(java.lang.Object object,
                                    Evaluator evaluator)
The created proxy will not implement non-public interfaces from different class loaders since these yield an IllegalAccessError on construction of a proxy.

Specified by:
createProxy in class ProxyFactory
Parameters:
object - object to create proxy for
evaluator - evaluator to evaluate invocations with
Returns:
new proxy

isProxy

public boolean isProxy(java.lang.Object object)
Description copied from class: ProxyFactory
Test if the given object is a proxy created by this factory.

Specified by:
isProxy in class ProxyFactory
Parameters:
object - object to test
Returns:
true if given object is a Spin proxy, false otherwise

areProxyEqual

protected boolean areProxyEqual(java.lang.Object proxy1,
                                java.lang.Object proxy2)
Description copied from class: ProxyFactory
Test if the given proxies of this factory are intercepting the same object.

Specified by:
areProxyEqual in class ProxyFactory
Parameters:
proxy1 - first proxy
proxy2 - second proxy
Returns:
true if both proxies are intercepting the same object


Copyright © 2007. All Rights Reserved.