From e0af8b8a4fe013efc15e3bbec34acc7d134c2126 Mon Sep 17 00:00:00 2001 From: Lucio Lelii Date: Wed, 11 Oct 2017 16:17:52 +0000 Subject: [PATCH] git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/wps@155159 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../analysis/wps/repository/GcubeAlgorithmRepository.java | 7 ++++++- src/main/webapp/WEB-INF/README | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gcube/data/analysis/wps/repository/GcubeAlgorithmRepository.java b/src/main/java/org/gcube/data/analysis/wps/repository/GcubeAlgorithmRepository.java index 4473c84..8353506 100644 --- a/src/main/java/org/gcube/data/analysis/wps/repository/GcubeAlgorithmRepository.java +++ b/src/main/java/org/gcube/data/analysis/wps/repository/GcubeAlgorithmRepository.java @@ -30,11 +30,13 @@ public class GcubeAlgorithmRepository implements IAlgorithmRepository { log.info("gcube algorithm repository started"); if (updater==null) throw new RuntimeException("GcubeAlgorithmRepository cannot be initialized: updater is null"); updater.init(); + Thread.currentThread().setContextClassLoader(updater.getLoader()); updateRepository(); updater.startWhatcher(); } public ProcessDescriptionType getProcessDescription(String identifier){ + Thread.currentThread().setContextClassLoader(updater.getLoader()); updateRepository(); log.info("getProcessDescription with identifier {} ",identifier); try{ @@ -49,6 +51,7 @@ public class GcubeAlgorithmRepository implements IAlgorithmRepository { } public boolean containsAlgorithm(String identifier) { + Thread.currentThread().setContextClassLoader(updater.getLoader()); updateRepository(); log.info("containsAlgorithm with identifier {} ",identifier); Set> classes = reflection.getTypesAnnotatedWith(Algorithm.class); @@ -61,6 +64,7 @@ public class GcubeAlgorithmRepository implements IAlgorithmRepository { } public IAlgorithm getAlgorithm(String identifier){ + Thread.currentThread().setContextClassLoader(updater.getLoader()); updateRepository(); log.info("getAlgorithm with identifier {} ",identifier); try{ @@ -80,13 +84,13 @@ public class GcubeAlgorithmRepository implements IAlgorithmRepository { } public static Set> getAllAlgorithms() { + Thread.currentThread().setContextClassLoader(updater.getLoader()); updateRepository(); return reflection.getTypesAnnotatedWith(Algorithm.class); } private static synchronized void updateRepository(){ if (reflection==null || updater.mustUpdate()){ - Thread.currentThread().setContextClassLoader(updater.getLoader()); log.info("updating repository ({}) ",updater.mustUpdate()); updater.reset(); ConfigurationBuilder confBuilder = new ConfigurationBuilder() @@ -98,6 +102,7 @@ public class GcubeAlgorithmRepository implements IAlgorithmRepository { @Override public Collection getAlgorithmNames() { + Thread.currentThread().setContextClassLoader(updater.getLoader()); updateRepository(); Collection toReturn = new ArrayList(); Set> classes = reflection.getTypesAnnotatedWith(Algorithm.class); diff --git a/src/main/webapp/WEB-INF/README b/src/main/webapp/WEB-INF/README index 77c91ca..89e12de 100644 --- a/src/main/webapp/WEB-INF/README +++ b/src/main/webapp/WEB-INF/README @@ -25,7 +25,7 @@ no. 654119), SoBigData (grant no. 654024); Version -------------------------------------------------- -1.1.0-SNAPSHOT (${maven.build.timestamp}) +1.1.0-SNAPSHOT (2017-10-11) Please see the file named "changelog.xml" in this directory for the release notes.