Changeset 36869 for main/trunk/greenstone3/src/java
- Timestamp:
- 2022-11-01T16:40:14+13:00 (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/MessageRouter.java
r36638 r36869 1290 1290 String module_type = elem.getAttribute(GSXML.SYSTEM_MODULE_TYPE_ATT); 1291 1291 1292 if (!moduleTypeMatchesModuleInstance(module_name, module_type)) { 1293 logger.error(module_name + "is not a module of type " + module_type + ", not (de)activating it"); 1294 success = false; 1295 1296 Element s = null; 1297 1298 if (action.equals(GSXML.SYSTEM_TYPE_DEACTIVATE)) { 1299 s = GSXML.createTextElement(doc, GSXML.STATUS_ELEM, module_type + ": " + module_name + " could not be deactivated (module type and instance mismatch)", GSXML.SYSTEM_TYPE_DEACTIVATE, GSXML.ERROR); 1300 } else { 1301 s = GSXML.createTextElement(doc, GSXML.STATUS_ELEM, module_type + ": " + module_name + " could not be activated (module type and instance mismatch)", GSXML.SYSTEM_TYPE_ACTIVATE, GSXML.ERROR); 1302 } 1303 response.appendChild(s); 1304 return response; 1305 } 1306 1307 1292 1308 if (action.equals(GSXML.SYSTEM_TYPE_DEACTIVATE)) 1293 1309 { … … 1347 1363 1348 1364 } 1365 1366 protected boolean moduleTypeMatchesModuleInstance(String module_name, String module_type) 1367 { 1368 ModuleInterface m = this.module_map.get(module_name); 1369 if(m == null) { 1370 return true; // no module also means no conflict between module_type and module_name 1371 } 1372 1373 boolean moduleTypeMatchesInstance = false; 1374 if (module_type.equals(GSXML.COLLECTION_ELEM) && m instanceof Collection) { 1375 moduleTypeMatchesInstance = true; 1376 } else if(module_type.equals(GSXML.SERVICE_ELEM) && m instanceof ServiceRack) { 1377 moduleTypeMatchesInstance = true; 1378 } else if(module_type.equals(GSXML.CLUSTER_ELEM) && m instanceof ServiceCluster) { 1379 moduleTypeMatchesInstance = true; 1380 } else if(module_type.equals(GSXML.SITE_ELEM) && m instanceof Communicator) { 1381 moduleTypeMatchesInstance = true; 1382 } 1383 1384 return moduleTypeMatchesInstance; 1385 } 1349 1386 1350 1387 //* Used to copy nodes from one message to another. E.g. copy a response node to the next request. Not sure if this is actually used anywhere yet... */
Note:
See TracChangeset
for help on using the changeset viewer.