Java 类org.apache.camel.spring.Main 实例源码

项目:boundary-action-handler    文件:ActionWebhookApplication.java   
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();
}
项目:boundary-event-sdk    文件:CamelApplication.java   
/**
 * 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(); 
}
项目:boundary-event-sdk    文件:EventApplication.java   
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(); 
}
项目:boundary-event-sdk    文件:WebHookApplication.java   
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(); 
}
项目:Camel    文件:ReportIncidentRoutesTest.java   
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.");
    }
}
项目:Camel    文件:CxfRsRelayTest.java   
/**
 * 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();
    }
}
项目:Camel    文件:SpringMainStartFailedIssueTest.java   
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());
}
项目:Camel    文件:MisspelledRouteRefTest.java   
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());
    }
}
项目:Camel    文件:MyRouteBuilder.java   
/**
 * Allow this route to be run as an application
 */
public static void main(String[] args) throws Exception {
    new Main().run(args);
}
项目:Camel    文件:IntegrationTest.java   
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");
}
项目:Camel    文件:MyRouteBuilder.java   
/**
 * Allow this route to be run as an application
 */
public static void main(String[] args) throws Exception {
    new Main().run(args);
}
项目:Camel    文件:IntegrationTest.java   
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");
}
项目:camelinaction2    文件:MyRouteBuilder.java   
/**
 * A main() so we can easily run these routing rules in our IDE
 */
public static void main(String... args) throws Exception {
    Main.main(args);
}
项目:camelinaction2    文件:MyRouteBuilder.java   
/**
 * A main() so we can easily run these routing rules in our IDE
 */
public static void main(String... args) throws Exception {
    Main.main(args);
}
项目:camelinaction    文件:MyRouteBuilder.java   
/**
 * A main() so we can easily run these routing rules in our IDE
 */
public static void main(String... args) throws Exception {
    Main.main(args);
}
项目:camelinaction    文件:MyRouteBuilder.java   
/**
 * A main() so we can easily run these routing rules in our IDE
 */
public static void main(String... args) throws Exception {
    Main.main(args);
}
项目:mdpnp    文件:CamelPatientExample.java   
private CamelPatientExample() {
    main = new Main();
}
项目:mdpnp    文件:CamelIceExample.java   
private CamelIceExample() {
    main = new Main();
}
项目:vista-soa-ri    文件:IntegrationTest.java   
public void testSpringDeployment() throws Exception {
    // boot up the Spring application context for 2 seconds
    Main.main("-duration", "2s", "-o", "target/vista");
}
项目:vista-soa-ri    文件:IntegrationTest.java   
public void testSpringDeployment() throws Exception {
    // boot up the Spring application context for 2 seconds
    Main.main("-duration", "600s", "-o", "target/vista");
}
项目:vista-soa-ri    文件:IntegrationTest.java   
public void testSpringDeployment() throws Exception {
    // boot up the Spring application context for 2 seconds
    Main.main("-duration", "2s", "-o", "target/vista");
}
项目:t4f-data    文件:MyRouteBuilder.java   
/**
 * A main() so we can easily run these routing rules in our IDE
 */
public static void main(String... args) throws Exception {
    Main.main(args);
}
项目:karaf-eik    文件:MyRouteBuilder.java   
/**
 * Allow this route to be run as an application
 *
 * @param args
 */
public static void main(String[] args) throws Exception{
    new Main().run(args);
}
项目:servicemix    文件:MyRouteBuilder.java   
/**
 * Allow this route to be run as an application
 *
 * @param args
 */
public static void main(String[] args) throws Exception{
    new Main().run(args);
}