[323375] [backport] fix for bug 296576 in 3.0 and 3.1 branches for WTP
diff --git a/features/org.eclipse.jst.server_core.feature.patch/buildnotes_org.eclipse.jst.server_core.feature.patch.html b/features/org.eclipse.jst.server_core.feature.patch/buildnotes_org.eclipse.jst.server_core.feature.patch.html
index bdbb7ab..6cac857 100644
--- a/features/org.eclipse.jst.server_core.feature.patch/buildnotes_org.eclipse.jst.server_core.feature.patch.html
+++ b/features/org.eclipse.jst.server_core.feature.patch/buildnotes_org.eclipse.jst.server_core.feature.patch.html
@@ -15,4 +15,5 @@
 
 <p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=294664'>294664</a>. Classpath entry attributes lost when updating runtime classpath container</p>
 <p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=295494'>295494</a>. RuntimeClasspathContainer should update runtime if it is null</p>
+<p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=323375'>323375</a>. [backport] fix for bug 296576 in 3.0 and 3.1 branches for WTP</p>
 </body></html>
\ No newline at end of file
diff --git a/features/org.eclipse.jst.server_core.feature.patch/feature.properties b/features/org.eclipse.jst.server_core.feature.patch/feature.properties
index 703ef92..4d250e6 100644
--- a/features/org.eclipse.jst.server_core.feature.patch/feature.properties
+++ b/features/org.eclipse.jst.server_core.feature.patch/feature.properties
@@ -32,6 +32,7 @@
 \n\
 Bug https://bugs.eclipse.org/294664 Classpath entry attributes lost when updating runtime classpath container\n\
 Bug https://bugs.eclipse.org/295494 RuntimeClasspathContainer should update runtime if it is null\n\
+Bug https://bugs.eclipse.org/323375 [backport] fix for bug 296576 in 3.0 and 3.1 branches for WTP\n\
 \n\
 # "copyright" property - text of the "Feature Update Copyright"
 copyright=\
diff --git a/features/org.eclipse.wst.server_core.feature.patch/buildnotes_org.eclipse.wst.server_core.feature.patch.html b/features/org.eclipse.wst.server_core.feature.patch/buildnotes_org.eclipse.wst.server_core.feature.patch.html
index 5813422..fea027f 100644
--- a/features/org.eclipse.wst.server_core.feature.patch/buildnotes_org.eclipse.wst.server_core.feature.patch.html
+++ b/features/org.eclipse.wst.server_core.feature.patch/buildnotes_org.eclipse.wst.server_core.feature.patch.html
@@ -25,5 +25,6 @@
 <p>Bug <a href='https://bugs.eclipse.org/322968'>322968</a>. The ability to update server's launch is required</p>
 <p>Bug <a href='https://bugs.eclipse.org/323658'>323658</a>. NPE- modules variable not initialized when API called during automated scenario</p>
 <p>Bug <a href='https://bugs.eclipse.org/309781'>309781</a>. Deadlock during debugging</p>
+<p>Bug <a href='https://bugs.eclipse.org/327806'>327806</a>. Backport the 311794</p>
 
 </body></html>
\ No newline at end of file
diff --git a/features/org.eclipse.wst.server_core.feature.patch/feature.properties b/features/org.eclipse.wst.server_core.feature.patch/feature.properties
index a7e8ffa..f5091bf 100644
--- a/features/org.eclipse.wst.server_core.feature.patch/feature.properties
+++ b/features/org.eclipse.wst.server_core.feature.patch/feature.properties
@@ -37,6 +37,7 @@
 Bug https://bugs.eclipse.org/322968 The ability to update server's launch is required\n\
 Bug https://bugs.eclipse.org/323658 NPE- modules variable not initialized when API called during automated scenario\n\
 Bug https://bugs.eclipse.org/309781 Deadlock during debugging\n\
+Bug https://bugs.eclipse.org/327806 Backport the 311794\n\
 \n\
 
 # "copyright" property - text of the "Feature Update Copyright"
diff --git a/plugins/org.eclipse.jst.server.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.server.core/META-INF/MANIFEST.MF
index c51cbb4..0d587d5 100644
--- a/plugins/org.eclipse.jst.server.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jst.server.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jst.server.core; singleton:=true
-Bundle-Version: 1.1.4.qualifier
+Bundle-Version: 1.1.5.qualifier
 Bundle-Activator: org.eclipse.jst.server.core.internal.JavaServerPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java
index f4f9509..a0b2a6a 100644
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java
+++ b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -58,9 +58,9 @@
 
 	private String extensionId;
 
-	private Map<String, IPath> runtimePathMap = new HashMap<String, IPath>();
+	private Map<String, IPath> runtimePathMap = Collections.synchronizedMap(new HashMap<String, IPath>());
 
-	private Map<String, Integer> previousClasspath = new HashMap<String, Integer>();
+	private Map<String, Integer> previousClasspath = Collections.synchronizedMap(new HashMap<String, Integer>());
 
 	public RuntimeClasspathProviderDelegate() {
 		// default constructor
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/TaskModel.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/TaskModel.java
index beab5c3..2b7504e 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/TaskModel.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/TaskModel.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -51,6 +51,15 @@
 	public static final String TASK_MODULES = "modules";
 
 	/**
+	 * Task model id for an array of delta kinds that maps to the modules in the TASK_MODULES.
+	 * The value is a List containing Integer for the delta kind id.
+	 * 
+	 * @see #getObject(String)
+	 * @see TaskModel#putObject(String, Object)
+	 */
+	public static final String TASK_DELTA_KINDS = "deltaKinds";
+
+	/**
 	 * Task model id for a launch mode.
 	 * 
 	 * @see #getObject(String)
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerBehaviourDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerBehaviourDelegate.java
index 51f3668..cfdb34b 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerBehaviourDelegate.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerBehaviourDelegate.java
@@ -862,7 +862,7 @@
 				tempMulti.addAll(taskStatus);
 			
 			// execute publishers
-			taskStatus = executePublishers(kind, moduleList, monitor, info2);
+			taskStatus = executePublishers(kind, moduleList, deltaKindList, monitor, info2);
 			if (taskStatus != null && !taskStatus.isOK())
 				tempMulti.addAll(taskStatus);			
 			
@@ -1073,8 +1073,29 @@
 	 *    it should minimally contain an adapter for the
 	 *    org.eclipse.swt.widgets.Shell.class
 	 * @throws CoreException
+	 * @Deprecated use ServerBehaviourDelegate.executePublishers(int kind, List<IModule[]> modules, List<Integer> deltaKinds, IProgressMonitor monitor, IAdaptable info)
 	 */
 	protected MultiStatus executePublishers(int kind, List<IModule[]> modules, IProgressMonitor monitor, IAdaptable info) throws CoreException {
+		return executePublishers(kind, modules, null, monitor, info);
+	}
+
+	/**
+	 * Execute publishers.
+	 * 
+	 * @param kind the publish kind
+	 * @param modules the list of modules
+	 * @param deltaKinds the list of delta kind that maps to the list of modules
+	 * @param monitor a progress monitor, or <code>null</code> if progress
+	 *    reporting and cancellation are not desired
+	 * @param info the IAdaptable (or <code>null</code>) provided by the
+	 *    caller in order to supply UI information for prompting the
+	 *    user if necessary. When this parameter is not <code>null</code>,
+	 *    it should minimally contain an adapter for the
+	 *    org.eclipse.swt.widgets.Shell.class
+	 * @throws CoreException
+	 * @since 1.1
+	 */
+	protected MultiStatus executePublishers(int kind, List<IModule[]> modules, List<Integer> deltaKinds, IProgressMonitor monitor, IAdaptable info) throws CoreException {
 		Publisher[] publishers = ((Server)getServer()).getEnabledPublishers();
 		int size = publishers.length;
 		Trace.trace(Trace.FINEST, "Executing publishers: " + size);
@@ -1087,6 +1108,9 @@
 		TaskModel taskModel = new TaskModel();
 		taskModel.putObject(TaskModel.TASK_SERVER, getServer());
 		taskModel.putObject(TaskModel.TASK_MODULES, modules);
+		if (deltaKinds != null) {
+			taskModel.putObject(TaskModel.TASK_DELTA_KINDS, deltaKinds);
+		}
 		
 		for (int i = 0; i < size; i++) {
 			Publisher pub = publishers[i];