• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Main类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.camel.spring.Main的典型用法代码示例。如果您正苦于以下问题:Java Main类的具体用法?Java Main怎么用?Java Main使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Main类属于org.apache.camel.spring包,在下文中一共展示了Main类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: startCamel

import org.apache.camel.spring.Main; //导入依赖的package包/类
protected void startCamel() throws Exception {
    if (!"true".equalsIgnoreCase(System.getProperty("skipStartingCamelContext"))) {
        main = new Main();
        main.setApplicationContextUri("META-INF/spring/camel-config.xml");
        main.start();
    } else {
        System.out.println("Skipping starting CamelContext as system property skipStartingCamelContext is set to be true.");
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:10,代码来源:ReportIncidentRoutesTest.java


示例2: boot

import org.apache.camel.spring.Main; //导入依赖的package包/类
protected void boot() throws Exception
{
    // create a Main instance
    main = new Main();

    // enable hangup support so you can press ctrl + c to terminate the JVM
    main.enableHangupSupport();

    // Get spring definition of the routes to start
    String uri = System.getProperty("boundary.application.context.uri");
    LOG.info("Loading application context from: " + uri);

    // Set the application context that configures the camel routes
    main.setApplicationContextUri(uri);

    // run until you terminate the JVM
    LOG.info("Starting Web Hook");
    main.run();
}
 
开发者ID:boundary,项目名称:boundary-action-handler,代码行数:20,代码来源:ActionWebhookApplication.java


示例3: boot

import org.apache.camel.spring.Main; //导入依赖的package包/类
/**
 * Starts a camel application context
 * 
 * @throws Exception Upon any error
 */
protected void boot() throws Exception
{
    // create a Main instance
    main = new Main();
    
    // enable hangup support so you can press ctrl + c to terminate the JVM
    main.enableHangupSupport();
    
    // Get spring definition of the routes to start
    LOG.info("Loading application context from: " + uri);
    
    // Set the application context that configures the camel routes
    main.setApplicationContextUri(uri);
     
    // run until you terminate the JVM
    LOG.info("Starting {}",this.name);
    main.run(); 
}
 
开发者ID:boundary,项目名称:boundary-event-sdk,代码行数:24,代码来源:CamelApplication.java


示例4: boot

import org.apache.camel.spring.Main; //导入依赖的package包/类
protected void boot() throws Exception
{
    // create a Main instance
    main = new Main();
    
    // enable hangup support so you can press ctrl + c to terminate the JVM
    main.enableHangupSupport();
    
    // Get spring definition of the routes to start
    String uri = System.getProperty("boundary.application.context.uri");
    LOG.info("Loading application context from: " + uri);
    
    // Set the application context that configures the camel routes
    main.setApplicationContextUri(uri);
     
    // run until you terminate the JVM
    LOG.info("Starting Boundary Event SDK.");
    main.run(); 
}
 
开发者ID:boundary,项目名称:boundary-event-sdk,代码行数:20,代码来源:EventApplication.java


示例5: boot

import org.apache.camel.spring.Main; //导入依赖的package包/类
protected void boot() throws Exception
{
    // create a Main instance
    main = new Main();
    
    // enable hangup support so you can press ctrl + c to terminate the JVM
    main.enableHangupSupport();
    
    // Get spring definition of the routes to start
    String uri = System.getProperty("boundary.application.context.uri");
    LOG.info("Loading application context from: " + uri);
    
    // Set the application context that configures the camel routes
    main.setApplicationContextUri(uri);
     
    // run until you terminate the JVM
    LOG.info("Starting Web Hook");
    main.run(); 
}
 
开发者ID:boundary,项目名称:boundary-event-sdk,代码行数:20,代码来源:WebHookApplication.java


示例6: testJaxrsRelayRoute

import org.apache.camel.spring.Main; //导入依赖的package包/类
/**
 * That test builds a route chaining two cxfrs endpoints. It shows a request
 * sent to the first one will be correctly transferred and consumed by the
 * other one.
 */
@Test
public void testJaxrsRelayRoute() throws Exception {
    final Main main = new Main();
    try {
        main.setApplicationContextUri("org/apache/camel/component/cxf/jaxrs/CxfRsSpringRelay.xml");
        main.start();
        Thread t = new Thread(new Runnable() {
            /**
             * Sends a request to the first endpoint in the route
             */
            public void run() {
                try {
                    JAXRSClientFactory.create("http://localhost:" + port6 + "/CxfRsRelayTest/rest", UploadService.class)
                        .upload(CamelRouteBuilder.class.getResourceAsStream(SAMPLE_CONTENT_PATH),
                                SAMPLE_NAME);
                } catch (Exception e) {
                    log.warn("Error uploading to http://localhost:" + port6 + "/CxfRsRelayTest/rest", e);
                }
            }
        });
        t.start();
        LATCH.await(10, TimeUnit.SECONDS);
        assertEquals(SAMPLE_NAME, name);
        StringWriter writer = new StringWriter();
        IOUtils.copyAndCloseInput(new InputStreamReader(CamelRouteBuilder.class
                                      .getResourceAsStream(SAMPLE_CONTENT_PATH)), writer);
        assertEquals(writer.toString(), content);
    } finally {
        main.stop();
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:37,代码来源:CxfRsRelayTest.java


示例7: testStartupFailed

import org.apache.camel.spring.Main; //导入依赖的package包/类
public void testStartupFailed() throws Exception {
    Main main = new Main();

    String[] args = new String[]{"-ac", "org/apache/camel/spring/issues/SpringMainStartFailedIssueTest.xml"};
    try {
        main.run(args);
        fail("Should have thrown an exception");
    } catch (Exception e) {
        assertIsInstanceOf(FailedToCreateRouteException.class, e.getCause());
    }

    assertNull("Spring application context should NOT be created", main.getApplicationContext());
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:14,代码来源:SpringMainStartFailedIssueTest.java


示例8: testApplicationContextFailed

import org.apache.camel.spring.Main; //导入依赖的package包/类
public void testApplicationContextFailed() {
    try {
        Main main = new Main();
        main.setApplicationContextUri("org/apache/camel/spring/issues/MisspelledRouteRefTest.xml");
        main.start();
        fail("Should have thrown an exception");
    } catch (Exception e) {
        //expected but want to see what it looks like...
        LOG.debug("Exception message : " + e.getMessage());

        CamelException cause = (CamelException) e.getCause();
        assertEquals("Cannot find any routes with this RouteBuilder reference: RouteBuilderRef[xxxroute]", cause.getMessage());
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:15,代码来源:MisspelledRouteRefTest.java


示例9: main

import org.apache.camel.spring.Main; //导入依赖的package包/类
/**
 * Allow this route to be run as an application
 */
public static void main(String[] args) throws Exception {
    new Main().run(args);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:7,代码来源:MyRouteBuilder.java


示例10: testCamelRulesDeployCorrectlyInSpring

import org.apache.camel.spring.Main; //导入依赖的package包/类
public void testCamelRulesDeployCorrectlyInSpring() throws Exception {
    // let's boot up the Spring application context for 2 seconds to check that it works OK
    Main.main("-duration", "2s", "-o", "target/site/cameldoc");
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:IntegrationTest.java


示例11: testEtlRoutes

import org.apache.camel.spring.Main; //导入依赖的package包/类
public void testEtlRoutes() throws Exception {
    // let's boot up the Spring application context for 5 seconds to check that it works OK
    Main.main("-duration", "5s", "-o", "target/site/cameldoc");
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:IntegrationTest.java


示例12: main

import org.apache.camel.spring.Main; //导入依赖的package包/类
/**
 * A main() so we can easily run these routing rules in our IDE
 */
public static void main(String... args) throws Exception {
    Main.main(args);
}
 
开发者ID:camelinaction,项目名称:camelinaction2,代码行数:7,代码来源:MyRouteBuilder.java


示例13: CamelPatientExample

import org.apache.camel.spring.Main; //导入依赖的package包/类
private CamelPatientExample() {
    main = new Main();
}
 
开发者ID:EdwardOst,项目名称:mdpnp,代码行数:4,代码来源:CamelPatientExample.java


示例14: CamelIceExample

import org.apache.camel.spring.Main; //导入依赖的package包/类
private CamelIceExample() {
    main = new Main();
}
 
开发者ID:EdwardOst,项目名称:mdpnp,代码行数:4,代码来源:CamelIceExample.java


示例15: testSpringDeployment

import org.apache.camel.spring.Main; //导入依赖的package包/类
public void testSpringDeployment() throws Exception {
    // boot up the Spring application context for 2 seconds
    Main.main("-duration", "2s", "-o", "target/vista");
}
 
开发者ID:OSEHRA,项目名称:vista-soa-ri,代码行数:5,代码来源:IntegrationTest.java


示例16: testSpringDeployment

import org.apache.camel.spring.Main; //导入依赖的package包/类
public void testSpringDeployment() throws Exception {
    // boot up the Spring application context for 2 seconds
    Main.main("-duration", "600s", "-o", "target/vista");
}
 
开发者ID:OSEHRA,项目名称:vista-soa-ri,代码行数:5,代码来源:IntegrationTest.java


示例17: main

import org.apache.camel.spring.Main; //导入依赖的package包/类
/**
 * Allow this route to be run as an application
 *
 * @param args
 */
public static void main(String[] args) throws Exception{
    new Main().run(args);
}
 
开发者ID:apache,项目名称:karaf-eik,代码行数:9,代码来源:MyRouteBuilder.java



注:本文中的org.apache.camel.spring.Main类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ApiInfo类代码示例发布时间:2022-05-21
下一篇:
Java Constants类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap