Examples of RouteContainer


Examples of org.fusesource.ide.camel.model.RouteContainer

  @Override
  protected void doExecute() {
    if (selectedRoute != null) {
      boolean deleteIt = MessageDialog.openQuestion(Display.getCurrent().getActiveShell(), EditorMessages.deleteRouteCommandLabel, EditorMessages.deleteRouteCommandDescription);
      if (deleteIt) {
        RouteContainer model = designEditor.getModel();
        model.removeChild(selectedRoute);
        RouteSupport newRoute = null;
        if (model.getChildren().size()<1) {
          // no more routes - create one
          designEditor.addNewRoute();
        }
        newRoute = (RouteSupport)model.getChildren().get(0);
        designEditor.clearSelectedRouteCache();
        designEditor.setSelectedRoute(newRoute);
      }
    }
  }
View Full Code Here

Examples of org.fusesource.ide.camel.model.RouteContainer

  public static Set<Endpoint> getAllEndpoints(AbstractNode node) {
    if (node != null) {
      RouteSupport route = AbstractNodes.getRoute(node);
      if (route != null) {
        Set<Endpoint> endpoints = route.getEndpoints();
        RouteContainer parent = route.getParent();
        if (parent != null) {
          Set<Endpoint> set = parent.getEndpoints();
          String[] endpointUris = parent.getEndpointUris();
          for (String uri : endpointUris) {
            if (!containsUri(set, uri)) {
              Endpoint endpoint = new Endpoint();
              endpoint.setUri(uri);
              endpoints.add(endpoint);
View Full Code Here

Examples of org.fusesource.ide.camel.model.RouteContainer

    }
  }

  protected RouteContainer toContainer(XmlModel model) {
    List<RouteDefinition> routes = model.getRouteDefinitionList();
    RouteContainer answer = new RouteContainer();
    String id = null;
    if (model.getContextElement() != null && model.getContextElement().getId() != null) {
      id = model.getContextElement().getId();
    } else {
      if (model.getNode() == null) {
        Exception e = new Exception("Unable to determine route container, no node detected.");
        Activator.getLogger().warning(e);
        throw new RuntimeException(e);
     
      
      Element e = (Element)model.getNode();
      Attribute a = e.getAttribute("id");
      if (a != null) id = a.getValue();
    }
    answer.setId(id);
    answer.addRoutes(routes);
    answer.setBeans(model.beanMap());
    answer.setCamelContextEndpointUris(model.endpointUriSet());
    answer.setModel(model);
   
    /*
     * we can't use the camelContext.getEndpointMap() approach as the endpointMap
     * is not populated until after start()
     */
 
View Full Code Here

Examples of org.fusesource.ide.camel.model.RouteContainer

  public String updateText(String xmlText, RouteContainer model) {
    return xmlText;
  }

  protected RouteContainer createDummyModel() {
    RouteContainer c = new RouteContainer();

    RouteSupport route1 = new Route();

    Endpoint ep1 = new Endpoint();
    Bean bean1 = new Bean();
    Bean bean2 = new Bean();

    ep1.setId("fileIn1");
    ep1.setDescription("Polls files from input folder...");
    ep1.setUri("file:///home/lhein/test/input/");
    ep1.setLayout(new Rectangle(10, 10, 100, 40));

    bean1.setId("procBean1");
    bean1.setDescription("Examines the file...");
    bean1.setMethod("examineFile");
    bean1.setRef("proc1");
    bean1.setLayout(new Rectangle(150, 10, 100, 40));

    bean2.setId("procBean2");
    bean2.setDescription("Examines the file...");
    bean2.setMethod("examineFile");
    bean2.setRef("proc2");
    bean2.setLayout(new Rectangle(300, 10, 100, 40));

    ep1.addTargetNode(bean1);
    bean1.addTargetNode(bean2);

    route1.addChild(bean2);
    route1.addChild(ep1);
    route1.addChild(bean1);

    c.addChild(route1);

    Activator.getLogger().debug("Stub marshaller has loaded model: "
        + c.getDebugInfo());
    return c;
  }
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.