jfun.yan
Class Proxies

java.lang.Object
  extended by jfun.yan.Proxies

public class Proxies
extends java.lang.Object

This class provides all dynamic proxy related utility functions. Currently only setProxyImplementation is provided.

Codehaus.org.

Author:
Ben Yu

Constructor Summary
Proxies()
           
 
Method Summary
static boolean setProxyImplementation(java.lang.Object proxy, java.lang.Object impl)
          Hot-swap implementation for a proxy object created by a proxy component.
 
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

setProxyImplementation

public static boolean setProxyImplementation(java.lang.Object proxy,
                                             java.lang.Object impl)
                                      throws java.lang.IllegalArgumentException
Hot-swap implementation for a proxy object created by a proxy component. Components.proxy() and Component.proxy() methods expose a dynamic proxy instance and hide the real component instance. This method does hot-swapping, which changes the underlying real component instance to another object.

Parameters:
proxy - the proxied component instance.
impl - the object to change the underlying real instance to.
Returns:
true if the proxy is really created by the proxy() methods, false otherwise.
Throws:
java.lang.IllegalArgumentException - if the object does not implement all the interfaces the proxy implements.