diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 1075470..62a73ee 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,12 +1,14 @@ - + + - + + @@ -14,14 +16,16 @@ - + + - + + diff --git a/src/main/java/org/gcube/smartgears/application/manager/OnlineObserver.java b/src/main/java/org/gcube/smartgears/application/manager/OnlineObserver.java index d0f5efb..778691c 100644 --- a/src/main/java/org/gcube/smartgears/application/manager/OnlineObserver.java +++ b/src/main/java/org/gcube/smartgears/application/manager/OnlineObserver.java @@ -127,7 +127,7 @@ public class OnlineObserver implements AppManagerObserver{ @Override public ApplicationManager call() throws Exception { log.info("on init called"); - SecretManagerProvider.instance.set(secret); + SecretManagerProvider.set(secret); ApplicationManager manager = null; try { manager = managerClass.getDeclaredConstructor().newInstance(); @@ -136,7 +136,7 @@ public class OnlineObserver implements AppManagerObserver{ } catch (Exception e) { log.warn("error on onInit of {} on context {}",manager.getClass().getCanonicalName(), secret.getContext(), e); } finally{ - SecretManagerProvider.instance.reset(); + SecretManagerProvider.reset(); } return manager; } @@ -154,14 +154,14 @@ public class OnlineObserver implements AppManagerObserver{ @Override public void run() { - SecretManagerProvider.instance.set(secret); + SecretManagerProvider.set(secret); try { log.info("calling on ShutDown of {} on context {}",appManager.getClass().getCanonicalName(), secret.getContext()); appManager.get().onShutdown(); } catch (Exception e) { log.warn("error on onShutdown of {} on context {}",appManager.getClass().getCanonicalName(), secret.getContext(), e); } finally{ - SecretManagerProvider.instance.reset(); + SecretManagerProvider.reset(); } } } diff --git a/src/main/java/org/gcube/smartgears/application/manager/OnlineProvider.java b/src/main/java/org/gcube/smartgears/application/manager/OnlineProvider.java index 6266646..a2b2bd7 100644 --- a/src/main/java/org/gcube/smartgears/application/manager/OnlineProvider.java +++ b/src/main/java/org/gcube/smartgears/application/manager/OnlineProvider.java @@ -26,7 +26,7 @@ public class OnlineProvider extends ApplicationManagerProvider { @Override protected Future retrieveFuture(Class applicationManagerClass) { - Secret secret = SecretManagerProvider.instance.get(); + Secret secret = SecretManagerProvider.get(); String context = secret.getContext(); logger.debug("retrieving appManager {} in context {}",applicationManagerClass.getCanonicalName(), context); return appManagerMap.get(applicationManagerClass.getCanonicalName()).get(context); @@ -37,7 +37,7 @@ public class OnlineProvider extends ApplicationManagerProvider { MethodHandler handler = new MethodHandler() { @Override public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args) throws Throwable { - if (SecretManagerProvider.instance.get()==null) throw new Exception("error invoking application manager method, secret is not set in this thread"); + if (SecretManagerProvider.get()==null) throw new Exception("error invoking application manager method, secret is not set in this thread"); logger.debug("applicationManagerClass is {}",applicationManagerClass.getCanonicalName()); Future appManagerFuture = retrieveFuture(applicationManagerClass); logger.debug("appmanager future is null? {}", appManagerFuture==null);