本文整理汇总了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;
}
示例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());
}
}
示例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));
}
}
}
}
示例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;
}