当前位置: 首页>>代码示例>>Java>>正文


Java RouteDefinition.getInputs方法代码示例

本文整理汇总了Java中org.apache.camel.model.RouteDefinition.getInputs方法的典型用法代码示例。如果您正苦于以下问题:Java RouteDefinition.getInputs方法的具体用法?Java RouteDefinition.getInputs怎么用?Java RouteDefinition.getInputs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.camel.model.RouteDefinition的用法示例。


在下文中一共展示了RouteDefinition.getInputs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isEipInUse

import org.apache.camel.model.RouteDefinition; //导入方法依赖的package包/类
/**
 * Checks if any of the Camel routes is using an EIP with the given name
 *
 * @param camelContext  the Camel context
 * @param name          the name of the EIP
 * @return <tt>true</tt> if in use, <tt>false</tt> if not
 */
public static boolean isEipInUse(CamelContext camelContext, String name) {
    for (RouteDefinition route : camelContext.getRouteDefinitions()) {
        for (FromDefinition from : route.getInputs()) {
            if (name.equals(from.getShortName())) {
                return true;
            }
        }
        Iterator<ProcessorDefinition> it = ProcessorDefinitionHelper.filterTypeInOutputs(route.getOutputs(), ProcessorDefinition.class);
        while (it.hasNext()) {
            ProcessorDefinition def = it.next();
            if (name.equals(def.getShortName())) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:25,代码来源:CamelContextHelper.java

示例2: assertValidContext

import org.apache.camel.model.RouteDefinition; //导入方法依赖的package包/类
protected void assertValidContext(CamelContext context) {
    assertNotNull("No context found!", context);

    List<RouteDefinition> routes = ((ModelCamelContext)context).getRouteDefinitions();
    LOG.debug("Found routes: " + routes);

    assertEquals("One Route should be found", 1, routes.size());

    for (RouteDefinition route : routes) {
        List<FromDefinition> inputs = route.getInputs();
        assertEquals("Number of inputs", 1, inputs.size());
        FromDefinition fromType = inputs.get(0);
        assertEquals("from URI", "seda:test.a", fromType.getUri());

        List<?> outputs = route.getOutputs();
        assertEquals("Number of outputs", 1, outputs.size());
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:XmlConfigTestSupport.java

示例3: replaceInputs

import org.apache.camel.model.RouteDefinition; //导入方法依赖的package包/类
private static void replaceInputs(Iterable<RouteDefinition> definitions,
		String oldFrom, String newFrom) {
	for (RouteDefinition definition : definitions) {
		List<FromDefinition> inputs = definition.getInputs();
		for (int i = 0; i < inputs.size(); i++) {
			if (oldFrom.equals(inputs.get(i).getEndpointUri())) {
				inputs.set(i, new FromDefinition(newFrom));
			}
		}
	}
}
 
开发者ID:Ardulink,项目名称:Ardulink-2,代码行数:12,代码来源:MqttOnCamelMqttToLinkIntegrationTest.java

示例4: getInnerContextConsumerList

import org.apache.camel.model.RouteDefinition; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
protected List<URI> getInnerContextConsumerList(CamelContext context) throws URISyntaxException {
    List<URI> consumerList = new ArrayList<URI>();
    List<RouteDefinition> routeDefinitions = context.getRouteDefinitions();
    for (RouteDefinition routeDefinition : routeDefinitions) {
        List<FromDefinition> inputs = routeDefinition.getInputs();
        for (FromDefinition input : inputs) {
            consumerList.add(new URI(input.getUri()));
        }
    }
    return consumerList;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:13,代码来源:RouteboxDispatcher.java


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