try {
modLoader.createRootMBean();
} catch (MBeanException mbe) {
_logger.log(Level.WARNING,
"core.error_while_creating_jsr77_root_mbean",mbe);
throw new AdminEventListenerException(mbe.getMessage());
}
}
if (isEnabled(config, moduleName)) {
if (_logger.isLoggable(Level.FINEST)) {
_logger.log(Level.FINEST,
"Loading enabled moduleName: " + moduleName);
}
// set jsr77 state STARTING
try {
modLoader.setState(StateManageable.STARTING_STATE);
} catch (MBeanException mbe) {
_logger.log(Level.WARNING,
"core.error_while_setting_jsr77_state",mbe);
}
boolean retSts = modLoader.load(jsr77);
if (retSts) {
this.id2loader.put(moduleName, modLoader);
// set jsr77 state to RUNNING
try {
modLoader.setState(StateManageable.RUNNING_STATE);
} catch (MBeanException mbe) {
_logger.log(Level.WARNING,
"core.error_while_setting_jsr77_state",mbe);
}
result = true;
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE,
"Successfully loaded moduleName: " + moduleName);
}
} else {
_logger.log(Level.WARNING,
"core.error_while_loading_connector_module" + " " +
moduleName);
// delete root and leaf mBeans if it is a deploy event
try {
if (loadJSR77) {
modLoader.deleteLeafAndRootMBeans();
}
} catch (MBeanException mbe) {
_logger.log(Level.WARNING,
"core.error_while_deleting_jsr77_leaf_and_root_mbeans",mbe);
throw new AdminEventListenerException(mbe.getMessage());
}
// set jsr77 state to FAILED
try {
modLoader.setState(StateManageable.FAILED_STATE);
} catch (MBeanException mbe) {
_logger.log(Level.WARNING,
"core.error_while_setting_jsr77_state",mbe);
}
String msg = localStrings.getString(
"connector.error_while_loading_connector_module", moduleName);
throw new AdminEventListenerException(msg);
}
} else {
//setting result to false if module is not enabled.
result = false;
}