FileDocCategorySizeDatePackage
DelegateInvocationHandler.javaAPI DocGlassfish v2 API3503Fri May 04 22:23:42 BST 2007com.sun.enterprise.management.support

DelegateInvocationHandler

public final class DelegateInvocationHandler extends Object implements InvocationHandler

Fields Summary
private final Delegate
mDelegate
Constructors Summary
private DelegateInvocationHandler(Delegate delegate)

		mDelegate	= delegate;
	
Methods Summary
public java.lang.Objectinvoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
Just forward whatever it is to the Delegate

   		final Class[]	sig	= method.getParameterTypes();
   		
   		return( mDelegate.invoke( method.getName(), args, ClassUtil.classnamesFromSignature( sig ) ) );
   	
public static java.lang.ObjectnewProxyInstance(Delegate delegate, java.lang.Class interfaceClass)

		final DelegateInvocationHandler	handler	=
			new DelegateInvocationHandler( delegate );
			
		final ClassLoader		classLoader	= interfaceClass.getClassLoader();
		
		final Class[]	interfaces	= new Class[] { interfaceClass };
		final Object proxy	= Proxy.newProxyInstance( classLoader,
							interfaces, handler);
		
		return( proxy );