当前位置: 首页>>代码示例>>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;未经允许,请勿转载。