Package archmapper.main.model.archmapping

Examples of archmapper.main.model.archmapping.PortMapping


   
    Object usesPort = getAnnotationValue(binding, UsesPort.class);
    Object exposedByPort = getAnnotationValue(binding, ExposedByPort.class);
   
    if (usesPort != null) {
      PortMapping portMapping = getOrCreatePortMapping(compMapping, (String) usesPort);
      if (portMapping != null) {
        if (!portMapping.getUsingClass().contains(implDef)) {
          portMapping.getUsingClass().add(implDef);
        }
      }
    }
    if (exposedByPort != null) {
      PortMapping portMapping = getOrCreatePortMapping(compMapping, (String) exposedByPort);
      if (portMapping != null) {
        if (!portMapping.getExposedClass().contains(implDef)) {
          portMapping.getExposedClass().add(implDef);
        }
      }
    }
  }
View Full Code Here


   * @param compMapping
   * @param portName
   * @return
   */
  public PortMapping getOrCreatePortMapping(ComponentMapping compMapping, String portName) {
    PortMapping portMapping = compMapping.getPortMapping(portName);
    if (portMapping == null) {
      // look if this port exists in the component
      Component comp = arch.getComponentByName(compMapping.getComponentName());
      if (comp != null) {
        if (comp.getPortByName(portName) != null) {
          // ok, the port exists. We can create a new PortMapping
          portMapping = new PortMapping();
          portMapping.setPortName(portName);
          portMapping.setParent(compMapping);
          compMapping.getPortMapping().add(portMapping);
        }
      }
    }
   
View Full Code Here

    compMapping.getFileDefinition().add(fileDef);
    fileDef.setFilename("file1");
    fileDef.setType("filetype1");
   
    // create a port mapping
    PortMapping portMapping = new PortMapping();
    compMapping.getPortMapping().add(portMapping);
    portMapping.setParent(compMapping);
    portMapping.setPortName("p");
    portMapping.getExposedClass().add(classDef);
    portMapping.getUsingClass().add(classDef);
   
    // Mapping for component2
    ComponentMapping comp2Mapping = new ComponentMapping();
    comp2Mapping.setComponentName("Comp2");
    archMapping.getComponentMapping().add(comp2Mapping);
View Full Code Here

  @Test
  public void testCommunicationIntegrityTests() {
    loadFiles();
   
    ComponentMapping comp1Mapping = archMapping.getComponentMapping("Comp1");
    PortMapping pMapping = comp1Mapping.getPortMapping("p");
    Component comp1 = architecture.getComponentByName("Comp1");
    Port p = comp1.getPortByName("p");
   
    assertTrue(mappingHelper.isClassExposedByPort(comp1Mapping.getInterfaceDefinition().get(0),
        p, pMapping));
View Full Code Here

          List<ComponentToComponentConnection> connections = comp.getConnectionsOverPort(RoleDirection.out, port);
         
          for (ComponentToComponentConnection connection : connections) {
            ComponentMapping remoteComp = archMapping.getComponentMapping(connection.getTargetComponent().getName());
            if (remoteComp != null) {
              PortMapping remotePortMapping = remoteComp.getPortMapping(connection.getTargetPort().getName());
             
              for (ClassDefinition remoteClass : remoteComp.getClassDefinition()) {
                if (mappingHelper.isClassExposedByPort(classDef, connection.getTargetPort(), remotePortMapping) &&
                    mappingHelper.isClassSingleton(remoteClass)) {
                  // we could need an attribute for this class...
View Full Code Here

TOP

Related Classes of archmapper.main.model.archmapping.PortMapping

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.