Package spin.proxy
Class JDKProxyFactory
java.lang.Object
spin.ProxyFactory
spin.proxy.JDKProxyFactory
A factory of proxies utilizing JDK virtual proxies.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
areProxyEqual
(Object proxy1, Object proxy2) Test if the given proxies of this factory are intercepting the same object.createProxy
(Object object, Evaluator evaluator) The created proxy will not implement non-public interfaces from different class loaders since these yield anIllegalAccessError
on construction of a proxy.boolean
Test if the given object is a proxy created by this factory.Methods inherited from class spin.ProxyFactory
evaluteInvocation
-
Constructor Details
-
JDKProxyFactory
public JDKProxyFactory()
-
-
Method Details
-
createProxy
The created proxy will not implement non-public interfaces from different class loaders since these yield anIllegalAccessError
on construction of a proxy.- Specified by:
createProxy
in classProxyFactory
- Parameters:
object
- object to create proxy forevaluator
- evaluator to evaluate invocations with- Returns:
- new proxy
-
isProxy
Description copied from class:ProxyFactory
Test if the given object is a proxy created by this factory.- Specified by:
isProxy
in classProxyFactory
- Parameters:
object
- object to test- Returns:
true
if given object is a Spin proxy,false
otherwise
-
areProxyEqual
Description copied from class:ProxyFactory
Test if the given proxies of this factory are intercepting the same object.- Specified by:
areProxyEqual
in classProxyFactory
- Parameters:
proxy1
- first proxyproxy2
- second proxy- Returns:
- true if both proxies are intercepting the same object
-