* @param moduleName The name of the component (application or module)
* @return boolean
*/
protected boolean isEnabled (ConfigContext config, String moduleName) {
try {
ConfigBean app = ApplicationHelper.findApplication(config, moduleName);
Server server = ServerBeansFactory.getServerBean(config);
ApplicationRef appRef = server.getApplicationRefByRef(moduleName);
return ((app != null && app.isEnabled()) &&
(appRef != null && appRef.isEnabled()));
} catch (ConfigException e) {
AdminEventListenerException ex = new AdminEventListenerException();
ex.initCause(e);
_logger.log(Level.FINE, "Error in finding " + moduleName, e);