ENTAXY-480 release version 1.8.3
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>initializer</artifactId>
|
||||
<version>1.8.2.2</version>
|
||||
<version>1.8.3</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.initializer</groupId>
|
||||
<artifactId>init-manager</artifactId>
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* init-manager
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -2,14 +2,14 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* init-manager
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@ -61,6 +61,8 @@ public class InitManager {
|
||||
|
||||
protected static final Logger log = LoggerFactory.getLogger(InitManager.class);
|
||||
|
||||
public static final String PROP_SKIP_ALL = "skip.all";
|
||||
|
||||
/**
|
||||
* pid of config to store initialization status (true/false)
|
||||
* will be created on first start of InitManager
|
||||
@ -70,6 +72,9 @@ public class InitManager {
|
||||
protected ConfigRepository configRepository;
|
||||
protected BundleContext bundleContext;
|
||||
|
||||
// used when updating to avoid multiple extra initializations
|
||||
protected boolean skipAll = false;
|
||||
|
||||
protected Map<String, Set<String>> initersToDeps = new HashMap<>();
|
||||
protected Map<String, Set<String>> depsToIniters = new HashMap<>();
|
||||
|
||||
@ -201,13 +206,15 @@ public class InitManager {
|
||||
ClassLoader cl = wiring.getClassLoader();
|
||||
Class<?> clazz;
|
||||
try {
|
||||
clazz = cl.loadClass(className);
|
||||
log.info("Loaded class {}", clazz.getName());
|
||||
Constructor<?> constructor = clazz.getConstructor();
|
||||
Initializer initializer = (Initializer) constructor.newInstance();
|
||||
initializer.setBundleContext(bundle.getBundleContext());
|
||||
initializer.setInitializerId(id);
|
||||
initializer.init();
|
||||
if (!InitManager.this.skipAll) {
|
||||
clazz = cl.loadClass(className);
|
||||
log.info("Loaded class {}", clazz.getName());
|
||||
Constructor<?> constructor = clazz.getConstructor();
|
||||
Initializer initializer = (Initializer) constructor.newInstance();
|
||||
initializer.setBundleContext(bundle.getBundleContext());
|
||||
initializer.setInitializerId(id);
|
||||
initializer.init();
|
||||
}
|
||||
InitManager.this.updateById(id, true);
|
||||
this.executed = true;
|
||||
this.notifyDependent();
|
||||
@ -254,7 +261,7 @@ public class InitManager {
|
||||
|
||||
@Override
|
||||
public void inited(Initializer owner) {
|
||||
log.info("Initializer with id {} notified of successful init via callback");
|
||||
log.info("Initializer with id {} notified of successful init via callback", id);
|
||||
InitManager.this.updateById(id, true);
|
||||
this.executed = true;
|
||||
this.notifyDependent();
|
||||
@ -344,6 +351,9 @@ public class InitManager {
|
||||
if (!getValueById(this.getClass().getName())){
|
||||
updateById(this.getClass().getName(), true);
|
||||
}
|
||||
|
||||
this.skipAll = getValueById(PROP_SKIP_ALL);
|
||||
|
||||
}
|
||||
|
||||
protected InitializerMeta createMeta(String initializerMeta, Bundle bundle) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* init-manager
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* init-manager
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* init-manager
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* init-manager
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
Reference in New Issue
Block a user