[322292] Preparing for e4 builds
diff --git a/plugins/org.eclipse.wst.server.core/schema/installableRuntimes.exsd b/plugins/org.eclipse.wst.server.core/schema/installableRuntimes.exsd
index 2dfa416..c45c3b7 100644
--- a/plugins/org.eclipse.wst.server.core/schema/installableRuntimes.exsd
+++ b/plugins/org.eclipse.wst.server.core/schema/installableRuntimes.exsd
@@ -2,17 +2,31 @@
 <!-- Schema file written by PDE -->
 <schema targetNamespace="org.eclipse.wst.server.core" xmlns="http://www.w3.org/2001/XMLSchema">
 <annotation>
-      <appinfo>
+      <appInfo>
          <meta.schema plugin="org.eclipse.wst.server.core" id="installableRuntimes" name="Installable Runtimes"/>
-      </appinfo>
+      </appInfo>
       <documentation>
-         This extension point is used to install new runtimes (i.e. server installations) from a remote server.
+         @deprecated (since 3.3) 
+The support for InstallableRuntime has been moved to org.eclipse.wst.server.discovery
+and is now supported through the p2 repository lookup APIs
+
+This extension point is used to install new runtimes (i.e. server installations) from a remote server.
 
 New users should use the &apos;runtime&apos; element (which allows you to point to any zip file on any server) and not the original &apos;installableRuntime&apos; element (which requires a remote update manager site).
       </documentation>
    </annotation>
 
    <element name="extension">
+      <annotation>
+         <appInfo>
+            <meta.element deprecated="true" replacement="" />
+         </appInfo>
+         <documentation>
+            @deprecated (since 3.3) 
+The support for InstallableRuntime has been moved to org.eclipse.wst.server.discovery
+and is now supported through the p2 repository lookup APIs
+         </documentation>
+      </annotation>
       <complexType>
          <sequence>
             <element ref="installableRuntime" minOccurs="0" maxOccurs="unbounded"/>
@@ -44,9 +58,9 @@
 
    <element name="installableRuntime">
       <annotation>
-         <appinfo>
+         <appInfo>
             <meta.element labelAttribute="id" deprecated="true"/>
-         </appinfo>
+         </appInfo>
       </annotation>
       <complexType>
          <attribute name="id" type="string" use="required">
@@ -82,9 +96,9 @@
                <documentation>
                   the id of the bundle in which the runtime zip is in
                </documentation>
-               <appinfo>
+               <appInfo>
                   <meta.attribute deprecated="true"/>
-               </appinfo>
+               </appInfo>
             </annotation>
          </attribute>
          <attribute name="bundleVersion" type="string">
@@ -92,9 +106,9 @@
                <documentation>
                   the optional version of the bundle in which the runtime zip is in
                </documentation>
-               <appinfo>
+               <appInfo>
                   <meta.attribute deprecated="true"/>
-               </appinfo>
+               </appInfo>
             </annotation>
          </attribute>
          <attribute name="path" type="string">
@@ -102,9 +116,9 @@
                <documentation>
                   if bundleId is specified then represents the relative path of the runtime zip inside the bundle, otherwise it assumes a relative path of the runtime archive inside the feature directory
                </documentation>
-               <appinfo>
+               <appInfo>
                   <meta.attribute deprecated="true"/>
-               </appinfo>
+               </appInfo>
             </annotation>
          </attribute>
       </complexType>
@@ -112,9 +126,9 @@
 
    <element name="runtime">
       <annotation>
-         <appinfo>
+         <appInfo>
             <meta.element labelAttribute="id"/>
-         </appinfo>
+         </appInfo>
       </annotation>
       <complexType>
          <attribute name="id" type="string" use="required">
@@ -170,18 +184,18 @@
    </element>
 
    <annotation>
-      <appinfo>
+      <appInfo>
          <meta.section type="since"/>
-      </appinfo>
+      </appInfo>
       <documentation>
          &lt;b&gt;This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.&lt;/b&gt;
       </documentation>
    </annotation>
 
    <annotation>
-      <appinfo>
+      <appInfo>
          <meta.section type="examples"/>
-      </appinfo>
+      </appInfo>
       <documentation>
          The following is an example of an installable runtime extension point:
 
@@ -227,13 +241,23 @@
       </documentation>
    </annotation>
 
+   <annotation>
+      <appInfo>
+         <meta.section type="apiinfo"/>
+      </appInfo>
+      <documentation>
+         @deprecated (since 3.3) 
+The support for InstallableRuntime has been moved to org.eclipse.wst.server.discovery
+and is now supported through the p2 repository lookup APIs
 
+      </documentation>
+   </annotation>
 
 
    <annotation>
-      <appinfo>
+      <appInfo>
          <meta.section type="copyright"/>
-      </appinfo>
+      </appInfo>
       <documentation>
          Copyright (c) 2005 IBM Corporation and others.&lt;br&gt;
 All rights reserved. This program and the accompanying materials are made 
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/InstallableRuntime.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/InstallableRuntime.java
index 3b9768d..a11f697 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/InstallableRuntime.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/InstallableRuntime.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 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
@@ -10,30 +10,16 @@
  *******************************************************************************/
 package org.eclipse.wst.server.core.internal;
 
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.ConnectException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
 import org.eclipse.core.runtime.*;
 import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.update.core.*;
-import org.eclipse.update.standalone.InstallCommand;
 import org.osgi.framework.Bundle;
 /**
- * 
+ * @deprecated (since 3.3) 
+ * The support for InstallableRuntime has been moved to org.eclipse.wst.server.discovery
+ * and is now supported through the p2 repository lookup APIs
  */
 public class InstallableRuntime implements IInstallableRuntime {
 	private IConfigurationElement element;
-	
-	private static Object LOCK = new Object();
 
 	public InstallableRuntime(IConfigurationElement element) {
 		super();
@@ -110,35 +96,6 @@
 		return null;
 	}
 
-	/*
-	 * @see IInstallableRuntime#getLicense(IProgressMonitor)
-	 */
-	public String getLicense(IProgressMonitor monitor) throws CoreException {
-		String featureId = getFeatureId();
-		String featureVersion = getFeatureVersion();
-		String fromSite = getFromSite();
-		
-		if (featureId == null || featureVersion == null || fromSite == null)
-			return null;
-		
-		ISite site = InstallableRuntime.getSite(fromSite, monitor);
-		ISiteFeatureReference[] featureRefs = site.getFeatureReferences();
-		for (int i = 0; i < featureRefs.length; i++) {
-			String ver = featureRefs[i].getVersionedIdentifier().toString();
-			int ind = ver.indexOf("_");
-			if (ind >= 0)
-				ver = ver.substring(ind+1);
-			if (featureId.equals(featureRefs[i].getVersionedIdentifier().getIdentifier()) && featureVersion.equals(ver)) {
-				IFeature feature = featureRefs[i].getFeature(monitor);
-				IURLEntry license = feature.getLicense();
-				if (license != null)
-					return license.getAnnotation();
-				return null;
-			}
-		}
-		return null;
-	}
-
 	protected Bundle getBundleVersion(Bundle[] bundles, String version) {
 		if (bundles == null)
 			return null;
@@ -170,165 +127,18 @@
 		installRuntimeJob.schedule();
 	}
 
-	public static ISite getSite(String fromSite, IProgressMonitor monitor) {
-		try {
-			URL siteURL = new URL(fromSite);
-			return SiteManager.getSite(siteURL, monitor);
-		} catch (MalformedURLException e) {
-			Trace.trace(Trace.WARNING, "Could not parse site", e);
-		} catch (CoreException e) {
-			Trace.trace(Trace.WARNING, "Could not parse site", e);
-		} catch (Exception e) {
-			Trace.trace(Trace.WARNING, "Could not parse site", e);
-		}
-		return null;
-	}
-
-	public static ISite getSite(URL fromSiteURL, IProgressMonitor monitor) throws IOException {
-		try {
-			synchronized (LOCK) {
-				return SiteManager.getSite(fromSiteURL, monitor);
-			}
-		} catch (CoreException e) {
-			Trace.trace(Trace.WARNING, "Could not parse site", e);
-			throw new IOException(e.getMessage());
-		} catch (Exception e) {
-			Trace.trace(Trace.WARNING, "Could not parse site", e);
-			throw new IOException(e.getMessage());
-		}
-	}
-
-	protected static String getMirror(String fromSite, ISite site, int mirror) {
-		if (site != null) {
-			String mirrorSite = getMirror(site, mirror);
-			if (mirrorSite != null)
-				return mirrorSite;
-		}
-		// only return fromSite if this is the 0th mirror
-		if (mirror > 0)
-			return null;
-		return fromSite;
-	}
-
-	protected static String getMirror(ISite site, int mirror) {
-		// if the site is a site containing mirrors, set the fromSite to the
-		// mirrors in order site since many mirror list generators will sort the mirrors
-		// to closest geographic location
-		if (site != null && site instanceof ISiteWithMirrors) {
-			try {
-				IURLEntry[] urlEntries = ((ISiteWithMirrors) site).getMirrorSiteEntries();
-				if (urlEntries.length > mirror)
-					return urlEntries[mirror].getURL().toExternalForm();
-			} catch (CoreException e) {
-				Trace.trace(Trace.WARNING, "Could not find mirror site", e);
-			}
-		}
-		return null;
-	}
-
-	/*
-	 * @see IInstallableRuntime#install(IPath, IProgressMonitor)
-	 */
-	public void install(IPath path, IProgressMonitor monitor) throws CoreException {
-		String featureId = getFeatureId();
-		String featureVersion = getFeatureVersion();
-		String fromSite = getFromSite();
-		
-		if (featureId == null || featureVersion == null || fromSite == null)
-			return;
-		
-		int mirror = 0;
-		ISite site = getSite(fromSite, monitor);
-		fromSite = getMirror(fromSite, site, mirror);
-		
-		boolean install = false;
-		if (getBundleId() != null) {
-			install = Platform.getBundles(getBundleId(), getBundleVersion()) == null;
-		} else if (getPath() != null) {
-			install = !new File(getFeatureArchivePath()).exists();
-		}
-		
-		// download and install plugins
-		if (install) {
-			boolean complete = false;
-			while (!complete) {
-				try {
-					monitor.setTaskName("Installing feature");
-					InstallCommand command = new InstallCommand(featureId, featureVersion, fromSite, null, "false");
-					boolean b = command.run(monitor);
-					if (!b)
-						throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
-								Messages.errorInstallingServerFeature, null));
-					command.applyChangesNow();
-					complete = true;
-				} catch (ConnectException ce) {
-					mirror++;
-					fromSite = getMirror(fromSite, site, mirror);
-					if (fromSite == null)
-						complete = true;
-				} catch (Exception e) {
-					Trace.trace(Trace.SEVERE, "Error installing feature", e);
-					throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
-							NLS.bind(Messages.errorInstallingServer, e.getLocalizedMessage()), e));
-				}
-			}
-		}
-		
-		try {
-			URL url = null;
-			if (getBundleId() != null) {
-				Bundle[] bundles = Platform.getBundles(getBundleId(), getBundleVersion());
-				Bundle bundle = getBundleVersion(bundles, getBundleVersion());
-				url = bundle.getEntry(getPath());
-				url = FileLocator.resolve(url);
-			} else {
-				// data archive used so get the url of the runtime archive from inside the feature
-				url = new File(getFeatureArchivePath()).toURL();
-			}
-			
-			// unzip from bundle into path
-			InputStream in = url.openStream();
-			unzip(in, path, monitor);
-		} catch (Exception e) {
-			Trace.trace(Trace.SEVERE, "Error unzipping runtime", e);
-			throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
-					NLS.bind(Messages.errorInstallingServer, e.getLocalizedMessage()), e));
-		}
-	}
-
-	private void unzip(InputStream in, IPath path, IProgressMonitor monitor) throws IOException {
-		// unzip from bundle into path
-		BufferedInputStream bin = new BufferedInputStream(in);
-		ZipInputStream zin = new ZipInputStream(bin);
-		ZipEntry entry = zin.getNextEntry();
-		byte[] buf = new byte[8192];
-		while (entry != null) {
-			String name = entry.getName();
-			monitor.setTaskName("Unzipping: " + name);
-			
-			if (entry.isDirectory()) {
-				path.append(name).toFile().mkdirs();
-			} else {
-				FileOutputStream fout = new FileOutputStream(path.append(name).toFile());
-				int r = zin.read(buf);
-				while (r >= 0) {
-					fout.write(buf, 0, r);
-					r = zin.read(buf);
-				}
-			}
-			zin.closeEntry();
-			entry = zin.getNextEntry();
-		}
-		zin.close();
-	}
-
-	private String getFeatureArchivePath() {
-		String feature = getFeatureId() + "_" + getFeatureVersion();
-		String platformLoc = Platform.getInstallLocation().getURL().getFile();
-		return platformLoc.concat(File.separator + Site.DEFAULT_INSTALLED_FEATURE_PATH + feature + File.separator + getPath());
-	}
-
 	public String toString() {
 		return "InstallableRuntime[" + getId() + "]";
 	}
+
+	public String getLicense(IProgressMonitor monitor) throws CoreException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public void install(IPath path, IProgressMonitor monitor)
+			throws CoreException {
+		// TODO Auto-generated method stub
+		
+	}
 }
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java
index 1afce00..6af51e8 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java
@@ -1161,6 +1161,10 @@
 	 * A new array is returned on each call, so clients may store or modify the result.
 	 * </p>
 	 * 
+	 * @deprecated (since 3.3) 
+	 * The support for InstallableRuntime has been moved to org.eclipse.wst.server.discovery
+	 * and is now supported through the p2 repository lookup APIs
+	 * 
 	 * @return the array of installable runtimes {@link IInstallableRuntime}
 	 */
 	public static IInstallableRuntime[] getInstallableRuntimes() {
@@ -1176,6 +1180,10 @@
 	 * Returns the installable runtime for the given runtime type, or <code>null</code>
 	 * if none exists.
 	 * 
+	 * @deprecated (since 3.3) 
+	 * The support for InstallableRuntime has been moved to org.eclipse.wst.server.discovery
+	 * and is now supported through the p2 repository lookup APIs
+	 * 
 	 * @param runtimeTypeId a runtime type id
 	 * @return the installable runtime for the given runtime type, or <code>null</code>
 	 *    if none exists {@link IInstallableRuntime}
@@ -1203,6 +1211,9 @@
 
 	/**
 	 * Load the installable runtimes.
+	 * @deprecated (since 3.3) 
+	 * The support for InstallableRuntime has been moved to org.eclipse.wst.server.discovery
+	 * and is now supported through the p2 repository lookup APIs
 	 */
 	private static synchronized void loadInstallableRuntimes() {
 		//if (installableRuntimes != null)
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 dad47aa..bad063c 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
@@ -17,7 +17,6 @@
 import org.eclipse.core.runtime.*;
 import org.eclipse.debug.core.ILaunch;
 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.wst.server.core.*;
 import org.eclipse.wst.server.core.internal.*;