當前位置: 首頁>>代碼示例>>Java>>正文


Java DefaultCamelContext.getRouteStartupOrder方法代碼示例

本文整理匯總了Java中org.apache.camel.impl.DefaultCamelContext.getRouteStartupOrder方法的典型用法代碼示例。如果您正苦於以下問題:Java DefaultCamelContext.getRouteStartupOrder方法的具體用法?Java DefaultCamelContext.getRouteStartupOrder怎麽用?Java DefaultCamelContext.getRouteStartupOrder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.camel.impl.DefaultCamelContext的用法示例。


在下文中一共展示了DefaultCamelContext.getRouteStartupOrder方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testRouteStartupOrder

import org.apache.camel.impl.DefaultCamelContext; //導入方法依賴的package包/類
public void testRouteStartupOrder() throws Exception {
    MockEndpoint mock = getMockEndpoint("mock:result");
    mock.expectedMessageCount(1);

    template.sendBody("direct:start", "Hello World");

    assertMockEndpointsSatisfied();

    // assert correct order
    DefaultCamelContext dcc = (DefaultCamelContext) context;
    List<RouteStartupOrder> order = dcc.getRouteStartupOrder();

    assertEquals(2, order.size());
    assertEquals("direct://start", order.get(0).getRoute().getEndpoint().getEndpointUri());
    assertEquals("seda://foo", order.get(1).getRoute().getEndpoint().getEndpointUri());
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:17,代碼來源:RouteStartupOrderSimpleTest.java

示例2: testRouteShutdownNotReverseOrder

import org.apache.camel.impl.DefaultCamelContext; //導入方法依賴的package包/類
public void testRouteShutdownNotReverseOrder() throws Exception {
    // flip to not reverse
    context.getShutdownStrategy().setShutdownRoutesInReverseOrder(false);

    MockEndpoint mock = getMockEndpoint("mock:result");
    mock.expectedMessageCount(1);

    template.sendBody("direct:bar", "Hello World");

    assertMockEndpointsSatisfied();

    // assert correct startup order
    DefaultCamelContext dcc = (DefaultCamelContext) context;
    List<RouteStartupOrder> order = dcc.getRouteStartupOrder();

    assertEquals(2, order.size());
    assertEquals("direct://bar", order.get(0).getRoute().getEndpoint().getEndpointUri());
    assertEquals("direct://foo", order.get(1).getRoute().getEndpoint().getEndpointUri());

    // assert correct shutdown order
    context.stop();
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:23,代碼來源:RouteShutdownNotReverseOrderTest.java

示例3: testRouteStartupOrder

import org.apache.camel.impl.DefaultCamelContext; //導入方法依賴的package包/類
public void testRouteStartupOrder() throws Exception {
    MockEndpoint mock = getMockEndpoint("mock:result");
    mock.expectedMessageCount(1);

    template.sendBody("direct:start", "Hello World");

    assertMockEndpointsSatisfied();

    // assert correct order
    DefaultCamelContext dcc = (DefaultCamelContext) context;
    List<RouteStartupOrder> order = dcc.getRouteStartupOrder();

    assertEquals(5, order.size());
    assertEquals("seda://foo", order.get(0).getRoute().getEndpoint().getEndpointUri());
    assertEquals("direct://start", order.get(1).getRoute().getEndpoint().getEndpointUri());
    assertEquals("seda://bar", order.get(2).getRoute().getEndpoint().getEndpointUri());
    assertEquals("direct://bar", order.get(3).getRoute().getEndpoint().getEndpointUri());
    // the one with no startup order should be last
    assertEquals("direct://default", order.get(4).getRoute().getEndpoint().getEndpointUri());
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:21,代碼來源:RouteStartupOrderWithDefaultTest.java

示例4: testRouteShutdownReverseOrder

import org.apache.camel.impl.DefaultCamelContext; //導入方法依賴的package包/類
public void testRouteShutdownReverseOrder() throws Exception {
    MockEndpoint mock = getMockEndpoint("mock:result");
    mock.expectedMessageCount(1);

    template.sendBody("direct:bar", "Hello World");

    assertMockEndpointsSatisfied();

    // assert correct startup order
    DefaultCamelContext dcc = (DefaultCamelContext) context;
    List<RouteStartupOrder> order = dcc.getRouteStartupOrder();

    assertEquals(2, order.size());
    assertEquals("direct://bar", order.get(0).getRoute().getEndpoint().getEndpointUri());
    assertEquals("direct://foo", order.get(1).getRoute().getEndpoint().getEndpointUri());

    // assert correct shutdown order
    context.stop();
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:20,代碼來源:RouteShutdownReverseOrderTest.java

示例5: testRouteStartupOrderSuspendResumeNoAutoStartup

import org.apache.camel.impl.DefaultCamelContext; //導入方法依賴的package包/類
public void testRouteStartupOrderSuspendResumeNoAutoStartup() throws Exception {
    MockEndpoint mock = getMockEndpoint("mock:result");
    mock.expectedMessageCount(1);

    template.sendBody("direct:start", "Hello World");

    assertMockEndpointsSatisfied();

    context.suspend();
    context.resume();

    // route C should still be stopped after we have resumed
    assertEquals(true, context.getRouteStatus("C").isStopped());

    // assert correct order
    DefaultCamelContext dcc = (DefaultCamelContext) context;
    List<RouteStartupOrder> order = dcc.getRouteStartupOrder();

    assertEquals(3, order.size());
    assertEquals("direct://foo", order.get(0).getRoute().getEndpoint().getEndpointUri());
    assertEquals("direct://start", order.get(1).getRoute().getEndpoint().getEndpointUri());
    assertEquals("direct://bar", order.get(2).getRoute().getEndpoint().getEndpointUri());
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:24,代碼來源:RouteStartupOrderSuspendResumeNoAutoStartupTest.java

示例6: testRouteStartupOrder

import org.apache.camel.impl.DefaultCamelContext; //導入方法依賴的package包/類
public void testRouteStartupOrder() throws Exception {
    MockEndpoint mock = getMockEndpoint("mock:result");
    mock.expectedMessageCount(1);

    template.sendBody("direct:bar", "Hello World");

    assertMockEndpointsSatisfied();

    // assert correct order
    DefaultCamelContext dcc = (DefaultCamelContext) context;
    List<RouteStartupOrder> order = dcc.getRouteStartupOrder();

    assertEquals(2, order.size());
    assertEquals("direct://bar", order.get(0).getRoute().getEndpoint().getEndpointUri());
    assertEquals("direct://foo", order.get(1).getRoute().getEndpoint().getEndpointUri());
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:17,代碼來源:RouteStartupOrderDirectTest.java

示例7: testRouteServiceStartupOrder

import org.apache.camel.impl.DefaultCamelContext; //導入方法依賴的package包/類
public void testRouteServiceStartupOrder() throws Exception {
    MockEndpoint mock = getMockEndpoint("mock:result");
    mock.expectedMessageCount(1);

    template.sendBody("direct:start", "Hello World");

    assertMockEndpointsSatisfied();

    // assert correct order
    DefaultCamelContext dcc = (DefaultCamelContext) context;
    List<RouteStartupOrder> order = dcc.getRouteStartupOrder();

    assertEquals(4, order.size());
    assertEquals("seda://foo", order.get(0).getRoute().getEndpoint().getEndpointUri());
    assertEquals("direct://start", order.get(1).getRoute().getEndpoint().getEndpointUri());
    assertEquals("seda://bar", order.get(2).getRoute().getEndpoint().getEndpointUri());
    assertEquals("direct://bar", order.get(3).getRoute().getEndpoint().getEndpointUri());

    // assert route service was started in order as well
    assertEquals("2143", startOrder);
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:22,代碼來源:RouteServicesStartupOrderTest.java

示例8: testRouteStartupOrder

import org.apache.camel.impl.DefaultCamelContext; //導入方法依賴的package包/類
public void testRouteStartupOrder() throws Exception {
    MockEndpoint mock = getMockEndpoint("mock:result");
    mock.expectedMessageCount(1);

    template.sendBody("direct:start", "Hello World");

    assertMockEndpointsSatisfied();

    // assert correct order
    DefaultCamelContext dcc = (DefaultCamelContext) context;
    List<RouteStartupOrder> order = dcc.getRouteStartupOrder();

    assertEquals(4, order.size());
    assertEquals("seda://foo", order.get(0).getRoute().getEndpoint().getEndpointUri());
    assertEquals("direct://start", order.get(1).getRoute().getEndpoint().getEndpointUri());
    assertEquals("seda://bar", order.get(2).getRoute().getEndpoint().getEndpointUri());
    assertEquals("direct://bar", order.get(3).getRoute().getEndpoint().getEndpointUri());
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:19,代碼來源:RouteStartupOrderTest.java

示例9: testRouteStartupOrder

import org.apache.camel.impl.DefaultCamelContext; //導入方法依賴的package包/類
public void testRouteStartupOrder() throws Exception {
    MockEndpoint mock = getMockEndpoint("mock:result");
    mock.expectedMessageCount(1);

    template.sendBody("direct:bar", "Hello World");

    assertMockEndpointsSatisfied();

    // assert correct order
    DefaultCamelContext dcc = (DefaultCamelContext) context;
    List<RouteStartupOrder> order = dcc.getRouteStartupOrder();

    assertEquals(2, order.size());
    assertEquals("direct://bar", order.get(1).getRoute().getEndpoint().getEndpointUri());
    assertEquals("direct://foo", order.get(0).getRoute().getEndpoint().getEndpointUri());
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:17,代碼來源:RouteStartupOrderDirectReverseTest.java

示例10: testRouteStartupOrderSuspendResume

import org.apache.camel.impl.DefaultCamelContext; //導入方法依賴的package包/類
public void testRouteStartupOrderSuspendResume() throws Exception {
    MockEndpoint mock = getMockEndpoint("mock:result");
    mock.expectedMessageCount(1);

    template.sendBody("direct:start", "Hello World");

    assertMockEndpointsSatisfied();

    context.suspend();
    context.resume();

    // assert correct order
    DefaultCamelContext dcc = (DefaultCamelContext) context;
    List<RouteStartupOrder> order = dcc.getRouteStartupOrder();

    assertEquals(4, order.size());
    assertEquals("direct://foo", order.get(0).getRoute().getEndpoint().getEndpointUri());
    assertEquals("direct://start", order.get(1).getRoute().getEndpoint().getEndpointUri());
    assertEquals("direct://baz", order.get(2).getRoute().getEndpoint().getEndpointUri());
    assertEquals("direct://bar", order.get(3).getRoute().getEndpoint().getEndpointUri());
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:22,代碼來源:RouteStartupOrderSuspendResumeTest.java

示例11: testJmsDirectStartupOrderIssue

import org.apache.camel.impl.DefaultCamelContext; //導入方法依賴的package包/類
@Test
public void testJmsDirectStartupOrderIssue() throws Exception {
    // send messages to queue so there is messages on the queue before we start the route
    template.sendBody("activemq:queue:foo", "Hello World");
    template.sendBody("activemq:queue:foo", "Hello Camel");
    template.sendBody("activemq:queue:foo", "Bye World");
    template.sendBody("activemq:queue:foo", "Bye Camel");

    context.startRoute("amq");

    getMockEndpoint("mock:result").expectedMessageCount(4);

    assertMockEndpointsSatisfied();

    DefaultCamelContext dcc = (DefaultCamelContext) context;
    List<RouteStartupOrder> order = dcc.getRouteStartupOrder();
    assertEquals(2, order.size());
    assertEquals(1, order.get(0).getStartupOrder());
    assertEquals("direct", order.get(0).getRoute().getId());
    assertEquals(100, order.get(1).getStartupOrder());
    assertEquals("amq", order.get(1).getRoute().getId());
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:23,代碼來源:JmsDirectStartupOrderIssueTest.java

示例12: testRouteStartupOrderSuspendResumeStartC

import org.apache.camel.impl.DefaultCamelContext; //導入方法依賴的package包/類
public void testRouteStartupOrderSuspendResumeStartC() throws Exception {
    MockEndpoint mock = getMockEndpoint("mock:result");
    mock.expectedMessageCount(1);

    template.sendBody("direct:start", "Hello World");

    assertMockEndpointsSatisfied();

    // start C
    context.startRoute("C");

    context.suspend();
    context.resume();

    // route C should be started
    assertEquals(true, context.getRouteStatus("C").isStarted());

    // assert correct order
    DefaultCamelContext dcc = (DefaultCamelContext) context;
    List<RouteStartupOrder> order = dcc.getRouteStartupOrder();

    assertEquals(4, order.size());
    assertEquals("direct://foo", order.get(0).getRoute().getEndpoint().getEndpointUri());
    assertEquals("direct://start", order.get(1).getRoute().getEndpoint().getEndpointUri());
    assertEquals("direct://bar", order.get(2).getRoute().getEndpoint().getEndpointUri());

    // however its started manually so its started after the auto started
    assertEquals("direct://baz", order.get(3).getRoute().getEndpoint().getEndpointUri());
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:30,代碼來源:RouteStartupOrderSuspendResumeNoAutoStartupTest.java


注:本文中的org.apache.camel.impl.DefaultCamelContext.getRouteStartupOrder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。