01: package org.concern.controller.jmx;
02:
03: import java.io.Serializable;
04: import java.lang.reflect.InvocationHandler;
05: import java.lang.reflect.InvocationTargetException;
06: import java.lang.reflect.Method;
07:
08: class ControllerProxy implements InvocationHandler, Serializable {
09: private String name;
10:
11: public ControllerProxy(String name) {
12: this .name = name;
13: }
14:
15: public Object invoke(Object proxy, Method method, Object[] args)
16: throws Throwable {
17: try {
18: return method.invoke(ControllerService.getController(name),
19: args);
20: } catch (InvocationTargetException e) {
21: throw e.getTargetException();
22: } catch (Throwable e) {
23: e.printStackTrace();
24: throw e;
25: }
26: }
27: }
|