Package org.apache.tuscany.sca.assembly

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


    /**
     * Convert a name and Java class to a reference.
     */
    static Reference reference(final String name, final Class<?> c, final JavaInterfaceFactory jif, final AssemblyFactory af) throws InvalidInterfaceException {
        final Reference r = af.createReference();
        r.setName(name);
        r.setInterfaceContract(contract(c, jif));
        return r;
    }
View Full Code Here


    /**
     * Convert a name and WSDL interface to a reference.
     */
    static Reference reference(final String name, final WSDLInterface wi, final WSDLFactory wf, final AssemblyFactory af) {
        final Reference r = af.createReference();
        r.setName(name);
        r.setInterfaceContract(contract(wi, wf));
        return r;
    }
View Full Code Here

        // Propagate interfaces from inner composite components' references to
        // their component references
        for (Component component : composite.getComponents()) {
            if (component.getImplementation() instanceof Composite) {
                for (ComponentReference componentReference : component.getReferences()) {
                    Reference reference = componentReference.getReference();
                    if (reference != null) {
                        if (componentReference.getInterfaceContract() == null) {
                            componentReference.setInterfaceContract(reference.getInterfaceContract());
                        }
                    }
                }
            }
        }
View Full Code Here

        // in this composite
        for (Component component : composite.getComponents()) {
            Implementation implementation = component.getImplementation();
            if (implementation instanceof Composite) {
                for (ComponentReference componentReference : component.getReferences()) {
                    Reference implReference = componentReference.getReference();
                    if (implReference != null && implReference instanceof CompositeReference) {
                        CompositeReference compositeReference = (CompositeReference)implReference;
                        List<ComponentReference> promotedReferences =
                            getPromotedComponentReferences(compositeReference);
                        for (ComponentReference promotedReference : promotedReferences) {
View Full Code Here

     * @return
     */
    private void collectPromotedComponentReferences(CompositeReference compositeReference,
                                                    List<ComponentReference> componentReferences) {
        for (ComponentReference componentReference : compositeReference.getPromotedReferences()) {
            Reference reference = componentReference.getReference();
            if (reference instanceof CompositeReference) {
   
                // Continue to follow the reference promotion chain
                collectPromotedComponentReferences((CompositeReference)reference, componentReferences);
   
View Full Code Here

                    //throw new RuntimeException(e);
                }
            }
       
            for (ComponentReference componentReference : component.getReferences()) {
                Reference reference = componentReference.getReference();
                if (reference != null) {
                    // reconcile intents and policysets
                    addInheritedIntents(reference.getRequiredIntents(), componentReference.getRequiredIntents());
                    addInheritedPolicySets(reference.getPolicySets(), componentReference.getPolicySets(), true);
                }
               
                if ( componentReference.getCallback() != null ) {
                    addInheritedIntents(componentReference.getRequiredIntents(),
                                        componentReference.getCallback().getRequiredIntents());
View Full Code Here

            while(scanner.hasNextLine()) {
                String line = scanner.nextLine();
                if(line.contains(WEB_REFERENCE_ANNOTATION)) {
                    //process the next line, as it has the reference info
                    if(scanner.hasNextLine()) {
                        Reference reference = processReferenceScript(scanner.nextLine());
                        if(reference != null){
                            references.add(reference);
                        }
                       
                    }
View Full Code Here

     *   
     * @param scriptContent
     * @return
     */
    private Reference processReferenceScript(String scriptContent) {
        Reference reference = null;
        String referenceName = null;
       
        String tokens[] = scriptContent.split("=");
        tokens = tokens[0].split(" ");
        referenceName = tokens[tokens.length -1];
       
        if(referenceName != null) {
            reference = assemblyFactory.createReference();
            reference.setName(referenceName);           
        }
       
        return reference;
    }
View Full Code Here

                boolean[] isOSGiToOSGiWire = new boolean[refPlusServices];
                boolean[] wireResolved = new boolean[refPlusServices];
                int index = 0;
                for (RuntimeWire wire : referenceWires.keySet()) {
               
                    Reference reference = referenceWires.get(wire);
                   
                    isOSGiToOSGiWire[index] = wire.getTarget().getComponent() != null &&
                            wire.getTarget().getComponent().getImplementationProvider()
                            instanceof OSGiImplementationProvider;
                           
                    Interface refInterface = reference.getInterfaceContract().getInterface();
                    if (refInterface instanceof JavaInterface) {
                        interfaceClasses[index] = ((JavaInterface)refInterface).getJavaClass();
                   
                        if (!isOSGiToOSGiWire[index])
                            resolveWireCreateDummyBundles(interfaceClasses[index]);
View Full Code Here

                                         Binding serviceBinding) {
        RuntimeComponentReference runtimeRef = (RuntimeComponentReference)reference;
        InterfaceContract bindingContract = getInterfaceContract(reference, refBinding);

        // Use the interface contract of the reference on the component type
        Reference componentTypeRef = reference.getReference();
        InterfaceContract sourceContract =
            componentTypeRef == null ? reference.getInterfaceContract() : componentTypeRef.getInterfaceContract();
        sourceContract = sourceContract.makeUnidirectional(false);

        EndpointReference wireSource =
            new EndpointReferenceImpl((RuntimeComponent)refComponent, reference, refBinding, sourceContract);
        ComponentService callbackService = reference.getCallbackService();
View Full Code Here

TOP

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

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.