Examples of CallbackFilter


Examples of net.sf.cglib.proxy.CallbackFilter

        final Enhancer enhancer = new Enhancer();
        enhancer.setCallbacks(new Callback[]{

            new DelegatingInterceptor(null), new DelegatingHandler(null),
            new DelegatingDispatcher(null), NoOp.INSTANCE});
        enhancer.setCallbackFilter(new CallbackFilter() {
            int i = 1;

            public int accept(Method method) {
                if (method.getDeclaringClass() == Runnable.class) {
                    return 0;
View Full Code Here

Examples of net.sf.cglib.proxy.CallbackFilter

        final Enhancer enhancer = new Enhancer();
        enhancer.setCallbacks(new Callback[]{

            new DelegatingInterceptor(null), new DelegatingHandler(null),
            new DelegatingDispatcher(null), NoOp.INSTANCE});
        enhancer.setCallbackFilter(new CallbackFilter() {
            int i = 1;

            public int accept(Method method) {
                if (method.getDeclaringClass() == Runnable.class) {
                    return 0;
View Full Code Here

Examples of net.sf.cglib.proxy.CallbackFilter

        final Callback[] callbacks = {
          NoOp.INSTANCE,
          new NodeDispatcher(nodeProxy)
        };
       
        final CallbackFilter callbackFilter = new CallbackFilter() {
            @Override
            public int accept(final Method method) {
               
                final Class declaringClass = method.getDeclaringClass();
               
View Full Code Here

Examples of net.sf.cglib.proxy.CallbackFilter

                @Override
                public Object intercept(Object arg0, Method arg1, Object[] arg2, MethodProxy arg3) throws Throwable {
                    return null;
                }
            }});
            en.setCallbackFilter(new CallbackFilter() {
                @Override
                public int accept(Method method) {
                    if (method.getParameterTypes().length == 0 && method.getName().equals("finalize")) {
                        return 1;
                    }
View Full Code Here

Examples of net.sf.cglib.proxy.CallbackFilter

      this.callbackTypes.add(callback.getClass());
    }

    // Set up the callback filter to return the index of the BeanMethodInterceptor when
    // handling a @Bean-annotated method; otherwise, return index of the NoOp callback.
    callbackFilter = new CallbackFilter() {
      public int accept(Method candidateMethod) {
        return (AnnotationUtils.findAnnotation(candidateMethod, Bean.class) != null ? 0 : 1);
      }
    };
  }
View Full Code Here

Examples of net.sf.cglib.proxy.CallbackFilter

    private Object enhanceFactoryBean(Class<?> fbClass, String beanName) throws InstantiationException, IllegalAccessException {
      Enhancer enhancer = new Enhancer();
      enhancer.setUseCache(false);
      enhancer.setSuperclass(fbClass);
      enhancer.setUseFactory(false);
      enhancer.setCallbackFilter(new CallbackFilter() {
        public int accept(Method method) {
          return method.getName().equals("getObject") ? 0 : 1;
        }
      });
      List<Callback> callbackInstances = new ArrayList<Callback>();
View Full Code Here

Examples of net.sf.cglib.proxy.CallbackFilter

    private Object makeProxyRef(Server<Invocation, Object, Invocation> ref) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(Server.class);
        enhancer.setInterfaces(combine(interfaces, standardInterfaces));
        enhancer.setCallbacks(new Callback[]{new ObjectProxyServerImpl(ref, callOnVoidMethods), NoOp.INSTANCE});
        enhancer.setCallbackFilter(new CallbackFilter() {

            @Override
            public int accept(Method method) {
                final Class<?> cls = method.getDeclaringClass();
                if (cls.isAssignableFrom(ActorRefDelegate.class))
View Full Code Here

Examples of net.sf.cglib.proxy.CallbackFilter

    private Object makeProxyRef(Server<Invocation, Object, Invocation> ref) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(Server.class);
        enhancer.setInterfaces(combine(interfaces, standardInterfaces));
        enhancer.setCallbacks(new Callback[]{new ObjectProxyServerImpl(ref, callOnVoidMethods), NoOp.INSTANCE});
        enhancer.setCallbackFilter(new CallbackFilter() {

            @Override
            public int accept(Method method) {
                final Class<?> cls = method.getDeclaringClass();
                if (cls.isAssignableFrom(ActorRefDelegate.class))
View Full Code Here

Examples of net.sf.cglib.proxy.CallbackFilter

        DefaultDispatcher dispatcher = new DefaultDispatcher(interceptor.getTarget());
        Callback[] callbacks = new Callback[] {
            dmi, dispatcher
        };
        eh.setCallbacks(callbacks);
        CallbackFilter cf = new CallbackFilterAdapter(methodPointcut);
        eh.setCallbackFilter(cf);

        switch (proxyType) {
            case CLASS:
                Class<?> clazz = types[0];
View Full Code Here

Examples of net.sf.cglib.proxy.CallbackFilter

                            FastMethod realMethod = assertNotNull(methodMappings.get(method), "unknown method: %s", method);
                            return realMethod.invoke(null, args);
                        }
                    } });

            generator.setCallbackFilter(new CallbackFilter() {
                public int accept(Method method) {
                    if (isEqualsMethod(method) || isHashCodeMethod(method)) {
                        return 0; // invoke super
                    } else if (isToStringMethod(method)) {
                        return 1; // invoke toString
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.