01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08:
09: package mx4j.remote;
10:
11: import java.lang.reflect.InvocationHandler;
12: import java.lang.reflect.InvocationTargetException;
13: import java.lang.reflect.Method;
14: import javax.management.MBeanServerConnection;
15:
16: /**
17: * @version $Revision: 1.3 $
18: */
19: public class ClientProxy implements InvocationHandler {
20: private final MBeanServerConnection target;
21:
22: protected ClientProxy(MBeanServerConnection target) {
23: this .target = target;
24: }
25:
26: public Object invoke(Object proxy, Method method, Object[] args)
27: throws Throwable {
28: try {
29: return method.invoke(target, args);
30: } catch (InvocationTargetException x) {
31: throw x.getTargetException();
32: }
33: }
34: }
|