82 unloadAll(); |
82 unloadAll(); |
83 } |
83 } |
84 |
84 |
85 private Optional<LightPITModule> getModuleInfo(Registration reg) { |
85 private Optional<LightPITModule> getModuleInfo(Registration reg) { |
86 try { |
86 try { |
87 final Class scclass = Class.forName(reg.getClassName()); |
87 final Class<?> scclass = Class.forName(reg.getClassName()); |
88 |
88 |
89 final boolean lpservlet = AbstractLightPITServlet.class.isAssignableFrom(scclass); |
89 final boolean lpservlet = AbstractLightPITServlet.class.isAssignableFrom(scclass); |
90 final boolean lpmodule = scclass.isAnnotationPresent(LightPITModule.class); |
90 final boolean lpmodule = scclass.isAnnotationPresent(LightPITModule.class); |
91 |
91 |
92 if (lpservlet && !lpmodule) { |
92 if (lpservlet && !lpmodule) { |
101 AbstractLightPITServlet.class.getSimpleName() |
101 AbstractLightPITServlet.class.getSimpleName() |
102 ); |
102 ); |
103 } |
103 } |
104 |
104 |
105 if (lpservlet && lpmodule) { |
105 if (lpservlet && lpmodule) { |
106 final Class<? extends AbstractLightPITServlet> clazz = scclass; |
106 final LightPITModule moduleInfo = scclass.getAnnotation(LightPITModule.class); |
107 final LightPITModule moduleInfo = clazz.getAnnotation(LightPITModule.class); |
|
108 return Optional.of(moduleInfo); |
107 return Optional.of(moduleInfo); |
109 } else { |
108 } else { |
110 return Optional.empty(); |
109 return Optional.empty(); |
111 } |
110 } |
112 } catch (ClassNotFoundException ex) { |
111 } catch (ClassNotFoundException ex) { |