} catch (InterruptedException e) {
}
// get or create WGADeployment
String wgaDistributionName = runtime.getWGADistributionName();
WGADeployment wgaDeployment = null;
if (wgaDistributionName == null) {
throw new IOException("No WGA distribution configured for runtime '" + runtime.getName() + "'.");
} else {
wgaDeployment = WGADesignerPlugin.getDefault().getWGADeploymentManager().getDeployment(wgaDistributionName);
}
if (wgaDeployment == null) {
throw new IOException("WGADeployment '" + wgaDistributionName + "' for runtime '" + runtime.getName() + "' not found.");
}
Map<String,String> variables = new HashMap<String,String>();
variables.put("workspace_loc", runtime.getProject().getWorkspace().getRoot().getLocation().toFile().getAbsolutePath());
variables.put("project_loc", runtime.getProject().getLocation().toFile().getAbsolutePath());
variables.put("wga_appbase", wgaDeployment.getWebappDir().getAbsolutePath());
variables.put("wga_workdir", wgaDeployment.getWorkDir().getAbsolutePath());
IPreferenceStore store = WGADesignerPlugin.getDefault().getPreferenceStore();
variables.put("tomcat_server_port", Integer.toString(store.getInt(PreferenceConstants.TOMCAT_SERVER_PORT)));
variables.put("tomcat_http_port", Integer.toString(store.getInt(PreferenceConstants.TOMCAT_HTTP_PORT)));
variables.put("tomcat_redirect_port", Integer.toString(store.getInt(PreferenceConstants.TOMCAT_REDIRECT_PORT)));