UI Spring Context Holder bean registration (#1026)

* register the Spring Context Holder bean for UI instead of setting the context for each UI separately
* reverted test scope for db driver

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
This commit is contained in:
Bondar Bogdan
2020-10-13 17:04:18 +02:00
committed by GitHub
parent a092747c99
commit 541a0129ef
8 changed files with 45 additions and 45 deletions

View File

@@ -20,6 +20,7 @@ import org.eclipse.hawkbit.ui.push.HawkbitEventPermissionChecker;
import org.eclipse.hawkbit.ui.push.HawkbitEventProvider;
import org.eclipse.hawkbit.ui.push.UIEventPermissionChecker;
import org.eclipse.hawkbit.ui.push.UIEventProvider;
import org.eclipse.hawkbit.ui.utils.SpringContextHolder;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.ConfigurableApplicationContext;
@@ -81,6 +82,16 @@ public class MgmtUiAutoConfiguration {
return new HawkbitEventPermissionChecker(permChecker);
}
/**
* Bean for creating a singleton instance of the {@link SpringContextHolder}
*
* @return the singleton instance of the {@link SpringContextHolder}
*/
@Bean
SpringContextHolder springContextHolder() {
return SpringContextHolder.getInstance();
}
/**
* The UI scoped event push strategy. Session scope is necessary, that every
* UI has an own strategy.