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

changeset 11
737ab27e37b3
parent 10
89e3e6e28b69
child 18
a94b172c3a93
equal deleted inserted replaced
10:89e3e6e28b69 11:737ab27e37b3
105 ); 105 );
106 return Optional.empty(); 106 return Optional.empty();
107 } 107 }
108 } 108 }
109 109
110 private void addModuleToMenu(LightPITModule moduleInfo) { 110 private void addModuleToMenu(String moduleClassName, LightPITModule moduleInfo) {
111 final Menu menu = new Menu( 111 final Menu menu = new Menu(
112 moduleClassName,
112 new ResourceKey(moduleInfo.bundleBaseName(), moduleInfo.menuKey()), 113 new ResourceKey(moduleInfo.bundleBaseName(), moduleInfo.menuKey()),
113 moduleInfo.modulePath() 114 moduleInfo.modulePath()
114 ); 115 );
115 mainMenu.add(menu); 116 mainMenu.add(menu);
116 } 117 }
117 118
118 private void handleServletRegistration(String name, Registration reg) { 119 private void handleServletRegistration(String name, Registration reg) {
119 final Optional<LightPITModule> moduleInfo = getModuleInfo(reg); 120 final Optional<LightPITModule> moduleInfo = getModuleInfo(reg);
120 if (moduleInfo.isPresent()) { 121 if (moduleInfo.isPresent()) {
121 addModuleToMenu(moduleInfo.get()); 122
123 // TODO: remove this call and add the module to some dependency resolver, first
124 addModuleToMenu(reg.getClassName(), moduleInfo.get());
122 125
123 LOG.info("Module detected: {}", name); 126 LOG.info("Module detected: {}", name);
124 } else { 127 } else {
125 LOG.debug("Servlet {} is no module, skipping.", name); 128 LOG.debug("Servlet {} is no module, skipping.", name);
126 } 129 }

mercurial