From 527ce352ed8cb782b6ba15d0dea13d69d5f693d7 Mon Sep 17 00:00:00 2001 From: Lucio Lelii Date: Wed, 5 Oct 2016 13:15:22 +0000 Subject: [PATCH] git-svn-id: http://svn.research-infrastructures.eu/d4science/gcube/branches/common/common-smartgears-app/2.0@132711 82a268e6-3cf1-43bd-a215-b396298e98cf --- pom.xml | 10 ++++++++-- .../java/org/gcube/smartgears/ContextListener.java | 7 +++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 244b81c..8cd4e3e 100644 --- a/pom.xml +++ b/pom.xml @@ -36,9 +36,15 @@ org.reflections reflections - 0.9.9-RC1 + 0.9.10 - + + + com.google.guava + guava + 18.0 + + org.gcube.core common-smartgears diff --git a/src/main/java/org/gcube/smartgears/ContextListener.java b/src/main/java/org/gcube/smartgears/ContextListener.java index d9ec729..1fc582f 100644 --- a/src/main/java/org/gcube/smartgears/ContextListener.java +++ b/src/main/java/org/gcube/smartgears/ContextListener.java @@ -10,6 +10,7 @@ import javax.servlet.annotation.WebListener; import org.gcube.smartgears.annotations.ManagedBy; import org.gcube.smartgears.context.application.ApplicationContext; import org.reflections.Reflections; +import org.reflections.scanners.SubTypesScanner; import org.reflections.scanners.TypeAnnotationsScanner; import org.reflections.util.ClasspathHelper; import org.reflections.util.ConfigurationBuilder; @@ -43,8 +44,10 @@ public class ContextListener implements ServletContextListener { private void retrieveAndRegisterManagers(ApplicationContext context) { - Reflections reflection = new ConfigurationBuilder().addUrls(ClasspathHelper.forClassLoader()).setScanners(new TypeAnnotationsScanner()).build(); - + ConfigurationBuilder reflectionConf = new ConfigurationBuilder().addUrls(ClasspathHelper.forClassLoader()).setScanners(new TypeAnnotationsScanner(), new SubTypesScanner()); + + Reflections reflection = new Reflections(reflectionConf); + Set> toInitialize = reflection.getTypesAnnotatedWith(ManagedBy.class); Set> managers = new HashSet>(); for (Class initializer: toInitialize ){