Examples of ComponentReference


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

     * @return true if the invocation is for the callback of a bidirectional service, false otherwise
     */
    private boolean isInvocationForCallback( Message msg ) {
      org.apache.tuscany.sca.assembly.EndpointReference fromEPR = msg.getFrom();
      if( fromEPR != null ) {
        ComponentReference ref = fromEPR.getReference();
        if( ref != null ) return ref.isForCallback();
      } // end if
      return false;
    } // end method isInvocationForCallback
View Full Code Here

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

        // create the wire
        // null endpoint passed in here as the endpoint reference may
        // not be resolved yet
        epr.bind(compositeContext);

        ComponentReference reference = epr.getReference();
        InterfaceContract sourceContract = epr.getComponentTypeReferenceInterfaceContract();

        // TODO - EPR - interface contract seems to be null in the implementation.web
        //              case. Not introspecting the CT properly?
        if (sourceContract == null){
            // TODO - Can't do this with move of matching to wire
            // take the contract from the service to which the reference is connected
            sourceContract = ((RuntimeEndpoint) epr.getTargetEndpoint()).getComponentTypeServiceInterfaceContract();
            reference.setInterfaceContract(sourceContract);
        }

        // endpointReference.setInterfaceContract(sourceContract.makeUnidirectional(false));
       
        // if the reference already has a binding we can check the reference binding interface
View Full Code Here

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

    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());
        componentReference.getTargets().add(service);
        componentReference.getPolicySets().addAll(service.getPolicySets());
        componentReference.getRequiredIntents().addAll(service.getRequiredIntents());
        componentReference.getBindings().add(endpoint.getBinding());

        // For the self-reference, allows pass by reference
        componentReference.setAllowsPassByReference(true);

        InterfaceContract interfaceContract = service.getInterfaceContract();
        Service componentTypeService = service.getService();
        if (componentTypeService != null && componentTypeService.getInterfaceContract() != null) {
            interfaceContract = componentTypeService.getInterfaceContract();
        }
        interfaceContract = getInterfaceContract(interfaceContract, businessInterface);
        componentReference.setInterfaceContract(interfaceContract);
        componentReference.setMultiplicity(Multiplicity.ONE_ONE);
        // component.getReferences().add(componentReference);

        // create endpoint reference
        EndpointReference endpointReference = assemblyFactory.createEndpointReference();
        endpointReference.setComponent(component);
        endpointReference.setReference(componentReference);
        endpointReference.setBinding(endpoint.getBinding());
        endpointReference.setUnresolved(false);
        endpointReference.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_READY_FOR_MATCHING);

        endpointReference.setTargetEndpoint(endpoint);

        componentReference.getEndpointReferences().add(endpointReference);
        ((RuntimeComponentReference)componentReference).setComponent((RuntimeComponent)component);
        ((RuntimeEndpointReference)endpointReference).bind(compositeContext);

        return endpointReference;
    }
View Full Code Here

Examples of org.apache.uima.ruta.ide.parser.ast.ComponentReference

        result.add(s);
      }
    } else if (s instanceof ComponentDeclaration && node instanceof ComponentDeclaration) {

    } else if (s instanceof ComponentReference && node instanceof ComponentReference) {
      ComponentReference cr1 = (ComponentReference) node;
      ComponentReference cr2 = (ComponentReference) s;
      if (cr1.getName().equals(cr2.getName())) {
        result.add(s);
      }
    } else if (s instanceof RutaAction && node instanceof RutaAction) {
      RutaAction a1 = (RutaAction) node;
      RutaAction a2 = (RutaAction) s;
View Full Code Here

Examples of org.switchyard.admin.ComponentReference

       
        // Components
        List<ComponentService> compSvcs = new ArrayList<ComponentService>();
        List<ComponentReference> compRefs = new ArrayList<ComponentReference>();
        ComponentService compSvc = mock(ComponentService.class);
        ComponentReference compRef = mock(ComponentReference.class);
        when(compSvc.getName()).thenReturn(TEST_COMPONENT_SERVICE);
        when(compRef.getName()).thenReturn(TEST_COMPONENT_REFERENCE);
        compSvcs.add(compSvc);
        compRefs.add(compRef);
        when(app.getComponentServices()).thenReturn(compSvcs);
        when(compSvc.getReferences()).thenReturn(compRefs);
       
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.