Exemplo n.º 1
0
  public void process(Graph graph, Element currentElement, GraphNode parent) {
    if (!getEnvironment().getConfig().isShowTransformers()) {
      return;
    }

    Element transformers = currentElement.getChild(MuleTag.ELEMENT_TRANSFORMERS);
    if (transformers == null) {
      return;
    }

    List agentsElement = transformers.getChildren(MuleTag.ELEMENT_TRANSFORMER);
    for (Iterator iter = agentsElement.iterator(); iter.hasNext(); ) {
      Element connector = (Element) iter.next();
      GraphNode connectorNode = graph.addNode();
      connectorNode.getInfo().setFillColor(ColorRegistry.COLOR_TRANSFORMER);
      String name = connector.getAttributeValue(MuleTag.ATTRIBUTE_NAME);
      String returnClass = connector.getAttributeValue(MuleTag.ATTRIBUTE_RETURN_CLASS);
      connectorNode.getInfo().setHeader(name + ", return: " + returnClass);

      StringBuffer caption = new StringBuffer();

      String className = connector.getAttributeValue(MuleTag.ATTRIBUTE_CLASS_NAME);
      caption.append(MuleTag.ATTRIBUTE_CLASS_NAME + " :" + className + "\n");

      appendProperties(connector, caption);
      appendDescription(connector, caption);
      connectorNode.getInfo().setCaption(caption.toString());
    }
  }
Exemplo n.º 2
0
  public void process(Graph graph, Element currentElement, GraphNode parent) {
    if (currentElement == null) {
      System.err.println("model is null");
      return;
    }

    List descriptors = currentElement.getChildren(MuleTag.ELEMENT_MULE_DESCRIPTOR);
    for (Iterator iter = descriptors.iterator(); iter.hasNext(); ) {
      Element descriptor = (Element) iter.next();
      String name = descriptor.getAttributeValue(MuleTag.ATTRIBUTE_NAME);
      GraphNode node = graph.addNode();
      node.getInfo().setHeader(name);
      node.getInfo().setFillColor(ColorRegistry.COLOR_COMPONENT);

      StringBuffer caption = new StringBuffer();

      /*
       * caption.append("implementation :
       * "+descriptor.getAttributeValue("implementation") + "\n");
       */

      appendProfiles(descriptor, caption);
      appendProperties(descriptor, caption);
      appendDescription(descriptor, caption);

      node.getInfo().setCaption(caption.toString());

      shortestNotationHandler.process(graph, descriptor, node);

      exceptionStrategyProcessor.process(graph, descriptor, node);

      inboundRoutersProcessor.process(graph, descriptor, node);

      outBoundRoutersProcessor.process(graph, descriptor, node);

      responseRouterProcessor.process(graph, descriptor, node);
    }
  }