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


Java InflightRepository類代碼示例

本文整理匯總了Java中org.apache.camel.spi.InflightRepository的典型用法代碼示例。如果您正苦於以下問題:Java InflightRepository類的具體用法?Java InflightRepository怎麽用?Java InflightRepository使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: browse

import org.apache.camel.spi.InflightRepository; //導入依賴的package包/類
@Override
public TabularData browse(String routeId, int limit, boolean sortByLongestDuration) {
    try {
        TabularData answer = new TabularDataSupport(CamelOpenMBeanTypes.listInflightExchangesTabularType());
        Collection<InflightRepository.InflightExchange> exchanges = inflightRepository.browse(routeId, limit, sortByLongestDuration);

        for (InflightRepository.InflightExchange entry : exchanges) {
            CompositeType ct = CamelOpenMBeanTypes.listInflightExchangesCompositeType();
            String exchangeId = entry.getExchange().getExchangeId();
            String fromRouteId = entry.getFromRouteId();
            String atRouteId = entry.getAtRouteId();
            String nodeId = entry.getNodeId();
            String elapsed = "" + entry.getElapsed();
            String duration = "" + entry.getDuration();

            CompositeData data = new CompositeDataSupport(ct,
                    new String[]{"exchangeId", "fromRouteId", "routeId", "nodeId", "elapsed", "duration"},
                    new Object[]{exchangeId, fromRouteId, atRouteId, nodeId, elapsed, duration});
            answer.put(data);
        }
        return answer;
    } catch (Exception e) {
        throw ObjectHelper.wrapRuntimeCamelException(e);
    }
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:26,代碼來源:ManagedInflightRepository.java

示例2: createRouteBuilder

import org.apache.camel.spi.InflightRepository; //導入依賴的package包/類
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    return new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            from("direct:start").routeId("foo")
                    .to("mock:a")
                    .process(new Processor() {
                        @Override
                        public void process(Exchange exchange) throws Exception {
                            Collection<InflightRepository.InflightExchange> list = context.getInflightRepository().browse();
                            assertEquals(1, list.size());

                            InflightRepository.InflightExchange inflight = list.iterator().next();
                            assertNotNull(inflight);

                            assertEquals(exchange, inflight.getExchange());
                            assertEquals("foo", inflight.getFromRouteId());
                            assertEquals("foo", inflight.getAtRouteId());
                            assertEquals("myProcessor", inflight.getNodeId());
                        }
                    }).id("myProcessor")
                    .to("mock:result");
        }
    };
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:27,代碼來源:InflightRepositoryBrowseTest.java

示例3: testDefaultInflightRepository

import org.apache.camel.spi.InflightRepository; //導入依賴的package包/類
public void testDefaultInflightRepository() throws Exception {
    InflightRepository repo = new DefaultInflightRepository();

    assertEquals(0, repo.size());

    Exchange e1 = new DefaultExchange(context);
    repo.add(e1);
    assertEquals(1, repo.size());

    Exchange e2 = new DefaultExchange(context);
    repo.add(e2);
    assertEquals(2, repo.size());

    repo.remove(e2);
    assertEquals(1, repo.size());

    repo.remove(e1);
    assertEquals(0, repo.size());
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:20,代碼來源:DefaultInflightRepositoryTest.java

示例4: createRouteBuilder

import org.apache.camel.spi.InflightRepository; //導入依賴的package包/類
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    return new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            from("direct:start").routeId("foo")
                .to("mock:a")
                .to("direct:bar")
                .to("mock:result");

            from("direct:bar").routeId("bar")
                    .to("mock:b")
                    .process(new Processor() {
                        @Override
                        public void process(Exchange exchange) throws Exception {
                            Collection<InflightRepository.InflightExchange> list = context.getInflightRepository().browse("foo");
                            assertEquals(1, list.size());

                            InflightRepository.InflightExchange inflight = list.iterator().next();
                            assertNotNull(inflight);

                            assertEquals(exchange, inflight.getExchange());
                            assertEquals("foo", inflight.getFromRouteId());
                            assertEquals("bar", inflight.getAtRouteId());
                            assertEquals("myProcessor", inflight.getNodeId());
                        }
                    }).id("myProcessor");

        }
    };
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:32,代碼來源:InflightRepositoryBrowseFromRouteTest.java

示例5: RouteInflightRepositoryAdvice

import org.apache.camel.spi.InflightRepository; //導入依賴的package包/類
public RouteInflightRepositoryAdvice(InflightRepository inflightRepository, String id) {
    this.inflightRepository = inflightRepository;
    this.id = id;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:5,代碼來源:CamelInternalProcessor.java

示例6: ManagedInflightRepository

import org.apache.camel.spi.InflightRepository; //導入依賴的package包/類
public ManagedInflightRepository(CamelContext context, InflightRepository inflightRepository) {
    super(context, inflightRepository);
    this.inflightRepository = inflightRepository;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:5,代碼來源:ManagedInflightRepository.java

示例7: getInflightRepository

import org.apache.camel.spi.InflightRepository; //導入依賴的package包/類
public InflightRepository getInflightRepository() {
    return inflightRepository;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:4,代碼來源:ManagedInflightRepository.java

示例8: setInflightRepository

import org.apache.camel.spi.InflightRepository; //導入依賴的package包/類
public void setInflightRepository(InflightRepository repository) {
    this.inflightRepository = repository;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:4,代碼來源:DefaultCamelContext.java

示例9: getInflightRepository

import org.apache.camel.spi.InflightRepository; //導入依賴的package包/類
@Override
public InflightRepository getInflightRepository() {
  return context.getInflightRepository();
}
 
開發者ID:rvs-fluid-it,項目名稱:microservice-bundle,代碼行數:5,代碼來源:ManagedCamelContext.java

示例10: setInflightRepository

import org.apache.camel.spi.InflightRepository; //導入依賴的package包/類
@Override
public void setInflightRepository(InflightRepository repository) {
  context.setInflightRepository(repository);
}
 
開發者ID:rvs-fluid-it,項目名稱:microservice-bundle,代碼行數:5,代碼來源:ManagedCamelContext.java

示例11: getInflightRepository

import org.apache.camel.spi.InflightRepository; //導入依賴的package包/類
@Override
public InflightRepository getInflightRepository() {
    return context.getInflightRepository();
}
 
開發者ID:commercehub-oss,項目名稱:dropwizard-camel,代碼行數:5,代碼來源:ManagedCamelContext.java

示例12: setInflightRepository

import org.apache.camel.spi.InflightRepository; //導入依賴的package包/類
@Override
public void setInflightRepository(InflightRepository repository) {
    context.setInflightRepository(repository);
}
 
開發者ID:commercehub-oss,項目名稱:dropwizard-camel,代碼行數:5,代碼來源:ManagedCamelContext.java

示例13: getInflightRepository

import org.apache.camel.spi.InflightRepository; //導入依賴的package包/類
/**
 * Gets the inflight repository
 *
 * @return the repository
 */
InflightRepository getInflightRepository();
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:7,代碼來源:CamelContext.java

示例14: setInflightRepository

import org.apache.camel.spi.InflightRepository; //導入依賴的package包/類
/**
 * Sets a custom inflight repository to use
 *
 * @param repository the repository
 */
void setInflightRepository(InflightRepository repository);
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:7,代碼來源:CamelContext.java


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