Examples of Multiplicity


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

      EndpointrefInfo refInfo = gatherEndpointrefInfo( component, reference, null );

      List<Endpoint> endpoints = getReferenceEndpoints( composite, component,
                                                       reference, components, componentServices );

      Multiplicity multiplicity = reference.getMultiplicity();
        if (multiplicity == Multiplicity.ONE_N || multiplicity == Multiplicity.ONE_ONE) {
          // If there are no endpoints defined and also no endpoint references already present
          // then this reference is unwired, which is an error - the existing endpoint references
          // will have been attached to a nested reference when a promoting reference has its endpoint
          // references computed
View Full Code Here

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

            ComponentReference reference, Map<String, Component> components,
                Map<String, ComponentService> componentServices, List<Endpoint> endpoints ) {
      // Get compatible target services if @autowire=true is specified
      if ( reference.getAutowire() == Boolean.TRUE ) {

            Multiplicity multiplicity = reference.getMultiplicity();
            for (Component targetComponent : composite.getComponents()) {

                // Prevent autowire connecting to self
              if( targetComponent == component ) continue;
View Full Code Here

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

            }
        } else if (componentReference.getAutowire() == Boolean.TRUE) {

            // Find suitable targets in the current composite for an
            // autowired reference
            Multiplicity multiplicity = componentReference.getMultiplicity();
            for (Component targetComponent : composite.getComponents()) {
                // prevent autowire connecting to self
                boolean skipSelf = false;
                for (ComponentReference targetComponentReference : targetComponent.getReferences()) {
                    if (componentReference == targetComponentReference){
View Full Code Here

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

            reference.setMultiplicity(Multiplicity.ONE_ONE);
        }
    }
   
    protected XAttr writeMultiplicity(AbstractReference reference) {
        Multiplicity multiplicity = reference.getMultiplicity();
        if (multiplicity != null) {
            String value = null;
            if (Multiplicity.ZERO_ONE.equals(multiplicity)) {
                value = ZERO_ONE;
            } else if (Multiplicity.ONE_N.equals(multiplicity)) {
View Full Code Here

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

    public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String referenceName) {
        try {
            for (ComponentReference ref : component.getReferences()) {
                if (referenceName.equals(ref.getName())) {
                    /* ******************** Contribution for issue TUSCANY-2281 ******************** */
                    Multiplicity multiplicity = ref.getMultiplicity();
                    if( multiplicity == Multiplicity.ZERO_N || multiplicity == Multiplicity.ONE_N)
                    {
                      throw new IllegalArgumentException("Reference " + referenceName + " has multiplicity " + multiplicity);
                    }
                    /* ******************** Contribution for issue TUSCANY-2281 ******************** */
 
View Full Code Here

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

            // This autowire processing really needs to move to the matching
            // algorithm but dependency problems means it has to stay here for now
            if (Boolean.TRUE.equals(reference.getAutowire()) && reference.getTargets().isEmpty()) {
                // Find suitable targets in the current composite for an
                // autowired reference
                Multiplicity multiplicity = reference.getMultiplicity();
                for (Component targetComponent : composite.getComponents()) {
   
                    // Tuscany specific selection of the first autowire reference
                    // when there are more than one (ASM_60025)
                    if ((multiplicity == Multiplicity.ZERO_ONE ||
View Full Code Here

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

            reference.setMultiplicity(Multiplicity.ONE_ONE);
        }
    }

    protected XAttr writeMultiplicity(AbstractReference reference) {
        Multiplicity multiplicity = reference.getMultiplicity();
        if (multiplicity != null) {
            String value = null;
            if (Multiplicity.ZERO_ONE.equals(multiplicity)) {
                value = ZERO_ONE;
            } else if (Multiplicity.ONE_N.equals(multiplicity)) {
View Full Code Here

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

        // as problems with dependencies mean we still do this during build
        if (endpointReference.getStatus() == EndpointReference.Status.AUTOWIRE_PLACEHOLDER){
          
            // do autowire matching
            // will only be called at build time at the moment
            Multiplicity multiplicity = endpointReference.getReference().getMultiplicity();
            for (Endpoint endpoint : endpointRegistry.getEndpoints()){
//              if (endpoint is in the same composite as endpoint reference){
                    if ((multiplicity == Multiplicity.ZERO_ONE ||
                         multiplicity == Multiplicity.ONE_ONE) &&
                        (endpointReference.getReference().getEndpointReferences().size() > 1)) {
View Full Code Here

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

    public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String referenceName) throws IllegalArgumentException {

        for (ComponentReference ref : component.getReferences()) {
            if (referenceName.equals(ref.getName())) {
                Multiplicity multiplicity = ref.getMultiplicity();
                if (multiplicity == Multiplicity.ZERO_N || multiplicity == Multiplicity.ONE_N) {
                    throw new IllegalArgumentException("Reference " + referenceName
                        + " has multiplicity "
                        + multiplicity);
                }
View Full Code Here

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

            if (componentReference.isAutowire()) {

                // Find suitable targets in the current composite for an
                // autowired reference
                Multiplicity multiplicity = componentReference.getMultiplicity();
                for (Component component : composite.getComponents()) {
                    for (ComponentService componentService : component.getServices()) {
                        if (componentReference.getInterfaceContract() == null || interfaceContractMapper
                                .isCompatible(componentReference.getInterfaceContract(), componentService
                                    .getInterfaceContract())) {
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.