org.apache.camel.spring.Main类的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(182)

本文整理了Java中org.apache.camel.spring.Main类的一些代码示例,展示了Main类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Main类的具体详情如下:
包路径:org.apache.camel.spring.Main
类名称:Main

Main介绍

[英]A command line tool for booting up a CamelContext using an optional Spring org.springframework.context.ApplicationContext.

By placing a file in the #LOCATION_PROPERTIES directory of any JARs on the classpath, allows this Main class to load those additional Spring XML files as Spring org.springframework.context.ApplicationContext to be included.

Each line in the #LOCATION_PROPERTIES is a reference to a Spring XML file to include, which by default gets loaded from classpath.
[中]一个命令行工具,用于使用可选的Spring组织启动CamelContext。springframework。上下文应用程序上下文。
通过在类路径上任何JAR的#LOCATION_PROPERTIES目录中放置一个文件,允许这个主类将这些额外的Spring XML文件作为Spring org加载。springframework。上下文要包括的应用程序上下文。
#LOCATION_属性中的每一行都是对要包含的Spring XML文件的引用,默认情况下,该文件从类路径加载。

代码示例

代码示例来源:origin: org.apache.camel/camel-spring

public static void main(String... args) throws Exception {
  Main main = new Main();
  instance = main;
  main.run(args);
}

代码示例来源:origin: org.apache.camel/camel-spring

protected void doProcess(String arg, String parameter, LinkedList<String> remainingArgs) {
    setApplicationContextUri(parameter);
  }
});

代码示例来源:origin: camelinaction/camelinaction2

public static void main(String[] args) throws Exception {
  Main main = new Main();
  main.setApplicationContextUri("static-route-embedded.xml");
  main.run();
}

代码示例来源:origin: org.apache.camel/camel-example-loan-broker

public static void main(String... args) throws Exception {
  // create a new main which will boot the Spring XML file
  Main main = new Main();
  main.setApplicationContext(new ClassPathXmlApplicationContext("META-INF/spring/webServiceCamelContext.xml"));
  main.run();
}

代码示例来源:origin: camelinaction/camelinaction

public static void main(String[] args) throws Exception {
  // use the Main class from camel-spring
  Main main = new Main();
  // to load Spring XML file
  main.setApplicationContextUri("META-INF/spring/camel-context.xml");
  // and enable hangup support which means we can stop nicely when ctrl+c is pressed
  main.enableHangupSupport();
  // and start (will wait until you stop with ctrl + c)
  main.start();
  // echo to console how you can stop
  System.out.println("\n\nApplication has now been started. You can press ctrl + c to stop.\n\n");
}

代码示例来源:origin: stackoverflow.com

public class Main {

  public static void main(String[] args) throws Exception {
    org.apache.camel.spring.Main camelMain = new org.apache.camel.spring.Main();
    camelMain.setApplicationContextUri("application-context.xml");
    camelMain.run();
  }

}

代码示例来源:origin: camelinaction/camelinaction2

/**
 * A main() so we can easily run these routing rules in our IDE
 */
public static void main(String... args) throws Exception {
  Main.main(args);
}

代码示例来源:origin: camelinaction/camelinaction2

public static void main(String[] args) throws Exception {
  Main main = new Main();
  main.setApplicationContextUri("static-route-global.xml");
  main.run();
}

代码示例来源:origin: stackoverflow.com

org.apache.camel.spring.Main main = new Main();
main.setApplicationContextUri("camel-context.xml");
main.start();
Thread.sleep(1000);

代码示例来源:origin: camelinaction/camelinaction2

/**
 * A main() so we can easily run these routing rules in our IDE
 */
public static void main(String... args) throws Exception {
  Main.main(args);
}

代码示例来源:origin: camelinaction/camelinaction2

public static void main(String[] args) throws Exception {
    main = new Main();
    // load ActiveMQ and Camel from Spring XML files
    main.setApplicationContextUri("broker.xml;camel.xml");
    main.run();
  }
}

代码示例来源:origin: org.apache.camel/camel-example-spring

/**
 * Allow this route to be run as an application
 */
public static void main(String[] args) throws Exception {
  new Main().run(args);
}

代码示例来源:origin: camelinaction/camelinaction

/**
 * A main() so we can easily run these routing rules in our IDE
 */
public static void main(String... args) throws Exception {
  Main.main(args);
}

代码示例来源:origin: camelinaction/camelinaction2

public static void main(String[] args) throws Exception {
    main = new Main();
    // load ActiveMQ and Camel from Spring XML files
    main.setApplicationContextUri("broker.xml;camel.xml");
    main.run();
  }
}

代码示例来源:origin: org.apache.camel/camel-example-osgi

/**
 * Allow this route to be run as an application
 */
public static void main(String[] args) throws Exception {
  new Main().run(args);
}

代码示例来源:origin: camelinaction/camelinaction

/**
 * A main() so we can easily run these routing rules in our IDE
 */
public static void main(String... args) throws Exception {
  Main.main(args);
}

代码示例来源:origin: camelinaction/camelinaction2

public static void main(String[] args) throws Exception {
  Main main = new Main();
  // the Camel application is configured in XML DSL in this file
  main.setApplicationContextUri("mycamel.xml");
  main.run();
}

代码示例来源:origin: apache/servicemix

/**
 * Allow this route to be run as an application
 *
 * @param args
 */
public static void main(String[] args) throws Exception{
  new Main().run(args);
}

代码示例来源:origin: org.apache.camel/camel-example-bam

public static void main(String[] args) throws Exception {
    org.apache.camel.spring.Main.main(args);
  }
}

代码示例来源:origin: camelinaction/camelinaction2

public static void main(String[] args) throws Exception {
  Main main = new Main();
  main.setApplicationContextUri("camelinaction/rest/restOnCompletion.xml");
  System.out.println("=======================================================");
  System.out.println("Starting HTTP server on port 8080");
  System.out.println("Hit url http://localhost:8080/service/order/123");
  System.out.println("... and press CTRL + C to exit");
  System.out.println("=======================================================");
  main.run();
}

相关文章