if (enabledApps.size()>0) {
try {
ConfigSupport.apply(new ConfigCode() {
public Object run(ConfigBeanProxy... configBeanProxies) throws PropertyVetoException, TransactionFailure {
for (ConfigBeanProxy proxy : configBeanProxies) {
Application app = (Application) proxy;
app.setEnabled(Boolean.FALSE.toString());
}
return null;
}
}, enabledApps.toArray(new Application[enabledApps.size()]));
} catch(TransactionFailure tf) {
logger.log(Level.SEVERE, "Exception while disabling applications", tf);
return;
}
}
// start the application server
appservStartup.start();
initializeSigTypeList();
// redeploy all existing applications
for (Application app : applications.getApplications()) {
// we don't need to redeploy lifecycle modules
if (Boolean.valueOf(app.getDeployProperties().getProperty
(ServerTags.IS_LIFECYCLE))) {
continue;
}
logger.log(Level.INFO, "Redeploy application " + app.getName() + " located at " + app.getLocation());
// we let upgrade proceed even if one application
// failed to redeploy
redeployApp(app);
}
// re-enables all applications.
// we need to use the names in the enabledAppNames to find all
// the application refs that need to be re-enabled
// as the previous application collected not longer exist
// after redeployment
if (enabledAppNames.size()>0) {
for (Application app : domain.getApplications().getApplications()) {
if (enabledAppNames.contains(app.getName())) {
logger.log(Level.INFO, "Enabling application " + app.getName());
try {
ConfigSupport.apply(new SingleConfigCode<Application>() {
public Object run(Application param) throws PropertyVetoException, TransactionFailure {
if (!Boolean.parseBoolean(param.getEnabled())) {
param.setEnabled(Boolean.TRUE.toString());