|
|
|
@ -89,10 +89,13 @@ public class Bootstrap implements ServletContainerInitializer {
|
|
|
|
|
@SuppressWarnings("resource")
|
|
|
|
|
private void initialiseContainer() {
|
|
|
|
|
|
|
|
|
|
ClassLoader contextCL = Thread.currentThread().getContextClassLoader();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// TODO Ask why is needed?
|
|
|
|
|
Thread.currentThread().setContextClassLoader(ContainerManager.class.getClassLoader());
|
|
|
|
|
|
|
|
|
|
log.trace("smartgears is starting");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Get the ContainerContext. Look at DefaultProvider */
|
|
|
|
|
context = ProviderFactory.provider().containerContext();
|
|
|
|
@ -108,7 +111,7 @@ public class Bootstrap implements ServletContainerInitializer {
|
|
|
|
|
new ProcessorMetrics().bindTo(registry);
|
|
|
|
|
|
|
|
|
|
Metrics.addRegistry(registry);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Validate the configuration retrieved by ContainerContext
|
|
|
|
|
* using gcube facilities annotation based
|
|
|
|
@ -124,6 +127,8 @@ public class Bootstrap implements ServletContainerInitializer {
|
|
|
|
|
|
|
|
|
|
//we let the container continue
|
|
|
|
|
|
|
|
|
|
} finally {//restore the classloader of the current application
|
|
|
|
|
Thread.currentThread().setContextClassLoader(contextCL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -141,7 +146,7 @@ public class Bootstrap implements ServletContainerInitializer {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
// TODO Ask why is needed?
|
|
|
|
|
//Thread.currentThread().setContextClassLoader(ContainerManager.class.getClassLoader());
|
|
|
|
|
Thread.currentThread().setContextClassLoader(ContainerManager.class.getClassLoader());
|
|
|
|
|
|
|
|
|
|
manager = ContainerManager.instance;
|
|
|
|
|
|
|
|
|
|