Examples of Multiplicity


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> TuscanyServiceReference<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

        List<ComponentService> refTargets = getReferenceTargets(reference);
        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 || multiplicity == Multiplicity.ONE_ONE) && (reference
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

            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

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

       
        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

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

      if (reference.getAutowire() == Boolean.TRUE &&
            reference.getTargets().isEmpty()) {

            // Find suitable targets in the current composite for an
            // autowired reference
            Multiplicity multiplicity = reference.getMultiplicity();
            for (Component targetComponent : composite.getComponents()) {

                // Prevent autowire connecting to self
              if( targetComponent == component ) continue;
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.