Package org.apache.tuscany.sca.core.invocation

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


        RequestContextFactory requestContextFactory = contextFactories.getFactory(RequestContextFactory.class);

        List<PolicyHandlerTuple> policyHandlerClassNames = null;
        policyHandlerClassNames = PolicyHandlerDefinitionsLoader.loadPolicyHandlerClassnames();

        ProxyFactory proxyFactory = new ExtensibleProxyFactory(proxyFactories);

        JavaImplementationProviderFactory javaImplementationProviderFactory =
            new JavaImplementationProviderFactory(proxyFactory, dataBindings, factory, componentContextFactory,
                                                  requestContextFactory, policyHandlerClassNames);
View Full Code Here


        RequestContextFactory requestContextFactory = contextFactories.getFactory(RequestContextFactory.class);

        List<PolicyHandlerTuple> policyHandlerClassNames = null;
        policyHandlerClassNames = PolicyHandlerDefinitionsLoader.loadPolicyHandlerClassnames();

        ProxyFactory proxyFactory = new ExtensibleProxyFactory(proxyFactories);

        JavaImplementationProviderFactory javaImplementationProviderFactory =
            new JavaImplementationProviderFactory(proxyFactory, dataBindings, factory, componentContextFactory,
                                                  requestContextFactory, policyHandlerClassNames);
View Full Code Here

            reference.setInterfaceContract(interfaceContract);
            component.getReferences().add(reference);
            reference.setComponent(component);
            reference.getBindings().add(binding);
   
            ProxyFactory proxyFactory = compositeActivator.getProxyFactory();
            return new ServiceReferenceImpl<B>(businessInterface, component, reference, binding, proxyFactory, compositeActivator);
           
        } catch (Exception e) {
            throw new ServiceRuntimeException(e);
        }
View Full Code Here

                Class<?> cls =
                    RootResourceClassGenerator.generateRootResourceClass(interfaze,
                                                                         path,
                                                                         requestMediaType,
                                                                         responseMediaType);
                ProxyFactory proxyFactory = ExtensibleProxyFactory.getInstance(extensionPoints);
                Object proxy = proxyFactory.createProxy(interfaze, endpoint);
                RootResourceClassGenerator.injectProxy(cls, proxy);
                return cls;
            } catch (Exception e) {
                throw new ServiceRuntimeException(e);
            }
View Full Code Here

      RuntimeEndpointReference callbackEPR = (RuntimeEndpointReference) msg.getHeaders().get(Constants.ASYNC_CALLBACK);
      if( callbackEPR == null ) return null;
     
      CompositeContext compositeContext = callbackEPR.getCompositeContext();
        registry = compositeContext.getExtensionPointRegistry();
      ProxyFactory proxyFactory = ExtensibleProxyFactory.getInstance(registry);
      msgFactory = getMessageFactory();
      List<EndpointReference> eprList = new ArrayList<EndpointReference>();
      eprList.add(callbackEPR);
      ObjectFactory<?> factory = new CallbackReferenceObjectFactory(AsyncResponseHandler.class, proxyFactory, eprList);
     
View Full Code Here

            }

            FactoryExtensionPoint factories = extensionsRegistry.getExtensionPoint(FactoryExtensionPoint.class);
            AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class);
            JavaInterfaceFactory javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class);
            ProxyFactory proxyFactory = new ExtensibleProxyFactory(extensionsRegistry.getExtensionPoint(ProxyFactoryExtensionPoint.class));

            CompositeContext compositeContext = new CompositeContext(extensionsRegistry, domainRegistry, null, domainURI, null, null);

            EndpointFinder endpointFinder = RuntimeUtils.getEndpointFinder(extensionsRegistry);
            Endpoint endpoint = endpointFinder.findEndpoint(domainRegistry, serviceName);
            
            if (serviceInterface == null) {
                try {
                    findInterface(endpoint);
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
           
            RuntimeEndpointReference epr;
            try {
                epr = createEndpointReference(javaInterfaceFactory, compositeContext, assemblyFactory, endpoint, serviceInterface);
            } catch (Exception e) {
                throw new ServiceRuntimeException(e);
            }

            this.handler = Proxy.getInvocationHandler(proxyFactory.createProxy(serviceInterface, epr));
        }
        return handler;
    }
View Full Code Here

                try {
                    interfaceClass = bundle.loadClass(interfaceName);
                } catch (ClassNotFoundException e) {
                    return null;
                }
                ProxyFactory proxyService = proxyFactoryExtensionPoint.getInterfaceProxyFactory();
                if (!interfaceClass.isInterface()) {
                    proxyService = proxyFactoryExtensionPoint.getClassProxyFactory();
                }
                Object proxy = proxyService.createProxy(interfaceClass, epr);
                return InvocationHandlerDelegate.cast(proxy, interfaceClass);
            } catch (Throwable e) {
                throw new ServiceException(e.getMessage(), ServiceException.FACTORY_EXCEPTION, e);
            }
        }
View Full Code Here

    private static <T> T getRemoteProxy(Class<T> serviceInterface, Endpoint endpoint, DomainRegistry domainRegistry, ExtensionPointRegistry extensionPointRegistry, Deployer deployer) throws NoSuchServiceException {
        FactoryExtensionPoint factories = extensionPointRegistry.getExtensionPoint(FactoryExtensionPoint.class);
        AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class);
        JavaInterfaceFactory javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class);
        ProxyFactory proxyFactory =
            new ExtensibleProxyFactory(extensionPointRegistry.getExtensionPoint(ProxyFactoryExtensionPoint.class));

        CompositeContext compositeContext =
            new CompositeContext(extensionPointRegistry, domainRegistry, null, null, null,
                                 deployer.getSystemDefinitions());

        if (serviceInterface == null) {
            try {
                serviceInterface = (Class<T>)findInterface(endpoint, domainRegistry);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }

        RuntimeEndpointReference epr;
        try {
            epr =
                createEndpointReference(javaInterfaceFactory,
                                        compositeContext,
                                        assemblyFactory,
                                        endpoint,
                                        serviceInterface);
        } catch (Exception e) {
            throw new ServiceRuntimeException(e);
        }

        return proxyFactory.createProxy(serviceInterface, epr);
    }
View Full Code Here

       
        JavaInterfaceFactory javaInterfaceFactory = factoryExtensionPoint.getFactory(JavaInterfaceFactory.class);
        javaInterfaceFactory.removeInterfacesForContribution(contributionClassloader);
       
        ProxyFactoryExtensionPoint proxyFactoryExtensionPoint = extensionPointRegistry.getExtensionPoint(ProxyFactoryExtensionPoint.class);
        ProxyFactory interfaceProxyFactory = proxyFactoryExtensionPoint.getInterfaceProxyFactory();
        interfaceProxyFactory.removeProxiesForContribution(contributionClassloader);

        DOMHelper.getInstance(extensionPointRegistry).stop();
        java.beans.Introspector.flushCaches();

        if (contributionClassloader instanceof URLClassLoader) {
View Full Code Here

public class ReallySmallRuntimeBuilder {

    public static ProxyFactory createProxyFactory(ExtensionPointRegistry registry, InterfaceContractMapper mapper, MessageFactory messageFactory) {

        // Create a proxy factory
        ProxyFactory proxyFactory = new JDKProxyService(messageFactory, mapper);

        // FIXME remove this
        registry.addExtensionPoint(proxyFactory);
        registry.addExtensionPoint(mapper);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.core.invocation.ProxyFactory

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.