git-svn-id: http://svn.research-infrastructures.eu/d4science/gcube/branches/common/common-smartgears-app/2.0@132711 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a8cdc9e6de
commit
527ce352ed
10
pom.xml
10
pom.xml
|
@ -36,9 +36,15 @@
|
|||
<dependency>
|
||||
<groupId>org.reflections</groupId>
|
||||
<artifactId>reflections</artifactId>
|
||||
<version>0.9.9-RC1</version>
|
||||
<version>0.9.10</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>18.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.core</groupId>
|
||||
<artifactId>common-smartgears</artifactId>
|
||||
|
|
|
@ -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<Class<?>> toInitialize = reflection.getTypesAnnotatedWith(ManagedBy.class);
|
||||
Set<Class<? extends ApplicationManager>> managers = new HashSet<Class<? extends ApplicationManager>>();
|
||||
for (Class<?> initializer: toInitialize ){
|
||||
|
|
Loading…
Reference in New Issue