Package org.apache.tuscany.sca.assembly

Examples of org.apache.tuscany.sca.assembly.Component


        }

        // Write <service> elements
        for (Service service : composite.getServices()) {
            CompositeService compositeService = (CompositeService)service;
            Component promotedComponent = compositeService.getPromotedComponent();
            ComponentService promotedService = compositeService.getPromotedService();
            String promote;
            if (promotedService != null) {
                if (promotedService.getName() != null) {
                    promote = promotedComponent.getName() + '/' + promotedService.getName();
                } else {
                    promote = promotedComponent.getName();
                }
            } else {
                promote = null;
            }
            writeStart(writer,
View Full Code Here


            }

            // Add model resolver to promoted components
            for (Service service : composite.getServices()) {
                CompositeService compositeService = (CompositeService)service;
                Component promotedComponent = compositeService.getPromotedComponent();
                if (promotedComponent instanceof ResolverExtension) {
                    ((ResolverExtension)promotedComponent).setModelResolver(resolver);
                }
            } // end for
View Full Code Here

            reader.nextTag();
        }
        Object model = extensionProcessor.read(reader, context);
        if (model instanceof Composite) {
            Composite composite = (Composite)model;
            Component component = composite.getComponents().get(0);
            ComponentService service = component.getServices().get(0);
            Binding binding = service.getBindings().get(0);
            endpoint.setComponent(component);
            endpoint.setService(service);
            endpoint.setBinding(binding);
        }
View Full Code Here

        try {
            Composite composite = assemblyFactory.createComposite();
            composite.setName(ENDPOINT_QNAME);
            composite.setLocal(false);
            if (endpoint.getComponent() != null) {
                Component component = (Component)endpoint.getComponent().clone();
                component.setImplementation(null);
                composite.getComponents().add(component);
                component.getReferences().clear();
                component.getServices().clear();
                if (endpoint.getService() != null) {
                    ComponentService service = (ComponentService)endpoint.getService().clone();
                    component.getServices().add(service);
                    service.getBindings().clear();
                    service.setInterfaceContract(endpoint.getComponentServiceInterfaceContract());
                    if (endpoint.getBinding() != null) {
                        Binding binding = (Binding)endpoint.getBinding().clone();
                        service.getBindings().add(binding);
View Full Code Here

            }
        }
    }

    private RuntimeEndpointReference createEndpointReference(JavaInterfaceFactory javaInterfaceFactory, CompositeContext compositeContext, AssemblyFactory assemblyFactory, Endpoint endpoint, Class<?> businessInterface) throws CloneNotSupportedException, InvalidInterfaceException {
        Component component = endpoint.getComponent();
        ComponentService service = endpoint.getService();
        ComponentReference componentReference = assemblyFactory.createComponentReference();
        componentReference.setName("sca.client." + service.getName());

        componentReference.setCallback(service.getCallback());
View Full Code Here

                serviceName = null;
            }
        }

        // Lookup the component
        Component component = null;

        for (Component compositeComponent : domainComposite.getComponents()) {
            if (componentName == null) {
                for (ComponentService service : compositeComponent.getServices()) {
                    Interface intf = service.getInterfaceContract().getInterface();
View Full Code Here

            return endpoint.getURI();
        } else if (subject instanceof EndpointReference) {
            EndpointReference endpointReference = (EndpointReference)subject;
            return endpointReference.getURI();
        } else if (subject instanceof Component) {
            Component component = (Component)subject;
            return component.getURI();
        }
        return null;
    }
View Full Code Here

    private void verifyUnknownImplComposite(Composite composite) {

      assertEquals("aaaa", composite.getName().getLocalPart());
      assertEquals(1, composite.getComponents().size());
      Component component = composite.getComponents().get(0);
      assertEquals("unknownImpl", component.getName());
      assertEquals(1, component.getServices().size());
      assertEquals("service", component.getServices().get(0).getName());
      assertEquals(1, component.getExtensions().size());
      Extension ext = (Extension) component.getExtensions().get(0);
      assertEquals("http://docs.oasis-open.org/ns/opencsa/sca/200912", ext.getQName().getNamespaceURI());
      assertEquals("implementation.unknown", ext.getQName().getLocalPart());
   
  }
View Full Code Here

        return createEndpointReference(endpoint, businessInterface);
    }

    private EndpointReference createEndpointReference(Endpoint endpoint, Class<?> businessInterface)
        throws CloneNotSupportedException, InvalidInterfaceException {
        Component component = endpoint.getComponent();
        ComponentService service = endpoint.getService();
        ComponentReference componentReference = assemblyFactory.createComponentReference();
        componentReference.setName("$self$." + service.getName());

        componentReference.setCallback(service.getCallback());
View Full Code Here

        this.compositeActivator = CompositeContext.getCurrentCompositeActivator();

        // Get the target Component and Service from the URI
        final String uri = in.readUTF();
        final Component targetComponent = super.resolveComponentURI(uri);
        final ComponentService targetService = super.resolveServiceURI(uri, targetComponent);
        final InterfaceContract targetServiceIfaceContract = targetService.getInterfaceContract();

        // Re-create the resolved Endpoint
        this.resolvedEndpoint = new EndpointReferenceImpl(
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.assembly.Component

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.