use of org.apache.ignite.internal.processors.resource.GridSpringResourceContextImpl in project ignite by apache.
the class IgniteSpringHelperImpl method loadConfigurations.
/**
* {@inheritDoc}
*/
@Override
public <T> IgniteBiTuple<Collection<T>, ? extends GridSpringResourceContext> loadConfigurations(InputStream cfgStream, Class<T> cls, String... excludedProps) throws IgniteCheckedException {
ApplicationContext springCtx = applicationContext(cfgStream, excludedProps);
Map<String, T> cfgMap;
try {
cfgMap = springCtx.getBeansOfType(cls);
} catch (BeansException e) {
throw new IgniteCheckedException("Failed to instantiate bean [type=" + cls + ", err=" + e.getMessage() + ']', e);
}
if (cfgMap == null || cfgMap.isEmpty())
throw new IgniteCheckedException("Failed to find configuration in: " + cfgStream);
return F.t(cfgMap.values(), new GridSpringResourceContextImpl(springCtx));
}
use of org.apache.ignite.internal.processors.resource.GridSpringResourceContextImpl in project ignite by apache.
the class IgniteSpringHelperImpl method loadConfigurations.
/**
* {@inheritDoc}
*/
@Override
public <T> IgniteBiTuple<Collection<T>, ? extends GridSpringResourceContext> loadConfigurations(URL cfgUrl, Class<T> cls, String... excludedProps) throws IgniteCheckedException {
ApplicationContext springCtx = applicationContext(cfgUrl, excludedProps);
Map<String, T> cfgMap;
try {
cfgMap = springCtx.getBeansOfType(cls);
} catch (BeansException e) {
throw new IgniteCheckedException("Failed to instantiate bean [type=" + cls + ", err=" + e.getMessage() + ']', e);
}
if (cfgMap == null || cfgMap.isEmpty())
throw new IgniteCheckedException("Failed to find configuration in: " + cfgUrl);
return F.t(cfgMap.values(), new GridSpringResourceContextImpl(springCtx));
}
Aggregations