1 17 18 package org.apache.avalon.fortress.impl.factory; 19 20 import java.lang.reflect.InvocationHandler ; 21 import java.lang.reflect.InvocationTargetException ; 22 import java.lang.reflect.Method ; 23 24 29 final class PassThroughInvocationHandler 30 implements InvocationHandler 31 { 32 35 private final Object m_object; 36 37 42 public PassThroughInvocationHandler( final Object object ) 43 { 44 if ( null == object ) 45 { 46 throw new NullPointerException ( "object" ); 47 } 48 49 m_object = object; 50 } 51 52 61 public Object invoke( final Object proxy, 62 final Method meth, 63 final Object [] args ) 64 throws Throwable 65 { 66 try 67 { 68 return meth.invoke( m_object, args ); 69 } 70 catch ( final InvocationTargetException ite ) 71 { 72 throw ite.getTargetException(); 73 } 74 } 75 76 81 Object getObject() 82 { 83 return m_object; 84 } 85 } 86 | Popular Tags |