Invocation handler of Money.

Power Java
Dynamic Proxy Classes:
Toward Metalevel Programming in Java

Mathias Richter and Takashi Suezawa
Listing 3. Invocation handler of Money.

public class MoneyInvocationHandler
    implements InvocationHandler

    private Object fPrimary;

    public Object invoke(Object proxy,
		Method method, Object[] arguments)
        Object result = null;
          System.out.println( "Before " + method.toString() );
          result = method.invoke( fPrimary, arguments );
          System.out.println( "After" " + method.toString() );
    }     catch(Exception e)
    }     finally
          return result;


Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.

Upcoming Events