public static boolean multicastEvent(int eventType, String entityName,
String moduleType , boolean cascade, boolean forceDeploy, int loadUnloadAction, String targetName) throws DeploymentException
{
//String name = getInstanceName();
AdminEvent event = null;
EventBuilder builder = new EventBuilder();
//XXX Can we put the following 4 lines be done in the EventBuilder?
EventStack stack = EventContext.getEventStackFromThreadLocal();
ConfigContext ctx = stack.getConfigContext();
stack.setTarget(targetName);
stack.setConfigChangeList(ctx.getConfigChangeList());
try{
if (eventType == BaseDeployEvent.APPLICATION_DEPLOYED)
{
event = builder.createApplicationDeployEvent(
BaseDeployEvent.DEPLOY, entityName, false, forceDeploy,
loadUnloadAction);
}
else if (eventType == BaseDeployEvent.APPLICATION_UNDEPLOYED)
{
event = builder.createApplicationDeployEvent(
BaseDeployEvent.UNDEPLOY, entityName, cascade, forceDeploy, loadUnloadAction);
}
else if (eventType == BaseDeployEvent.APPLICATION_REDEPLOYED)
{
event = builder.createApplicationDeployEvent(
BaseDeployEvent.REDEPLOY, entityName, false, forceDeploy,
loadUnloadAction);
}
else if (eventType == BaseDeployEvent.MODULE_DEPLOYED)
{
event = builder.createModuleDeployEvent(
BaseDeployEvent.DEPLOY, entityName, moduleType, cascade, forceDeploy);
}
else if (eventType == BaseDeployEvent.MODULE_UNDEPLOYED)
{
event = builder.createModuleDeployEvent(
BaseDeployEvent.UNDEPLOY, entityName, moduleType, cascade, forceDeploy);
}
else if (eventType == BaseDeployEvent.MODULE_REDEPLOYED)
{
event = builder.createModuleDeployEvent(
BaseDeployEvent.REDEPLOY, entityName, moduleType);
}
else if (eventType == BaseDeployEvent.APPLICATION_ENABLE)
{
event = builder.createApplicationDeployEvent(
BaseDeployEvent.ENABLE, entityName, false, forceDeploy,
loadUnloadAction);
}
else if (eventType == BaseDeployEvent.APPLICATION_DISABLE)
{
event = builder.createApplicationDeployEvent(
BaseDeployEvent.DISABLE, entityName, false, forceDeploy,
loadUnloadAction);
}
else if(eventType == BaseDeployEvent.MODULE_ENABLE)
{
event = builder.createModuleDeployEvent(
BaseDeployEvent.ENABLE, entityName, moduleType, false, forceDeploy);
}
else if(eventType == BaseDeployEvent.MODULE_DISABLE)
{
event = builder.createModuleDeployEvent(
BaseDeployEvent.DISABLE, entityName, moduleType, false, forceDeploy);
}
else if(eventType == BaseDeployEvent.APPLICATION_REFERENCED)
{
event = builder.createApplicationDeployEvent(
BaseDeployEvent.ADD_REFERENCE, entityName, false, forceDeploy, loadUnloadAction);
}
else if(eventType == BaseDeployEvent.APPLICATION_UNREFERENCED)
{
event = builder.createApplicationDeployEvent(
BaseDeployEvent.REMOVE_REFERENCE, entityName, false, forceDeploy, loadUnloadAction);
}
else if (eventType == CONFIG_CHANGED)
{
event = builder.createConfigChangeEvent(targetName, null);
}
else
{
String msg =
localStrings.getString( "admin.server.core.mbean.config.no_such_event",