src/java/de/uapcore/lightpit/ModuleManager.java

changeset 18
a94b172c3a93
parent 11
737ab27e37b3
child 20
bd1a76c91d5b
equal deleted inserted replaced
17:d1036b776eee 18:a94b172c3a93
29 package de.uapcore.lightpit; 29 package de.uapcore.lightpit;
30 30
31 import java.util.ArrayList; 31 import java.util.ArrayList;
32 import java.util.Collections; 32 import java.util.Collections;
33 import java.util.List; 33 import java.util.List;
34 import java.util.Objects;
34 import java.util.Optional; 35 import java.util.Optional;
35 import javax.servlet.Registration; 36 import javax.servlet.Registration;
36 import javax.servlet.ServletContext; 37 import javax.servlet.ServletContext;
37 import javax.servlet.ServletContextEvent; 38 import javax.servlet.ServletContextEvent;
38 import javax.servlet.ServletContextListener; 39 import javax.servlet.ServletContextListener;
116 mainMenu.add(menu); 117 mainMenu.add(menu);
117 } 118 }
118 119
119 private void handleServletRegistration(String name, Registration reg) { 120 private void handleServletRegistration(String name, Registration reg) {
120 final Optional<LightPITModule> moduleInfo = getModuleInfo(reg); 121 final Optional<LightPITModule> moduleInfo = getModuleInfo(reg);
121 if (moduleInfo.isPresent()) { 122 if (moduleInfo.isPresent()) {
123 // TODO: implement dependency resolver
122 124
123 // TODO: remove this call and add the module to some dependency resolver, first 125 if (!moduleInfo.get().menuKey().isEmpty()) {
124 addModuleToMenu(reg.getClassName(), moduleInfo.get()); 126 addModuleToMenu(reg.getClassName(), moduleInfo.get());
127 }
125 128
126 LOG.info("Module detected: {}", name); 129 LOG.info("Module detected: {}", name);
127 } else { 130 } else {
128 LOG.debug("Servlet {} is no module, skipping.", name); 131 LOG.debug("Servlet {} is no module, skipping.", name);
129 } 132 }

mercurial