Package net.sf.cglib.proxy

Examples of net.sf.cglib.proxy.Dispatcher


  }

  public Object newInstance(Class<?>[] interfacesToProxy, final Object target) {
    Enhancer enhancer = new Enhancer();
    enhancer.setInterfaces(interfacesToProxy);
    enhancer.setCallback(new Dispatcher() {
      public Object loadObject() throws Exception {
        return target;
      }
    });
    return enhancer.create();
View Full Code Here


            Enhancer e = new Enhancer();
            e.setClassLoader(classLoader);
            e.setSuperclass(getTargetClass(classes));
            e.setInterfaces(getInterfaces(classes));
            e.setInterceptDuringConstruction(false);
            e.setCallback(new Dispatcher() {
                public Object loadObject() throws Exception {
                    return dispatcher.call();
                }
            });
            e.setUseFactory(false);
View Full Code Here

        Enhancer e = new Enhancer();
        e.setClassLoader(new CgLibClassLoader(bundle));
        e.setSuperclass(getTargetClass(classes));
        e.setInterfaces(getInterfaces(classes));
        e.setInterceptDuringConstruction(false);
        e.setCallback(new Dispatcher() {
            public Object loadObject() throws Exception {
                return dispatcher.call();
            }
        });
        e.setUseFactory(false);
View Full Code Here

            Enhancer e = new Enhancer();
            e.setClassLoader(classLoader);
            e.setSuperclass(getTargetClass(classes));
            e.setInterfaces(getInterfaces(classes));
            e.setInterceptDuringConstruction(false);
            e.setCallback(new Dispatcher() {
                public Object loadObject() throws Exception {
                    return dispatcher.call();
                }
            });
            e.setUseFactory(false);
View Full Code Here

            Enhancer e = new Enhancer();
            e.setClassLoader(classLoader);
            e.setSuperclass(getTargetClass(classes));
            e.setInterfaces(getInterfaces(classes));
            e.setInterceptDuringConstruction(false);
            e.setCallback(new Dispatcher() {
                public Object loadObject() throws Exception {
                    return dispatcher.call();
                }
            });
            e.setUseFactory(false);
View Full Code Here

    enhancer.setSuperclass(pojo.getClass());
    enhancer.setInterfaces(new Class[] { DirtFieldsWatcher.class });
    enhancer.setCallbackTypes(new Class[] { MethodInterceptor.class, Dispatcher.class, MethodInterceptor.class });
    enhancer.setCallbackFilter(IGNORE_BRIDGE_AND_OBJECT_METHODS);
    BaseObject baseObject = new BaseObject();
    enhancer.setCallbacks(new Callback[] { new WatchSetterInterceptor(pojo, baseObject), new Dispatcher() { public Object loadObject() throws Exception {return pojo;}  }, new BypassBaseObjectInterceptor(baseObject) });
    return (T) enhancer.create();
  }
View Full Code Here

  }

  public Object newInstance(Class<?>[] interfacesToProxy, final Object target) {
    Enhancer enhancer = new Enhancer();
    enhancer.setInterfaces(interfacesToProxy);
    enhancer.setCallback(new Dispatcher() {
      public Object loadObject() throws Exception {
        return target;
      }
    });
    return enhancer.create();
View Full Code Here

    }

    private static void installSystemPropertiesProxy() {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(Properties.class);
        enhancer.setCallback(new Dispatcher() {
            @Override
            public Object loadObject() throws Exception {
                return instance.getContext().getProperties();
            }
        });
View Full Code Here

TOP

Related Classes of net.sf.cglib.proxy.Dispatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.