Package org.apache.tuscany.sca.core.assembly

Examples of org.apache.tuscany.sca.core.assembly.RuntimeAssemblyFactory


        utilities.getUtility(RuntimeProperties.class).setProperties(properties);
        quietLogging = Boolean.parseBoolean(properties.getProperty(RuntimeProperties.QUIET_LOGGING));
       
        // Use the runtime-enabled assembly factory
        FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
        AssemblyFactory assemblyFactory = new RuntimeAssemblyFactory(registry);
        modelFactories.addFactory(assemblyFactory);

        // Load the Deployer
        deployer = utilities.getUtility(Deployer.class);
View Full Code Here


    if( callbackAddress == null ) return null;
   
    // Get the necessary factories
    ExtensionPointRegistry registry = endpointReference.getCompositeContext().getExtensionPointRegistry();
        FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
        RuntimeAssemblyFactory assemblyFactory = (RuntimeAssemblyFactory)modelFactories.getFactory(AssemblyFactory.class);
        WebServiceBindingFactory webServiceBindingFactory = (WebServiceBindingFactory)modelFactories.getFactory(WebServiceBindingFactory.class);
   
        // Create the endpoint
        RuntimeEndpoint callbackEndpoint = (RuntimeEndpoint)assemblyFactory.createEndpoint();
        // Add a binding
        WebServiceBinding cbBinding = webServiceBindingFactory.createWebServiceBinding();
        cbBinding.setURI(callbackAddress);
        callbackEndpoint.setBinding(cbBinding);
        // Embed the response Address URI
View Full Code Here

     * @param endpoint - the endpoint which has the async server operations
     * @return the EndpointReference object representing the callback
     */
    private RuntimeEndpointReference createAsyncEPR( RuntimeEndpoint endpoint ){
      CompositeContext compositeContext = endpoint.getCompositeContext();
      RuntimeAssemblyFactory assemblyFactory = getAssemblyFactory( compositeContext );
        RuntimeEndpointReference epr = (RuntimeEndpointReference)assemblyFactory.createEndpointReference();
        epr.bind( compositeContext );
       
        // Create pseudo-component
        epr.setComponent(component);
       
        // Create pseudo-reference
        ComponentReference reference = assemblyFactory.createComponentReference();
        ExtensionPointRegistry registry = compositeContext.getExtensionPointRegistry();
        FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
        JavaInterfaceFactory javaInterfaceFactory = (JavaInterfaceFactory)modelFactories.getFactory(JavaInterfaceFactory.class);
        JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
        try {
      interfaceContract.setInterface(javaInterfaceFactory.createJavaInterface(AsyncResponseService.class));
    } catch (InvalidInterfaceException e1) {
      // Nothing to do here - will not happen
    } // end try
    reference.setInterfaceContract(interfaceContract);
        String referenceName = endpoint.getService().getName() + "_asyncCallback";
        reference.setName(referenceName);
        reference.setForCallback(true);
        // Add in "implementation" reference (really a dummy, but with correct interface)
        Reference implReference = assemblyFactory.createReference();
        implReference.setInterfaceContract(interfaceContract);
        implReference.setName(referenceName);
        implReference.setForCallback(true);
       
        reference.setReference(implReference);
        // Set the created ComponentReference into the EPR
        epr.setReference(reference);
       
        // Create a binding
    Binding binding = createMatchingBinding( endpoint.getBinding(), (RuntimeComponent)endpoint.getComponent(), reference, registry );     
    epr.setBinding(binding);
   
    // Need to establish policies here (binding has some...)
    epr.getRequiredIntents().addAll( endpoint.getRequiredIntents() );
    epr.getPolicySets().addAll( endpoint.getPolicySets() );
   
    // Attach a dummy endpoint to the epr
    RuntimeEndpoint ep = (RuntimeEndpoint)assemblyFactory.createEndpoint();
    ep.setUnresolved(false);
    epr.setTargetEndpoint(ep);
    //epr.setStatus(EndpointReference.Status.RESOLVED_BINDING);
    epr.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED);
    epr.setUnresolved(false);
View Full Code Here

            schemas.setEnabled("true".equals(enabled) || debug);
        }

        // Use the runtime-enabled assembly factory
        modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
        assemblyFactory = new RuntimeAssemblyFactory();
        modelFactories.addFactory(assemblyFactory);

        // Create a monitor
        UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
View Full Code Here

        // Get proxy factory
        ProxyFactoryExtensionPoint proxyFactories = registry.getExtensionPoint(ProxyFactoryExtensionPoint.class)
        proxyFactory = new ExtensibleProxyFactory(proxyFactories);

        // Create model factories
        assemblyFactory = new RuntimeAssemblyFactory();
        factories.addFactory(assemblyFactory);
        PolicyFactory policyFactory = new DefaultPolicyFactory();
        factories.addFactory(policyFactory);
       
        // Load the runtime modules
View Full Code Here

        XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class);
        outputFactory = modelFactories.getFactory(XMLOutputFactory.class);
       
        // Get contribution workspace and assembly model factories
        assemblyFactory = new RuntimeAssemblyFactory();
        modelFactories.addFactory(assemblyFactory);
       
        // Create XML artifact processors
        StAXArtifactProcessorExtensionPoint xmlProcessorExtensions = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
        xmlProcessor = new ExtensibleStAXArtifactProcessor(xmlProcessorExtensions, inputFactory, outputFactory, monitor);
View Full Code Here

        // Create a proxy factory
        proxyFactory = ReallySmallRuntimeBuilder.createProxyFactory(registry, mapper, messageFactory);

        // Create model factories
        assemblyFactory = new RuntimeAssemblyFactory(mapper, proxyFactory);
        factories.addFactory(assemblyFactory);
        PolicyFactory policyFactory = new DefaultPolicyFactory();
        factories.addFactory(policyFactory);
        SCABindingFactory scaBindingFactory = factories.getFactory(SCABindingFactory.class);
        factories.addFactory(scaBindingFactory);
View Full Code Here

        XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class);
        outputFactory = modelFactories.getFactory(XMLOutputFactory.class);

        // Get contribution workspace and assembly model factories
        assemblyFactory = new RuntimeAssemblyFactory(extensionPoints);
        modelFactories.addFactory(assemblyFactory);

        // Create XML artifact processors
        StAXArtifactProcessorExtensionPoint xmlProcessorExtensions = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
        xmlProcessor = new ExtensibleStAXArtifactProcessor(xmlProcessorExtensions, inputFactory, outputFactory, monitor);
View Full Code Here

            }
        }

        // Use the runtime-enabled assembly factory
        modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
        assemblyFactory = new RuntimeAssemblyFactory(extensionPoints);
        modelFactories.addFactory(assemblyFactory);

        // Create a monitor
        UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
View Full Code Here

        // Get proxy factory
        ProxyFactoryExtensionPoint proxyFactories = registry.getExtensionPoint(ProxyFactoryExtensionPoint.class)
        proxyFactory = new ExtensibleProxyFactory(proxyFactories);

        // Create model factories
        assemblyFactory = new RuntimeAssemblyFactory();
        factories.addFactory(assemblyFactory);
        PolicyFactory policyFactory = new DefaultPolicyFactory();
        factories.addFactory(policyFactory);
       
        // Load the runtime modules
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.core.assembly.RuntimeAssemblyFactory

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.