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


Java Registry.findByType方法代码示例

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


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

示例1: initClientMapper

import org.apache.camel.spi.Registry; //导入方法依赖的package包/类
/**
 * Initialize the ClientMappers from Camel registry. Note that this initial
 * implementation only supports one mapper.
 * <p>
 */
private void initClientMapper(Registry registry) throws Exception {
	Set<ClientMapper> mappers = null;
	try {
		// find the one client mapper
		mappers = registry.findByType(ClientMapper.class);
	} catch (Exception ignore) {
	}

	if (mappers != null && !mappers.isEmpty()) {
		Object objs[] = mappers.toArray();
		getComponentProfile().setClientMapper((ClientMapper) objs[0]);
		LOG.trace("initClientMapper: using a client mapper from registry");
	} else {
		LOG.trace("initClientMapper: not using a client mapper");
	}
}
 
开发者ID:joef551,项目名称:camel-cql,代码行数:22,代码来源:CqlComponent.java

示例2: resolveObjectMapper

import org.apache.camel.spi.Registry; //导入方法依赖的package包/类
private ObjectMapper resolveObjectMapper(Registry registry) {
    Set<ObjectMapper> mappers = registry.findByType(ObjectMapper.class);
    if (mappers.size() == 1) {
        return mappers.iterator().next();
    }
    return new ObjectMapper();
}
 
开发者ID:syndesisio,项目名称:syndesis,代码行数:8,代码来源:JsonSimplePredicate.java

示例3: findByType

import org.apache.camel.spi.Registry; //导入方法依赖的package包/类
public <T> Set<T> findByType(Class<T> type) {
    Set<T> answer = Collections.emptySet();
    for (Registry registry : registryList) {
        answer = registry.findByType(type);
        if (!answer.isEmpty()) {
            break;
        }
    }
    return answer;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:11,代码来源:CompositeRegistry.java

示例4: resolveObjectMapper

import org.apache.camel.spi.Registry; //导入方法依赖的package包/类
private ObjectMapper resolveObjectMapper(Registry registry) {
    Set<ObjectMapper> mappers = registry.findByType(ObjectMapper.class);
    if (mappers.size() == 1) {
        return mappers.iterator().next();
    }
    return defaultMapper;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:8,代码来源:JacksonTypeConverters.java

示例5: resolveObjectMapper

import org.apache.camel.spi.Registry; //导入方法依赖的package包/类
private ObjectMapper resolveObjectMapper(Registry registry) {
    Set<XmlMapper> mappers = registry.findByType(XmlMapper.class);
    if (mappers.size() == 1) {
        return mappers.iterator().next();
    }
    return defaultMapper;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:8,代码来源:JacksonXMLTypeConverters.java

示例6: getMetricRegistryFromCamelRegistry

import org.apache.camel.spi.Registry; //导入方法依赖的package包/类
MetricRegistry getMetricRegistryFromCamelRegistry(Registry camelRegistry, String registryName) {
    MetricRegistry registry = camelRegistry.lookupByNameAndType(registryName, MetricRegistry.class);
    if (registry != null) {
        return registry;
    } else {
        Set<MetricRegistry> registries = camelRegistry.findByType(MetricRegistry.class);
        if (registries.size() == 1) {
            return registries.iterator().next();
        }
    }
    return null;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:13,代码来源:MetricsComponent.java


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