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