jdk代理
Car car = new Car();
CarTimeProxy ctp = new CarTimeProxy(car);
CarLogProxy clp = new CarLogProxy(ctp);
InvocationHandler h2= new TimeHandler(clp);
Class<?> c = car.getClass();
/*
* loader:类加载器; interfaces:实现接口; h:InvocationHandler
*/
Movable m = (Movable) Proxy.newProxyInstance(c.getClassLoader(),
c.getInterfaces(), h2);
m.Move();
为什么这样子做的话只能输出日志线程,而输出不了时间线程?