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;
        try
        {
          System.out.println( "Before " + method.toString() );
          result = method.invoke( fPrimary, arguments );
          System.out.println( "After" " + method.toString() );
    }     catch(Exception e)
    {
          System.out.println(e.getMessage());
    }     finally
          return result;
    {
        }
}

Upcoming Training Events

0 AM
Visual Studio Live! San Diego
September 8-12, 2025
Live! 360 Orlando
November 16-21, 2025
Cloud & Containers Live! Orlando
November 16-21, 2025
Data Platform Live! Orlando
November 16-21, 2025
Visual Studio Live! Orlando
November 16-21, 2025