Examples of JDKProxyFactory


Examples of com.github.overengineer.container.proxy.JdkProxyFactory

        this.invocationFactory = invocationFactory;
    }

    @Override
    public <T> ComponentProxyHandler<T> createProxy(Class<?> targetClass) {
        JdkProxyFactory proxyFactory = proxyFactories.get(targetClass);
        if (proxyFactory == null) {
            proxyFactory = new DefaultJdkProxyFactory(targetClass);
            proxyFactories.put(targetClass, proxyFactory);
        }
        return new JdkAopProxyHandler<T>(proxyFactory, invocationFactory);
View Full Code Here

Examples of org.apache.tuscany.sca.core.invocation.JDKProxyFactory

                                     wire.getTarget().getContract().getName();
            targetProperties.put(COMPONENT_SERVICE_NAME, compServiceName);
        }
       
          
        JDKProxyFactory proxyService = new JDKProxyFactory();
             
        Class<?> proxyInterface = bundle.loadClass(interfaceClass.getName());
               

        Object proxy = proxyService.createProxy(proxyInterface, wire);
      
           
        bundleContext.registerService(proxyInterface.getName(), proxy, targetProperties);
           
       
View Full Code Here

Examples of org.apache.tuscany.sca.core.invocation.JDKProxyFactory

        List<RuntimeWire> wires = service.getCallbackWires();
        Hashtable<String, Object> targetProperties = new Hashtable<String, Object>();
        processProperties(implementation.getServiceCallbackProperties(service.getName()), targetProperties);
        targetProperties.put(Constants.SERVICE_RANKING, Integer.MAX_VALUE);
         
        JDKProxyFactory proxyService = new JDKProxyFactory();
             
        Class<?> proxyInterface = bundle.loadClass(interfaceClass.getName());
               

        Object proxy = proxyService.createCallbackProxy(proxyInterface, wires);
      
           
        bundleContext.registerService(proxyInterface.getName(), proxy, targetProperties);
           
       
View Full Code Here

Examples of org.apache.tuscany.sca.core.invocation.JDKProxyFactory

        // Determine the service business interface
        Class<?> serviceInterface = getTargetJavaClass(serviceContract.getInterface());

        // Create a Java proxy to the target service
        ProxyFactory proxyFactory = new JDKProxyFactory();
        Object proxy = proxyFactory.createProxy(serviceInterface, service.getRuntimeWire(binding));

        // Create and register a servlet for this service
        JSONRPCServiceServlet serviceServlet =
            new JSONRPCServiceServlet(binding, componentService, serviceContract, serviceInterface, proxy);
        String mapping = binding.getURI();
View Full Code Here

Examples of org.apache.tuscany.sca.core.invocation.JDKProxyFactory

                                     wire.getTarget().getContract().getName();
            targetProperties.put(COMPONENT_SERVICE_NAME, compServiceName);
        }
       
          
        JDKProxyFactory proxyService = new JDKProxyFactory();
             
        Class<?> proxyInterface = bundle.loadClass(interfaceClass.getName());
               

        Object proxy = proxyService.createProxy(proxyInterface, wire);
      
           
        bundleContext.registerService(proxyInterface.getName(), proxy, targetProperties);
           
       
View Full Code Here

Examples of org.apache.tuscany.sca.core.invocation.JDKProxyFactory

        List<RuntimeWire> wires = service.getCallbackWires();
        Hashtable<String, Object> targetProperties = new Hashtable<String, Object>();
        processProperties(implementation.getServiceCallbackProperties(service.getName()), targetProperties);
        targetProperties.put(Constants.SERVICE_RANKING, Integer.MAX_VALUE);
         
        JDKProxyFactory proxyService = new JDKProxyFactory();
             
        Class<?> proxyInterface = bundle.loadClass(interfaceClass.getName());
               

        Object proxy = proxyService.createCallbackProxy(proxyInterface, wires);
      
           
        bundleContext.registerService(proxyInterface.getName(), proxy, targetProperties);
           
       
View Full Code Here

Examples of org.apache.tuscany.sca.core.invocation.JDKProxyFactory

                                     wire.getTarget().getContract().getName();
            targetProperties.put(COMPONENT_SERVICE_NAME, compServiceName);
        }


        JDKProxyFactory proxyService = new JDKProxyFactory(messageFactory, mapper);

        // Allow privileged access to load classes. Requires getClassLoader permission in security
        // policy.
        final Class<?> proxyInterface = AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
            public Class<?> run() throws Exception {
                return bundle.loadClass(interfaceClass.getName());
            }
        });

        final Object proxy = proxyService.createProxy(proxyInterface, wire);
        final Hashtable<String, Object> finalTargetProperties = targetProperties;
        AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
            public Object run() throws Exception {
                bundleContext.registerService(proxyInterface.getName(), proxy, finalTargetProperties);
                return null;
View Full Code Here

Examples of org.apache.tuscany.sca.core.invocation.JDKProxyFactory

                                     wire.getTarget().getContract().getName();
            targetProperties.put(COMPONENT_SERVICE_NAME, compServiceName);
        }


        JDKProxyFactory proxyService = new JDKProxyFactory(messageFactory, mapper);

        // Allow privileged access to load classes. Requires getClassLoader permission in security
        // policy.
        final Class<?> proxyInterface = AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
            public Class<?> run() throws Exception {
                return bundle.loadClass(interfaceClass.getName());
            }
        });

        final Object proxy = proxyService.createProxy(proxyInterface, wire);
        final Hashtable<String, Object> finalTargetProperties = targetProperties;
        AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
            public Object run() throws Exception {
                bundleContext.registerService(proxyInterface.getName(), proxy, finalTargetProperties);
                return null;
View Full Code Here

Examples of org.apache.tuscany.sca.core.invocation.JDKProxyFactory

                                     wire.getTarget().getContract().getName();
            targetProperties.put(COMPONENT_SERVICE_NAME, compServiceName);
        }
       
          
        JDKProxyFactory proxyService = new JDKProxyFactory(messageFactory, mapper);

        // Allow privileged access to load classes. Requires getClassLoader permission in security
        // policy.
        final Class<?> proxyInterface = AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
            public Class<?> run() throws Exception {
                return bundle.loadClass(interfaceClass.getName());
            }
        });

        final Object proxy = proxyService.createProxy(proxyInterface, wire);
        final Hashtable<String, Object> finalTargetProperties = targetProperties;
        AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
            public Object run() throws Exception {
                bundleContext.registerService(proxyInterface.getName(), proxy, finalTargetProperties);
                return null;
View Full Code Here

Examples of org.apache.tuscany.sca.core.invocation.JDKProxyFactory

        }
       
        Class<?> type = ((JavaInterface)rcs.getInterfaceContract().getInterface()).getJavaClass();

        // Create a Java proxy to the target service
        ProxyFactory proxyFactory = new JDKProxyFactory();
        Object proxy = proxyFactory.createProxy(type, rcs.getRuntimeWire(binding));

        servlet.addService(binding.getName(), type, proxy);

        servletHost.addServletMapping(SERVLET_PATH, servlet);
    }
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.