本文整理了Java中org.apache.camel.spi.Registry.lookupByType
方法的一些代码示例,展示了Registry.lookupByType
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Registry.lookupByType
方法的具体详情如下:
包路径:org.apache.camel.spi.Registry
类名称:Registry
方法名:lookupByType
暂无
代码示例来源:origin: net.sf.jabb/jabb-core
/**
* Looks up from all encapsulated Registry(s) one by one, and returns all the result found.<br>
* 按次序从所封装的Registry中查找,并返回所有能找到的结果。
* <p>
* If no result can be found, an empty Map will be returned.
* <p>
* 如果全都找不到,则返回一个空的Map。
*
* @see org.apache.camel.spi.Registry#lookupByType(java.lang.Class)
*/
public <T> Map<String, T> lookupByType(Class<T> type) {
Map<String, T> result = new HashMap<String, T>();
for (Registry reg: registryList){
Map<String, T> r = reg.lookupByType(type);
result.putAll(r);
}
return result;
}
代码示例来源:origin: OpenWiseSolutions/openhub-framework
@Override
public <T> Map<String, T> lookupByType(Class<T> type) {
for (Registry registry : applicationContextsRegistry.values()) {
Map<String, T> result = registry.lookupByType(type);
if (!MapUtils.isEmpty(result)) {
return result;
}
}
return Collections.emptyMap();
}
代码示例来源:origin: org.switchyard/switchyard-bus-camel
private void notifyListeners(CamelContext context, org.switchyard.Exchange exchange, Throwable exception) {
Map<String, ErrorListener> listeners = context.getRegistry().lookupByType(ErrorListener.class);
if (listeners != null && listeners.size() > 0) {
for (Entry<String, ErrorListener> entry : listeners.entrySet()) {
try {
entry.getValue().notify(exchange, exception);
} catch (Exception e) {
BusLogger.ROOT_LOGGER.failedToHandlException(entry.getKey(), exception.getClass());
}
}
}
}
代码示例来源:origin: jboss-switchyard/core
private void notifyListeners(CamelContext context, org.switchyard.Exchange exchange, Throwable exception) {
Map<String, ErrorListener> listeners = context.getRegistry().lookupByType(ErrorListener.class);
if (listeners != null && listeners.size() > 0) {
for (Entry<String, ErrorListener> entry : listeners.entrySet()) {
try {
entry.getValue().notify(exchange, exception);
} catch (Exception e) {
BusLogger.ROOT_LOGGER.failedToHandlException(entry.getKey(), exception.getClass());
}
}
}
}
代码示例来源:origin: org.switchyard/switchyard-bus-camel
/**
* Lookup in camel context given type of beans.
*
* @param type Type of bean.
* @return Map of beans where key is name.
*/
private <T> Map<String, T> lookup(Class<T> type) {
Map<String, T> result = getContext().getRegistry().lookupByType(type);
if (result == null) {
return Collections.emptyMap();
}
return result;
}
代码示例来源:origin: jboss-switchyard/core
/**
* Lookup in camel context given type of beans.
*
* @param type Type of bean.
* @return Map of beans where key is name.
*/
private <T> Map<String, T> lookup(Class<T> type) {
Map<String, T> result = getContext().getRegistry().lookupByType(type);
if (result == null) {
return Collections.emptyMap();
}
return result;
}
代码示例来源:origin: org.switchyard/switchyard-bus-camel
/**
* Create a new InterceptorProcessor.
* @param target the interception target
* @param domain service domain for this processor
*/
public InterceptProcessor(String target, ServiceDomain domain) {
_domain = domain;
_target = target;
_property = INTERCEPT_PREFIX + _target;
_trace = new MessageTraceHandler();
SwitchYardCamelContext camelContext = (SwitchYardCamelContext)domain
.getProperty(SwitchYardCamelContext.CAMEL_CONTEXT_PROPERTY);
_interceptors = camelContext.getRegistry().lookupByType(ExchangeInterceptor.class);
}
代码示例来源:origin: org.switchyard/switchyard-bus-camel
Map<String, Auditor> auditors = context.getRegistry().lookupByType(Auditor.class);
if (auditors != null) {
List<Auditor> wrappers = new ArrayList<Auditor>();
代码示例来源:origin: jboss-switchyard/core
Map<String, Auditor> auditors = context.getRegistry().lookupByType(Auditor.class);
if (auditors != null) {
List<Auditor> wrappers = new ArrayList<Auditor>();
代码示例来源:origin: jboss-switchyard/core
private void fireInterceptors(Exchange ex) throws HandlerException {
Map<String, ExchangeInterceptor> interceptors =
ex.getContext().getRegistry().lookupByType(ExchangeInterceptor.class);
内容来源于网络,如有侵权,请联系作者删除!