ololo3000 commented on a change in pull request #9759:
URL: https://github.com/apache/ignite/pull/9759#discussion_r791227274
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridRouterCommandLineStartup.java
##########
@@ -49,20 +50,21 @@
*
* @param beans Beans loaded from spring configuration file.
*/
- public void start(Map<Class<?>, Object> beans) {
- log = (IgniteLogger)beans.get(IgniteLogger.class);
-
- if (log == null) {
+ public void start(Map<Class<?>, Collection> beans) {
+ if (F.isEmpty(beans.get(IgniteLogger.class))) {
Review comment:
Let's just change
`log = (IgniteLogger)beans.get(IgniteLogger.class);`
to
`log = F.<IgniteLogger>first(beans.get(IgniteLogger.class));`
And do the same with tcpCfg.
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelper.java
##########
@@ -99,7 +99,10 @@
* map value is {@code null}.
* @throws IgniteCheckedException If failed to load configuration.
*/
- public Map<Class<?>, Object> loadBeans(URL cfgUrl, Class<?>...
beanClasses) throws IgniteCheckedException;
+ public IgniteBiTuple<Map<Class<?>, Collection>, ? extends
GridSpringResourceContext> loadBeans(
Review comment:
It seems that we should update the JavaDoc.
##########
File path:
modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
##########
@@ -145,17 +143,24 @@
}
/** {@inheritDoc} */
- @Override public Map<Class<?>, Object> loadBeans(URL cfgUrl, Class<?>...
beanClasses) throws IgniteCheckedException {
+ @Override public IgniteBiTuple<Map<Class<?>, Collection>, ? extends
GridSpringResourceContext> loadBeans(
+ URL cfgUrl,
+ Class<?>... beanClasses
+ ) throws IgniteCheckedException {
assert beanClasses.length > 0;
ApplicationContext springCtx = initContext(cfgUrl);
- Map<Class<?>, Object> beans = new HashMap<>();
+ Map<Class<?>, Collection> beans = new HashMap<>();
- for (Class<?> cls : beanClasses)
- beans.put(cls, bean(springCtx, cls));
+ for (Class<?> cls : beanClasses) {
+ Map<String, ?> b = springCtx.getBeansOfType(cls);
Review comment:
Let's rename `b` to `clsBeans`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]