Methods Summary |
---|
protected AbstractLoader | getLoader(java.lang.String moduleId)Returns loader
return new ApplicationClientModuleLoader(
moduleId,
this.parentClassLoader,
(AppclientModulesManager) this.configManager);
|
public synchronized void | moduleDeployed(com.sun.enterprise.admin.event.ModuleDeployEvent event)Invoked when a standalone application client module is deployed.
boolean jsr77 = false;
if (_logger.isLoggable(Level.FINEST)) {
_logger.log(Level.FINEST,
"In StandAloneAppClientModulesManager moduleDeployed");
_logger.log(Level.FINEST, "ModuleType=" + event.getModuleType());
}
if (event.getModuleType().equals(event.TYPE_APPCLIENT)) {
DeployEventListenerHelper.getDeployEventListenerHelper().synchronize(event);
String modID = event.getModuleName();
if (_logger.isLoggable(Level.FINEST)) {
_logger.log(Level.FINEST, "modID=" + modID);
}
try {
// refreshes the config context with the context from this event
this.configManager.refreshConfigContext(event.getConfigContext());
// set jsr77 flag
// which is used to signify if the event is deploy or undeploy
// to create or delete jsr77 mBeans
String action = event.getAction();
if ((action.equals(BaseDeployEvent.DEPLOY)) ||
(action.equals(BaseDeployEvent.REDEPLOY))) {
jsr77 = true;
}
if (!moduleDeployed(jsr77, modID, event.getConfigContext())) {
// throw an exception if load fails
String msg = localStrings.getString("appClientModule deploy failed",
modID);
throw new AdminEventListenerException(msg);
}
} catch (ConfigException ce) {
throw new AdminEventListenerException(ce.getMessage());
}
}
|
private boolean | moduleDeployed(boolean jsr77, java.lang.String modID, com.sun.enterprise.config.ConfigContext dynamicConfigContext)Deployed event handling
boolean result = false;
boolean loadJSR77 = jsr77 || loadJSR77(modID, DeployableObjectType.CAR);
try {
AbstractLoader modLoader = getLoader(modID);
// create root mBean for this module
if (loadJSR77) {
try {
modLoader.createRootMBean();
} catch (MBeanException mbe) {
_logger.log(Level.WARNING,
"core.error_while_creating_jsr77_root_mbean",mbe);
}
}
modLoader.setConfigContext(dynamicConfigContext);
result = modLoader.load(loadJSR77);
if (result) {
this.id2loader.put(modID, modLoader);
}
} catch (Exception ce) {
_logger.log(Level.WARNING,
"core.error_while_loading_application_client_module",ce);
result = false;
}
return result;
|
public synchronized void | moduleDisabled(com.sun.enterprise.admin.event.ModuleDeployEvent event)Invoked when a standalone application client module is disabled.
if (_logger.isLoggable(Level.FINEST)) {
_logger.log(Level.FINEST,
"In StandAloneAppClientModulesManager moduleDisabled");
}
// for an application client module
// the operations enable/disable or start/stop do not make sense
return;
|
public synchronized void | moduleEnabled(com.sun.enterprise.admin.event.ModuleDeployEvent event)Invoked when a standalone application client module is enabled.
if (_logger.isLoggable(Level.FINEST)) {
_logger.log(Level.FINEST,
"In StandAloneAppClientModulesManager moduleEnabled");
}
// for an application client module
// the operations enable/disable or start/stop do not make sense
return;
|
public synchronized void | moduleRedeployed(com.sun.enterprise.admin.event.ModuleDeployEvent event)Invoked when a standalone application client module is redeployed.
if (_logger.isLoggable(Level.FINEST)) {
_logger.log(Level.FINEST,
"In StandAloneAppClientModulesManager moduleRedeployed");
}
if (event.getModuleType().equals(event.TYPE_APPCLIENT)) {
String modID = event.getModuleName();
if (_logger.isLoggable(Level.FINEST)) {
_logger.log(Level.FINEST, "ReDeploying module: " + modID);
}
moduleUndeployed(event);
moduleDeployed(event);
}
|
public void | moduleReferenceAdded(com.sun.enterprise.admin.event.ModuleDeployEvent event)Invoked when a reference is created from a
server instance (or cluster) to a particular module.
|
public void | moduleReferenceRemoved(com.sun.enterprise.admin.event.ModuleDeployEvent event)Invoked when a reference is removed from a
server instance (or cluster) to a particular module.
|
public synchronized void | moduleUndeployed(com.sun.enterprise.admin.event.ModuleDeployEvent event)Invoked when a standalone application client module is undeployed.
boolean jsr77 = false;
if (_logger.isLoggable(Level.FINEST)) {
_logger.log(Level.FINEST,
"In StandAloneAppClientModulesManager moduleUndeployed");
}
String action = event.getAction();
if ((action.equals(BaseDeployEvent.UNDEPLOY)) ||
(action.equals(BaseDeployEvent.REDEPLOY))) {
jsr77 = true;
}
try {
if (event.getModuleType().equals(event.TYPE_APPCLIENT)) {
String modID = event.getModuleName();
if (_logger.isLoggable(Level.FINEST)) {
_logger.log(Level.FINEST, "UnDeploying module: " + modID);
}
// unload and throw exception if it fails
if (!moduleUndeployed(jsr77, modID)) {
String msg = localStrings.getString("appclient.appclient_undeployed_failed",
modID);
throw new AdminEventListenerException(msg);
}
}
} catch (Exception e) {
throw new AdminEventListenerException(e.getMessage());
}
|
private boolean | moduleUndeployed(boolean jsr77, java.lang.String modID)Undeployed event handling
boolean result = false;
try {
ApplicationClientModuleLoader modLoader =
(ApplicationClientModuleLoader) this.id2loader.remove(modID);
if (modLoader == null) {
return true;
}
// delete root mBean for this module
if (jsr77) {
try {
modLoader.deleteRootMBean();
} catch (MBeanException mbe) {
_logger.log(Level.WARNING,
"core.error_while_deleting_jsr77_root_mbean",mbe);
}
}
result = modLoader.unload(jsr77);
} catch (Exception ce) {
_logger.log(Level.WARNING,
"core.error_while_unloading_application_client_module",ce);
result = false;
}
return result;
|