for(OperationalString opString : opstrings) {
if(opstringNames.length()>0)
opstringNames.append(", ");
opstringNames.append(opString.getName());
}
final JDialog dialog = new WaitingDialog(frame,
"Deploying "+opstringNames.toString()+"...",
500);
SwingWorker worker = new SwingWorker() {
public Object construct() {
try {
ProvisionMonitor monitor = (ProvisionMonitor) item.service;
DeployAdmin dAdmin = (DeployAdmin) monitor.getAdmin();
for (OperationalString opString : opstrings) {
if (dAdmin.hasDeployed(opString.getName())) {
int result = JOptionPane.showConfirmDialog(frame,
"The [" + opString.getName() + "] " +
"is already deployed, " +
"update the deployment?",
"Update Deployed Application",
JOptionPane.YES_NO_OPTION);
if (result == JOptionPane.YES_OPTION) {
dAdmin.getOperationalStringManager(opString.getName()).update(opString);
}
} else {
dAdmin.deploy(opString);
}
}
} catch (Exception e) {
e.printStackTrace();
Util.showError(e, frame, "Failure trying to deploy " + deployName);
}
return null;
}
@Override
public void finished() {
dialog.dispose();
}
};
worker.start();
}