Package net.sf.cglib.proxy

Examples of net.sf.cglib.proxy.Callback


        }

        public Object createProxy(AbstractName target) {
            assert target != null: "target is null";

            Callback callback = getMethodInterceptor(proxyType, kernel, target);

            Enhancer.registerCallbacks(proxyType, new Callback[]{callback});
            try {
                Object proxy = fastClass.newInstance();
                interceptors.put(proxy, callback);
View Full Code Here


//                initialized = true;
//            }
//        }
        Service service = ((ServiceImpl) serviceImpl).getService();
        GenericServiceEndpoint serviceEndpoint = new GenericServiceEndpoint(portQName, service, location);
        Callback callback = new ServiceEndpointMethodInterceptor(serviceEndpoint, sortedOperationInfos, credentialsName);
        Callback[] callbacks = new Callback[]{SerializableNoOp.INSTANCE, callback};
        Enhancer.registerCallbacks(serviceEndpointClass, callbacks);
        try {
            return (Remote) constructor.newInstance(new Object[]{serviceEndpoint});
        } catch (InvocationTargetException e) {
View Full Code Here

        return serviceInstance;
    }

    private Object createServiceInterfaceProxy(Class serviceInterface, Map seiPortNameToFactoryMap, Map seiClassNameToFactoryMap, ClassLoader classLoader) throws NamingException {

        Callback callback = new ServiceMethodInterceptor(seiPortNameToFactoryMap);
        Callback[] methodInterceptors = new Callback[]{SerializableNoOp.INSTANCE, callback};

        Enhancer enhancer = new Enhancer();
        enhancer.setClassLoader(classLoader);
        enhancer.setSuperclass(ServiceImpl.class);
View Full Code Here

  }

  protected final static <T> boolean isEnhanced(T selector) {
    Factory factory = as(selector, Factory.class);
    if (factory != null) {
      Callback callback = factory.getCallback(0);
      SelectorMethodInterceptor selectorInterceptor = as(callback, SelectorMethodInterceptor.class);
      return selectorInterceptor != null;
    }
    return false;
  }
View Full Code Here

            } catch (final ClassNotFoundException e) {
                throw (NamingException) new NamingException("Could not load service interface class " + serviceInterfaceClassName).initCause(e);
            }

            // create method interceptors
            final Callback callback = new ServiceMethodInterceptor(seiPortNameToFactoryMap);
            this.methodInterceptors = new Callback[]{NoOp.INSTANCE, callback};

            // create service class
            final Enhancer enhancer = new Enhancer();
            enhancer.setClassLoader(classLoader);
View Full Code Here

//                initialized = true;
//            }
//        }
        final Service service = ((ServiceImpl) serviceImpl).getService();
        final GenericServiceEndpoint serviceEndpoint = new GenericServiceEndpoint(portQName, service, location);
        final Callback callback = new ServiceEndpointMethodInterceptor(serviceEndpoint, sortedOperationInfos, credentialsName);
        final Callback[] callbacks = new Callback[]{NoOp.INSTANCE, callback};
        Enhancer.registerCallbacks(serviceEndpointClass, callbacks);
        try {
            return (Remote) constructor.newInstance(new Object[]{serviceEndpoint});
        } catch (final InvocationTargetException e) {
View Full Code Here

        }

        public Object createProxy(AbstractName target) {
            assert target != null: "target is null";

            Callback callback = getMethodInterceptor(proxyType, kernel, target);

            try {
                Enhancer.registerCallbacks(proxyType, new Callback[]{callback});
                Object proxy = fastClass.newInstance();
                interceptors.put(proxy, callback);
View Full Code Here

        }

        public Object createProxy(AbstractName target) {
            assert target != null: "target is null";

            Callback callback = getMethodInterceptor(proxyType, kernel, target);

            try {
                Enhancer.registerCallbacks(proxyType, new Callback[]{callback});
                Object proxy = fastClass.newInstance();
                interceptors.put(proxy, callback);
View Full Code Here

    }
   
    private Service createServiceProxy(Class superClass, ClassLoader classLoader, QName serviceName, URL wsdlLocation) throws NamingException {
        if (this.serviceConstructor == null) {           
            // create method interceptors
            Callback callback = getPortMethodInterceptor();
            this.methodInterceptors = new Callback[] {NoOp.INSTANCE, callback};

            // create service class
            Enhancer enhancer = new Enhancer();
            enhancer.setClassLoader(classLoader);
View Full Code Here

      }
    } catch (RepositoryException e) {
      throw new org.apache.jackrabbit.ocm.exception.RepositoryException("Impossible to check,if the object exits on " + path, e);
    }

    Callback loader = new BeanLazyLoader(beanConverter, session, parentNode, beanDescriptor, beanClassDescriptor, beanClass, parent);
    return Enhancer.create(beanClass, getInterfaces(beanClass), loader);
  }
View Full Code Here

TOP

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

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.