ENTAXY-374 release 1.8.2

This commit is contained in:
2022-08-23 13:40:11 +03:00
parent b68642f81c
commit 1061b96c7e
616 changed files with 60896 additions and 3202 deletions

View File

@ -3,7 +3,7 @@
<parent>
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
<artifactId>initializer</artifactId>
<version>1.8.1</version>
<version>1.8.2</version>
</parent>
<groupId>ru.entaxy.esb.platform.runtime.core.initializer</groupId>
<artifactId>init-manager</artifactId>

View File

@ -133,7 +133,7 @@ public class InitManager {
try {
this.retries = Integer.parseInt(retriesValue);
} catch (NumberFormatException e) {
log.error("Retries paramater [{}] is not an integer", retriesValue);
log.error("Retries parameter [{}] is not an integer", retriesValue);
}
String intervalValue = params.get(Initializer.INITIALIZER_QUERY_STRING_PARAM_INTERVAL);
@ -141,7 +141,7 @@ public class InitManager {
try {
this.interval = Integer.parseInt(intervalValue);
} catch (NumberFormatException e) {
log.error("Interval paramater [{}] is not an integer", intervalValue);
log.error("Interval parameter [{}] is not an integer", intervalValue);
}
}
@ -221,6 +221,12 @@ public class InitManager {
}
public void runInitializer() {
Thread thread = new Thread(new Executor(this));
thread.setContextClassLoader(Thread.currentThread().getContextClassLoader());
thread.start();
}
public void setCallback() {
BundleWiring wiring = getBundle().adapt(BundleWiring.class);
ClassLoader cl = wiring.getClassLoader();
@ -230,7 +236,7 @@ public class InitManager {
log.info("Loaded class {}", clazz.getName());
Constructor<?> constructor = clazz.getConstructor();
Initializer initializer = (Initializer) constructor.newInstance();
initializer.setCalllback(this);
initializer.setCallback(this);
} catch (ClassNotFoundException | NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@ -241,7 +247,8 @@ public class InitManager {
synchronized (this.dependsOn) {
this.dependsOn.remove(meta.id);
if (!this.executed && this.canExecute())
this.execute();
// this.execute();
this.runInitializer();
}
}
@ -251,7 +258,7 @@ public class InitManager {
InitManager.this.updateById(id, true);
this.executed = true;
this.notifyDependent();
owner.setCalllback(null);
owner.setCallback(null);
}
};
@ -367,10 +374,12 @@ public class InitManager {
bundle.getBundleId(), bundle.getSymbolicName());
InitializerMeta meta = createMeta(initializerClass, bundle);
meta.runInitializer();
Thread thread = new Thread(new Executor(meta));
thread.setContextClassLoader(Thread.currentThread().getContextClassLoader());
thread.start();
// Thread thread = new Thread(new Executor(meta));
// thread.setContextClassLoader(Thread.currentThread().getContextClassLoader());
// thread.start();
}

View File

@ -53,7 +53,7 @@ public abstract class AbstractInitializer implements Initializer {
}
@Override
public void setCalllback(Callback callback) {
public void setCallback(Callback callback) {
// Ignore it by default
}
}

View File

@ -61,5 +61,5 @@ public interface Initializer {
public void setInitializerId(String id);
public String getInitializerId();
public void setCalllback(Initializer.Callback callback);
public void setCallback(Initializer.Callback callback);
}