Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.jst.server.core/src')
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ClasspathRuntimeTargetHandler.java134
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/EJBBean.java217
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/FacetUtil.java75
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IApplicationClientModule.java24
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IConnectorModule.java31
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEJBModule.java24
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEnterpriseApplication.java50
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJ2EEModule.java63
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntime.java40
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntimeWorkingCopy.java32
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IUtilityModule.java61
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IWebModule.java58
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiLaunchable.java56
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiObject.java82
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/PublishUtil.java235
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java356
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ServerProfilerDelegate.java62
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/Servlet.java106
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntime.java111
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeClasspathProvider.java39
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeUtil.java41
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntime.java19
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntimeWorkingCopy.java19
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IMemento.java86
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EELaunchableClient.java36
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EEUtil.java214
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JRERuntimeComponentProvider.java34
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JavaServerPlugin.java363
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/LaunchConfigurationUtil.java56
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.java51
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.properties43
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ProgressUtil.java69
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java135
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainerInitializer.java160
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProvider.java79
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProviderWrapper.java180
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderDelegate.java33
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderWrapper.java129
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeFacetMapping.java65
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ServerProfiler.java91
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Trace.java85
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/XMLMemento.java246
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.html66
-rw-r--r--plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.xml40
44 files changed, 0 insertions, 4196 deletions
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ClasspathRuntimeTargetHandler.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ClasspathRuntimeTargetHandler.java
deleted file mode 100644
index e6bb0155c..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ClasspathRuntimeTargetHandler.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import java.io.File;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.core.*;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.model.RuntimeTargetHandlerDelegate;
-/**
- * A runtime target handler that supports changing the classpath of the
- * project by adding one or more classpath containers. Runtime providers
- * can extend this class and implement the abstract methods to provide
- * the correct build path for their runtime type.
- *
- * @deprecated Should use org.eclipse.jst.server.core.runtimeClasspathProviders
- * extension point instead
- */
-public abstract class ClasspathRuntimeTargetHandler extends RuntimeTargetHandlerDelegate {
- /** (non-Javadoc)
- * @see RuntimeTargetHandlerDelegate#setRuntimeTarget(IProject, IRuntime, IProgressMonitor)
- */
- public void setRuntimeTarget(IProject project, IRuntime runtime, IProgressMonitor monitor) throws CoreException {
- throw new RuntimeException("Attempt to use deprecated code");
- }
-
- /** (non-Javadoc)
- * @see RuntimeTargetHandlerDelegate#removeRuntimeTarget(IProject, IRuntime, IProgressMonitor)
- */
- public void removeRuntimeTarget(IProject project, IRuntime runtime, IProgressMonitor monitor) {
- throw new RuntimeException("Attempt to use deprecated code");
- }
-
- /**
- * Add library entries to the given list for every jar file found in the
- * given directory. Optionally search subdirectories as well.
- *
- * @param list a list
- * @param dir a directory
- * @param includeSubdirectories <code>true</code> to include subdirectories, and
- * <code>false</code> otherwise
- */
- protected static void addLibraryEntries(List list, File dir, boolean includeSubdirectories) {
- throw new RuntimeException("Attempt to use deprecated code");
- }
-
- /**
- * Returns the classpath entries that correspond to the given runtime.
- *
- * @param runtime a runtime
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return an array of classpath entries
- */
- public IClasspathEntry[] getDelegateClasspathEntries(IRuntime runtime, IProgressMonitor monitor) {
- throw new RuntimeException("Attempt to use deprecated code");
- }
-
- /**
- * Returns the classpath entry ids for this runtime target handler. These
- * ids will be added to the classpath container id to create a new fully
- * qualified classpath container id.
- * <p>
- * By default, there is a single classpath entry for the runtime, with no
- * extra id (<code>new String[1]</code>). To create multiple ids, just
- * return a string array containing the ids. For instance, to have two
- * classpath containers with ids "id1" and "id2", use
- * <code>new String[] { "id1", "id2" }</code>
- * </p>
- *
- * @return an array of classpath entry ids
- */
- public String[] getClasspathEntryIds() {
- throw new RuntimeException("Attempt to use deprecated code");
- }
-
- /**
- * Request that the classpath container for the given runtime and id be updated
- * with the given classpath container entries.
- *
- * @param runtime a runtime
- * @param id an id
- * @param entries an array of classpath entries
- */
- public void requestClasspathContainerUpdate(IRuntime runtime, String id, IClasspathEntry[] entries) {
- throw new RuntimeException("Attempt to use deprecated code");
- }
-
- /**
- * Returns the classpath container label for the given runtime and the given
- * classpath container id (returned from getClasspathEntryIds()). This method
- * must not return null.
- *
- * @param runtime the runtime to resolve the container label for
- * @param id the classpath entry id
- * @return a classpath container label
- */
- public abstract String getClasspathContainerLabel(IRuntime runtime, String id);
-
- /**
- * Resolve the classpath container.
- *
- * @param runtime a runtime
- * @param id a container id
- * @return a possibly empty array of classpath entries
- */
- public IClasspathEntry[] resolveClasspathContainerImpl(IRuntime runtime, String id) {
- throw new RuntimeException("Attempt to use deprecated code");
- }
-
- /**
- * Resolves (creates the classpath entries for) the classpath container with
- * the given runtime and the given classpath container id (returned from
- * getClasspathEntryIds()). If the classpath container cannot be resolved
- * (for instance, if the runtime does not exist), return null.
- *
- * @param runtime the runtime to resolve the container for
- * @param id the classpath entry id
- * @return an array of classpath entries for the container, or null if the
- * container could not be resolved
- */
- public abstract IClasspathEntry[] resolveClasspathContainer(IRuntime runtime, String id);
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/EJBBean.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/EJBBean.java
deleted file mode 100644
index 29167324c..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/EJBBean.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.jst.server.core.internal.Messages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.model.ModuleArtifactDelegate;
-/**
- * An EJB bean.
- * <p>
- * <b>Provisional API:</b> This class/interface 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.
- * </p>
- * @since 1.1
- */
-public class EJBBean extends ModuleArtifactDelegate {
- /**
- * @since 1.1
- */
- public final static String EJB_11 = "1.1";
- /**
- * @since 1.1
- */
- public final static String EJB_20 = "2.0";
- /**
- * @since 1.1
- */
- public final static String EJB_21 = "2.1";
- /**
- * @since 1.1
- */
- public final static String EJB_30 = "3.0";
-
- private String jndiName;
- private String interfaceName;
- private boolean local;
- private boolean remote;
- private String version;
-
- /**
- * Create a new EJBBean.
- *
- * @param module the module that the EJB is contained in
- * @param jndiName the JNDI name of the EJB
- * @param remote <code>true</code> if the EJB has a remote interface, and
- * <code>false</code> otherwise
- * @param local <code>true</code> if the EJB has a local interface, and
- * <code>false</code> otherwise
- */
- public EJBBean(IModule module, String jndiName, boolean remote, boolean local) {
- super(module);
- this.jndiName = jndiName;
- this.remote = remote;
- this.local = local;
- this.version = "2.1";
- }
-
- /**
- * Create a new EJBBean with a specific version
- *
- * @param module the module that the EJB is contained in
- * @param jndiName the JNDI name of the EJB
- * @param remote <code>true</code> if the EJB has a remote interface, and
- * <code>false</code> otherwise
- * @param local <code>true</code> if the EJB has a local interface, and
- * <code>false</code> otherwise
- * @param version the level of the EJB specification that this EJB uses. Use one of the <code>EJB_xx</code> constants declared on {@link EJBBean}
- * @since 1.1
- */
- public EJBBean(IModule module, String jndiName, boolean remote, boolean local, String version) {
- super(module);
- this.jndiName = jndiName;
- this.remote = remote;
- this.local = local;
- this.version = version;
- }
-
- /**
- * Create a new EJBBean with its interface name. This API is intended to be use by EJB 3.0.
- *
- * @param module the module that the EJB is contained in
- * @param jndiName the JNDI name of the EJB
- * @param remote <code>true</code> if the EJB has a remote interface, and
- * <code>false</code> otherwise
- * @param local <code>true</code> if the EJB has a local interface, and
- * <code>false</code> otherwise
- * @param version the level of the EJB specification that this EJB uses. Use one of the <code>EJB_xx</code> constants declared on {@link EJBBean}
- * @param interfaceName the interface name of the EJB
- * @since 1.1
- */
-
- public EJBBean(IModule module, String jndiName, boolean remote, boolean local, String version, String interfaceName) {
- super(module);
- this.jndiName = jndiName;
- this.remote = remote;
- this.local = local;
- this.version = version;
- this.interfaceName = interfaceName;
- }
-
- /**
- * Create a new empty EJBBean.
- */
- public EJBBean() {
- super();
- }
-
- /**
- * Returns the JNDI name of the EJB.
- *
- * @return the JNDI name of the EJB
- */
- public String getJndiName() {
- return jndiName;
- }
-
- /**
- * Returns whether the EJB has a remote interface.
- *
- * @return <code>true</code> if the EJB has a remote interface, and
- * <code>false</code> otherwise
- */
- public boolean hasRemoteInterface() {
- return remote;
- }
-
- /**
- * Returns whether the EJB has a local interface.
- *
- * @return <code>true</code> if the EJB has a local interface, and
- * <code>false</code> otherwise
- */
- public boolean hasLocalInterface() {
- return local;
- }
-
- /**
- * Returns the level of the specification of the EJB
- *
- * @return the level of the specification of the EJB
- * @since 1.1
- */
- public String getVersion() {
- return version;
- }
-
- /*
- * @see ModuleArtifactDelegate#getName()
- */
- public String getName() {
- String ejbName;
- // EJB 2.0 don't have an inteface name, but they set the jndi name
- if (interfaceName != null && !(interfaceName.length()<=0)){
- ejbName = interfaceName;
- }
- else{
- ejbName = jndiName;
- }
- return NLS.bind(Messages.artifactEJB, ejbName);
- }
-
- /*
- * @see ModuleArtifactDelegate#deserialize(String)
- */
- public void deserialize(String s) {
- int ind = s.indexOf("//");
- super.deserialize(s.substring(0, ind));
- if ('T' == s.charAt(ind+2))
- local = true;
- else
- local = false;
- if ('T' == s.charAt(ind+3))
- remote = true;
- else
- remote = false;
- jndiName = s.substring(ind+4);
- }
-
- /*
- * @see ModuleArtifactDelegate#serialize()
- */
- public String serialize() {
- StringBuffer sb = new StringBuffer(super.serialize());
- sb.append("//");
- if (local)
- sb.append("T");
- else
- sb.append("F");
- if (remote)
- sb.append("T");
- else
- sb.append("F");
- sb.append(jndiName);
- return sb.toString();
- }
-
- /**
- * Gets the name of interface represented by this object
- *
- * @return the interface name
- * @since 1.1
- */
- public String getInterfaceName() {
- return interfaceName;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/FacetUtil.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/FacetUtil.java
deleted file mode 100644
index 201dc78c9..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/FacetUtil.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServer;
-/**
- * Utility class for converting between facet runtimes and server runtimes.
- * <p>
- * This class provides all its functionality through static members.
- * It is not intended to be subclassed or instantiated.
- * </p>
- * <p>
- * <b>Provisional API:</b> This class/interface 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.
- * </p>
- */
-public final class FacetUtil {
- /**
- * Static utility class - cannot create an instance.
- */
- private FacetUtil() {
- // can't create
- }
-
- /**
- * Returns the server runtime that corresponds to a facet runtime, or null
- * if none could be found.
- *
- * @param runtime a facet runtime
- * @return the server runtime that corresponds to the facet runtime, or
- * <code>null</code> if none could be found.
- */
- public static IRuntime getRuntime(org.eclipse.wst.common.project.facet.core.runtime.IRuntime runtime) {
- return org.eclipse.wst.server.core.internal.facets.FacetUtil.getRuntime(runtime);
- }
-
- /**
- * Returns the facet runtime that corresponds to a server runtime, or null
- * if none could be found.
- *
- * @param runtime a server runtime
- * @return the facet runtime that corresponds to the server runtime, or
- * <code>null</code> if none could be found.
- */
- public static org.eclipse.wst.common.project.facet.core.runtime.IRuntime getRuntime(IRuntime runtime) {
- return org.eclipse.wst.server.core.internal.facets.FacetUtil.getRuntime(runtime);
- }
-
- /**
- * Tests whether the facets on a project are supported by a given server. Returns
- * an OK status if the server's runtime supports the project's facets, and an
- * ERROR status (with message) if it doesn't.
- *
- * @param project a project
- * @param server a server
- * @return OK status if the server's runtime supports the project's facets, and an
- * ERROR status (with message) if it doesn't
- */
- public static final IStatus verifyFacets(IProject project, IServer server) {
- return org.eclipse.wst.server.core.internal.facets.FacetUtil.verifyFacets(project, server);
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IApplicationClientModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IApplicationClientModule.java
deleted file mode 100644
index 03570e1d2..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IApplicationClientModule.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-/**
- * A J2EE application client module.
- * <p>
- * <b>Provisional API:</b> This class/interface 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.
- * </p>
- * @plannedfor 3.0
- */
-public interface IApplicationClientModule extends IJ2EEModule {
- // intentionally empty
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IConnectorModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IConnectorModule.java
deleted file mode 100644
index d8367257a..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IConnectorModule.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.core.runtime.IPath;
-/**
- * A J2EE connector module.
- * <p>
- * <b>Provisional API:</b> This class/interface 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.
- * </p>
- * @plannedfor 3.0
- */
-public interface IConnectorModule extends IJ2EEModule {
- /**
- * Returns the classpath as an array of absolute IPaths.
- *
- * @return an array of classpath entries
- */
- public IPath[] getClasspath();
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEJBModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEJBModule.java
deleted file mode 100644
index f6106565c..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEJBModule.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-/**
- * A representation of a J2EE EJB module.
- * <p>
- * <b>Provisional API:</b> This class/interface 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.
- * </p>
- * @plannedfor 3.0
- */
-public interface IEJBModule extends IJ2EEModule {
- // intentionally empty
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEnterpriseApplication.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEnterpriseApplication.java
deleted file mode 100644
index 7ea1d77a3..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEnterpriseApplication.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.wst.server.core.IModule;
-/**
- * A representation of a J2EE enterprise application (EAR file).
- * <p>
- * <b>Provisional API:</b> This class/interface 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.
- * </p>
- * @plannedfor 3.0
- */
-public interface IEnterpriseApplication {
- /**
- * Returns the modules contained within this EAR. The returned modules will
- * either be J2EE modules (which will be adaptable to IJ2EEModule) or
- * utility jars contained in the EAR.
- *
- * @return a possibly empty array of modules contained within this application
- */
- public IModule[] getModules();
-
- /**
- * Returns the URI of the given module within this enterprise application.
- *
- * @param module a module within this application
- * @return the URI of the given module, or <code>null</code> if the URI could
- * not be found
- */
- public String getURI(IModule module);
-
- /**
- * Returns the root folders for the resources in this module.
- *
- * @return a possibly-empty array of resource folders
- */
- public IContainer[] getResourceFolders();
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJ2EEModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJ2EEModule.java
deleted file mode 100644
index b4d974b26..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJ2EEModule.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.core.resources.IContainer;
-/**
- * A J2EE module that can be deployed to a server.
- *
- * <p>
- * <b>Provisional API:</b> This class/interface 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.
- * </p>
- * @plannedfor 3.0
- */
-public interface IJ2EEModule {
- /**
- * Returns the root folders for the resources in this module. Returns an empty
- * array if this is a binary module.
- *
- * @return a possibly-empty array of resource folders
- */
- public IContainer[] getResourceFolders();
-
- /**
- * Returns the root folders containing Java output in this module. Returns an
- * empty array if this is a binary module.
- *
- * @return a possibly-empty array of Java output folders
- */
- public IContainer[] getJavaOutputFolders();
-
- /**
- * Returns true if this is a binary (zipped) module, and
- * false if it is expanded.
- *
- * <p>If true, members() should return only a single element -
- * the binary (jar or zip file) that contains the contents of
- * this module. (a single IModuleResource, e.g.
- * myejb.jar) Also, getLocation() should return the full path
- * up to and including the binary itself. (e.g.
- * c:\temp\myejb.jar)</p>
- *
- * <p>If false, members() should return the entire contents
- * of the module, starting at the root. There should be no
- * preceeding directory structure. (an array of
- * IModuleResources, e.g. index.html, WEB-INF/web.xml,
- * ...) In this case, getLocation() should return the path to
- * the root folder containing these resources.</p>
- *
- * @return boolean
- */
- public boolean isBinary();
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntime.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntime.java
deleted file mode 100644
index 6a5169309..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntime.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.jdt.launching.IVMInstall;
-/**
- * An interface for a server that contains a Java runtime.
- * <p>
- * <b>Note:</b> This class/interface 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.
- * </p>
- * @since 3.0
- */
-public interface IJavaRuntime {
- /**
- * Return the VM install (installed JRE) that this runtime is using.
- *
- * @return the current VM install
- */
- public IVMInstall getVMInstall();
-
- /**
- * Returns <code>true</code> if the runtime is using the default JRE.
- *
- * @return <code>true</code> if the runtime is using the default JRE,
- * and <code>false</code> otherwise
- * @since 2.0
- */
- public boolean isUsingDefaultJRE();
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntimeWorkingCopy.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntimeWorkingCopy.java
deleted file mode 100644
index 3fe507502..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntimeWorkingCopy.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.jdt.launching.IVMInstall;
-/**
- * An interface for a server that contains a Java runtime.
- * <p>
- * <b>Note:</b> This class/interface 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.
- * </p>
- * @since 1.1
- */
-public interface IJavaRuntimeWorkingCopy extends IJavaRuntime {
- /**
- * Set the VM install (installed JRE) that this runtime is using.
- * Use <code>null</code> to use the Eclipse default JRE.
- *
- * @param vmInstall the VM install to use
- */
- public void setVMInstall(IVMInstall vmInstall);
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IUtilityModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IUtilityModule.java
deleted file mode 100644
index f013f696c..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IUtilityModule.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.core.resources.IContainer;
-/**
- * A J2EE utility module that can be deployed to a server.
- *
- * <p>
- * <b>Provisional API:</b> This class/interface 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.
- * </p>
- * @plannedfor 3.0
- */
-public interface IUtilityModule {
- /**
- * Returns the root folders for the resources in this module.
- *
- * @return a possibly-empty array of resource folders
- */
- public IContainer[] getResourceFolders();
-
- /**
- * Returns the root folders containing Java output in this module.
- *
- * @return a possibly-empty array of Java output folders
- */
- public IContainer[] getJavaOutputFolders();
-
- /**
- * Returns true if this is a binary (zipped) module, and
- * false if it is expanded.
- *
- * <p>If true, members() should return only a single element -
- * the binary (jar or zip file) that contains the contents of
- * this module. (a single IModuleResource, e.g.
- * myejb.jar) Also, getLocation() should return the full path
- * up to and including the binary itself. (e.g.
- * c:\temp\myejb.jar)</p>
- *
- * <p>If false, members() should return the entire contents
- * of the module, starting at the root. There should be no
- * preceeding directory structure. (an array of
- * IModuleResources, e.g. index.html, WEB-INF/web.xml,
- * ...) In this case, getLocation() should return the path to
- * the root folder containing these resources.</p>
- *
- * @return boolean
- */
- public boolean isBinary();
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IWebModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IWebModule.java
deleted file mode 100644
index 959ef2f66..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IWebModule.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.wst.server.core.IModule;
-/**
- * A J2EE web module.
- * <p>
- * <b>Provisional API:</b> This class/interface 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.
- * </p>
- *
- * @plannedfor 3.0
- */
-public interface IWebModule extends IJ2EEModule {
- /**
- * Returns the context root of the module.
- *
- * @return the context root
- */
- public String getContextRoot();
-
- /**
- * Returns the context root of the module. If the the webModule belongs to an earModule, the context root with higher
- * precedence will be returned.
- *
- * @param earModule The EARModule if exist, if not null
- * @return the context root
- * @since 1.1
- */
- public String getContextRoot(IModule earModule);
-
- /**
- * Returns the utility modules contained within this WAR.
- *
- * @return a possibly empty array of modules contained within this application
- */
- public IModule[] getModules();
-
- /**
- * Returns the URI of the given contained module.
- *
- * @param module a module
- * @return the URI of the given module, or <code>null</code> if the URI could
- * not be found
- */
- public String getURI(IModule module);
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiLaunchable.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiLaunchable.java
deleted file mode 100644
index db5304c3d..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiLaunchable.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import java.util.Properties;
-/**
- * A representation of an object in JNDI that can be tested on a server.
- * <p>
- * <b>Provisional API:</b> This class/interface 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.
- * </p>
- * @plannedfor 3.0
- */
-public class JndiLaunchable {
- private Properties props;
- private String jndiName;
-
- /**
- * Create a reference to an object that is launchable via JNDI.
- *
- * @param props the JNDI properties required to connect to the object
- * @param jndiName the JNDI name of the object
- */
- public JndiLaunchable(Properties props, String jndiName) {
- this.jndiName = jndiName;
- this.props = props;
- }
-
- /**
- * Returns the JNDI properties required to connect to the object.
- *
- * @return the JNDI properties required to connect to the object
- */
- public Properties getProperties() {
- return props;
- }
-
- /**
- * Returns the JNDI name of the object.
- *
- * @return the JNDI name of the object
- */
- public String getJNDIName() {
- return jndiName;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiObject.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiObject.java
deleted file mode 100644
index f02e92224..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiObject.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.jst.server.core.internal.Messages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.model.ModuleArtifactDelegate;
-/**
- * A representation of an object in JNDI that can be tested on a server.
- * <p>
- * <b>Provisional API:</b> This class/interface 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.
- * </p>
- * @plannedfor 3.0
- */
-public class JndiObject extends ModuleArtifactDelegate {
- private String jndiName;
-
- /**
- * Create a reference to an object in JNDI.
- *
- * @param module the module that the object is contained in
- * @param jndiName the JNDI name of the object
- */
- public JndiObject(IModule module, String jndiName) {
- super(module);
- this.jndiName = jndiName;
- }
-
- /**
- * Create an empty reference to an object in JNDI.
- */
- public JndiObject() {
- super();
- }
-
- /**
- * Return the JNDI name of the object.
- *
- * @return the JNDI name of the object
- */
- public String getJndiName() {
- return jndiName;
- }
-
- /*
- * @see ModuleArtifactDelegate#getName()
- */
- public String getName() {
- return NLS.bind(Messages.artifactJNDI, jndiName);
- }
-
- /*
- * @see ModuleArtifactDelegate#deserialize(String)
- */
- public void deserialize(String s) {
- int ind = s.indexOf("//");
- super.deserialize(s.substring(0, ind));
- jndiName = s.substring(ind+2);
- }
-
- /*
- * @see ModuleArtifactDelegate#serialize()
- */
- public String serialize() {
- StringBuffer sb = new StringBuffer(super.serialize());
- sb.append("//");
- sb.append(jndiName);
- return sb.toString();
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/PublishUtil.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/PublishUtil.java
deleted file mode 100644
index 794a15bc3..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/PublishUtil.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import java.io.*;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.jst.server.core.internal.JavaServerPlugin;
-import org.eclipse.jst.server.core.internal.Messages;
-import org.eclipse.jst.server.core.internal.Trace;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.model.IModuleFile;
-import org.eclipse.wst.server.core.model.IModuleResource;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-/**
- * Utility class with an assortment of useful file methods.
- * <p>
- * This class provides all its functionality through static members.
- * It is not intended to be subclassed or instantiated.
- * </p>
- * <p>
- * <b>Note:</b> Adopters should use the equivalent class in
- * org.eclipse.wst.server.core.util instead. This class will eventually
- * be deprecated.
- * </p>
- */
-public final class PublishUtil {
- // size of the buffer
- private static final int BUFFER = 65536;
-
- // the buffer
- private static byte[] buf = new byte[BUFFER];
-
- /**
- * PublishUtil cannot be created. Use static methods.
- */
- private PublishUtil() {
- // can't create
- }
-
- /**
- * Copy a file from a to b. Closes the input stream after use.
- *
- * @param in java.io.InputStream
- * @param to java.lang.String
- * @deprecated Unused - will be removed.
- * @return a status
- */
- public static IStatus copyFile(InputStream in, String to) {
- OutputStream out = null;
-
- try {
- out = new FileOutputStream(to);
-
- int avail = in.read(buf);
- while (avail > 0) {
- out.write(buf, 0, avail);
- avail = in.read(buf);
- }
- return Status.OK_STATUS;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error copying file", e);
- return new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorCopyingFile, new String[] {to, e.getLocalizedMessage()}), e);
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (Exception ex) {
- // ignore
- }
- try {
- if (out != null)
- out.close();
- } catch (Exception ex) {
- // ignore
- }
- }
- }
-
- /**
- * Smart copy the given module resources to the given path.
- *
- * @param resources
- * @param path
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @throws CoreException
- * @deprecated This method only returns a single error in the case of failure. Use publishSmart() instead.
- */
- public static void smartCopy(IModuleResource[] resources, IPath path, IProgressMonitor monitor) throws CoreException {
- IStatus[] status = PublishUtil.publishSmart(resources, path, monitor);
- if (status != null && status.length > 0)
- throw new CoreException(status[0]);
- }
-
- /**
- * Handle a delta publish.
- *
- * @param kind
- * @param path
- * @param delta
- * @throws CoreException
- * @deprecated This method only returns a single error in the case of failure. Use publishDelta() instead.
- */
- public static void handleDelta(int kind, IPath path, IModuleResourceDelta delta) throws CoreException {
- IStatus[] status = PublishUtil.publishDelta(delta, path, null);
- if (status != null && status.length > 0)
- throw new CoreException(status[0]);
- }
-
- /**
- *
- * @param path
- * @param file
- * @deprecated does not fail or return status if delete doesn't work
- */
- protected static void deleteFile(IPath path, IModuleFile file) {
- Trace.trace(Trace.PUBLISHING, "Deleting: " + file.getName() + " from " + path.toString());
- IPath path2 = path.append(file.getModuleRelativePath()).append(file.getName());
- path2.toFile().delete();
- }
-
- /**
- *
- * @param resources
- * @param path
- * @throws CoreException
- * @deprecated This method only returns a single error in the case of failure. Use publishFull() instead
- */
- public static void copy(IModuleResource[] resources, IPath path) throws CoreException {
- IStatus[] status = PublishUtil.publishFull(resources, path, null);
- if (status != null && status.length > 0)
- throw new CoreException(status[0]);
- }
-
- /**
- * Creates a new zip file containing the given module resources. Deletes the existing file
- * (and doesn't create a new one) if resources is null or empty.
- *
- * @param resources
- * @param zipPath
- * @throws CoreException
- */
- public static void createZipFile(IModuleResource[] resources, IPath zipPath) throws CoreException {
- IStatus[] status = PublishUtil.publishZip(resources, zipPath, null);
- if (status != null && status.length > 0)
- throw new CoreException(status[0]);
- }
-
- /**
- * Utility method to recursively delete a directory.
- *
- * @param dir a directory
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly-empty array of error and warning status
- */
- public static IStatus[] deleteDirectory(File dir, IProgressMonitor monitor) {
- return org.eclipse.wst.server.core.util.PublishUtil.deleteDirectory(dir, monitor);
- }
-
- /**
- * Smart copy the given module resources to the given path.
- *
- * @param resources an array of module resources
- * @param path an external path to copy to
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly-empty array of error and warning status
- */
- public static IStatus[] publishSmart(IModuleResource[] resources, IPath path, IProgressMonitor monitor) {
- return org.eclipse.wst.server.core.util.PublishUtil.publishSmart(resources, path, monitor);
- }
-
- /**
- * Handle a delta publish.
- *
- * @param delta a module resource delta
- * @param path the path to publish to
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly-empty array of error and warning status
- */
- public static IStatus[] publishDelta(IModuleResourceDelta[] delta, IPath path, IProgressMonitor monitor) {
- return org.eclipse.wst.server.core.util.PublishUtil.publishDelta(delta, path, monitor);
- }
-
- /**
- * Handle a delta publish.
- *
- * @param delta a module resource delta
- * @param path the path to publish to
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly-empty array of error and warning status
- */
- public static IStatus[] publishDelta(IModuleResourceDelta delta, IPath path, IProgressMonitor monitor) {
- return org.eclipse.wst.server.core.util.PublishUtil.publishDelta(delta, path, monitor);
- }
-
- /**
- * Publish the given module resources to the given path.
- *
- * @param resources an array of module resources
- * @param path a path to publish to
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly-empty array of error and warning status
- */
- public static IStatus[] publishFull(IModuleResource[] resources, IPath path, IProgressMonitor monitor) {
- return org.eclipse.wst.server.core.util.PublishUtil.publishFull(resources, path, monitor);
- }
-
- /**
- * Creates a new zip file containing the given module resources. Deletes the existing file
- * (and doesn't create a new one) if resources is null or empty.
- *
- * @param resources an array of module resources
- * @param path the path where the zip file should be created
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly-empty array of error and warning status
- */
- public static IStatus[] publishZip(IModuleResource[] resources, IPath path, IProgressMonitor monitor) {
- return org.eclipse.wst.server.core.util.PublishUtil.publishZip(resources, path, monitor);
- }
-} \ No newline at end of file
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
deleted file mode 100644
index b1f40b051..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IAccessRule;
-import org.eclipse.jdt.core.IClasspathAttribute;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.server.core.internal.IMemento;
-import org.eclipse.jst.server.core.internal.JavaServerPlugin;
-import org.eclipse.jst.server.core.internal.RuntimeClasspathContainer;
-import org.eclipse.jst.server.core.internal.Trace;
-import org.eclipse.jst.server.core.internal.XMLMemento;
-import org.eclipse.wst.server.core.IRuntime;
-/**
- * A runtime classpath provider provides the classpath for a Java server runtime.
- * This provider is scoped by runtime type and may provide the classpath for multiple
- * runtime instances.
- * <p>
- * This abstract class is intended to be extended only by clients
- * to extend the <code>runtimeClasspathProviders</code> extension point.
- * </p>
- * <p>
- * <b>Provisional API:</b> This class/interface 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.
- * </p>
- *
- * @plannedfor 3.0
- */
-public abstract class RuntimeClasspathProviderDelegate {
- protected class SourceAttachmentUpdate {
- String runtimeId;
- IPath entry;
- IPath sourceAttachmentPath;
- IPath sourceAttachmentRootPath;
- IClasspathAttribute[] attributes;
- }
-
- private List<SourceAttachmentUpdate> sourceAttachments;
-
- private String extensionId;
-
- private Map<String, IPath> runtimePathMap = new HashMap<String, IPath>();
-
- private Map<String, Integer> previousClasspath = new HashMap<String, Integer>();
-
- public RuntimeClasspathProviderDelegate() {
- // default constructor
- }
-
- /**
- * Initializes this classpath provider with its life-long id.
- * <p>
- * This method is called by the framework.
- * Clients should never call this method.
- * </p>
- * @param id the extension id
- */
- public final void initialize(String id) {
- extensionId = id;
- }
-
- /**
- * Resolves (creates the classpath entries for) the classpath container with
- * the given runtime and the given classpath container id (returned from
- * getClasspathEntryIds()). If the classpath container cannot be resolved
- * (for instance, if the runtime does not exist), return null.
- *
- * @param runtime the runtime to resolve the container for
- * @return an array of classpath entries for the container, or null if the
- * container could not be resolved
- * @deprecated use resolveClasspathContainer(IProject, IRuntime) instead
- */
- public IClasspathEntry[] resolveClasspathContainer(IRuntime runtime) {
- return null;
- }
-
- /**
- * Resolves (creates the classpath entries for) the classpath container with
- * the given runtime and the given classpath container id (returned from
- * getClasspathEntryIds()). If the classpath container cannot be resolved
- * (for instance, if the runtime does not exist), return null.
- *
- * @param project the project to resolve
- * @param runtime the runtime to resolve the container for
- * @return an array of classpath entries for the container, or null if the
- * container could not be resolved
- */
- public IClasspathEntry[] resolveClasspathContainer(IProject project, IRuntime runtime) {
- return null;
- }
-
- /**
- * Resolve the classpath container.
- *
- * @param runtime a runtime
- * @return a possibly empty array of classpath entries
- * @deprecated should use resolveClasspathContainerImpl(IProject, IRuntime) instead
- */
- public IClasspathEntry[] resolveClasspathContainerImpl(IRuntime runtime) {
- return resolveClasspathContainerImpl(null, runtime);
- }
-
- /**
- * Resolve the classpath container.
- *
- * @param project a project
- * @param runtime a runtime
- * @return a possibly empty array of classpath entries
- */
- public IClasspathEntry[] resolveClasspathContainerImpl(IProject project, IRuntime runtime) {
- if (runtime == null)
- return new IClasspathEntry[0];
- runtimePathMap.put(runtime.getId(), runtime.getLocation());
- IClasspathEntry[] entries = resolveClasspathContainer(project, runtime);
- if (entries == null)
- entries = resolveClasspathContainer(runtime);
-
- if (entries == null)
- entries = new IClasspathEntry[0];
-
- if (sourceAttachments == null)
- load();
-
- int size = entries.length;
- int size2 = sourceAttachments.size();
- for (int i = 0; i < size; i++) {
- for (int j = 0; j < size2; j++) {
- SourceAttachmentUpdate sau = sourceAttachments.get(j);
- if (sau.runtimeId.equals(runtime.getId()) && sau.entry.equals(entries[i].getPath())) {
- entries[i] = JavaCore.newLibraryEntry(entries[i].getPath(), sau.sourceAttachmentPath, sau.sourceAttachmentRootPath, new IAccessRule[0], sau.attributes, false);
- }
- }
- }
-
- String key = project.getName() + "/" + runtime.getId();
- if (!previousClasspath.containsKey(key))
- previousClasspath.put(key, new Integer(entries.length));
- else {
- Integer previousEntries = previousClasspath.get(key);
-
- if ((previousEntries == null) || (previousEntries.intValue() != entries.length)) {
- Trace.trace(Trace.FINEST, "Classpath update: " + key + " " + entries);
- previousClasspath.put(key, new Integer(entries.length));
-
- IPath path = new Path(RuntimeClasspathContainer.SERVER_CONTAINER);
- path = path.append(extensionId).append(runtime.getId());
- try {
- IJavaProject javaProject = JavaCore.create(project);
- JavaCore.setClasspathContainer(path, new IJavaProject[] { javaProject },
- new IClasspathContainer[] { null }, new NullProgressMonitor());
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Error updating classpath", e);
- }
- }
- }
-
- return entries;
- }
-
- /*
- * Returns true if there are any changes in the runtime since the last time that the
- * classpath was resolved which may affect the classpath, and false otherwise. This
- * method is used to check projects when a runtime changes and automatically rebuild
- * them if necessary.
- *
- * @param runtime a runtime
- * @return <code>true</code> if the classpath may change due to a change in the runtime,
- * and <code>false</code> if there are no changes
- */
- public boolean hasRuntimeClasspathChanged(IRuntime runtime) {
- try {
- IPath path = runtimePathMap.get(runtime.getId());
- return (path != null && !path.equals(runtime.getLocation()));
- } catch (Exception e) {
- // ignore
- }
- return false;
- }
-
- private static void addJarFiles(File dir, List<IClasspathEntry> list, boolean includeSubdirectories) {
- int depth = 0;
- if (includeSubdirectories)
- depth = 2;
- addJarFiles(dir, list, depth);
- }
-
- private static void addJarFiles(File dir, List<IClasspathEntry> list, int depth) {
- if (dir == null)
- throw new IllegalArgumentException();
-
- File[] files = dir.listFiles();
- if (files != null) {
- for (File file : files) {
- if (file.isDirectory() && depth > 0) {
- addJarFiles(file, list, depth - 1);
- } else if (file.getAbsolutePath().endsWith(".jar") || file.getAbsolutePath().endsWith(".zip")) {
- IPath path = new Path(file.getAbsolutePath());
- list.add(JavaCore.newLibraryEntry(path, null, null));
- }
- }
- }
- }
-
- /**
- * Add library entries to the given list for every jar file found in the
- * given directory. Optionally search subdirectories as well.
- *
- * @param list a list
- * @param dir a directory
- * @param includeSubdirectories <code>true</code> to include subdirectories, and
- * <code>false</code> otherwise
- */
- protected static void addLibraryEntries(List<IClasspathEntry> list, File dir, boolean includeSubdirectories) {
- if (dir == null)
- throw new IllegalArgumentException();
- addJarFiles(dir, list, includeSubdirectories);
- }
-
- /**
- * Request that the classpath container for the given runtime and id be updated
- * with the given classpath container entries.
- *
- * @param runtime a runtime
- * @param entries an array of classpath entries
- */
- public void requestClasspathContainerUpdate(IRuntime runtime, IClasspathEntry[] entries) {
- // default behaviour is to save the source path entries
- if (runtime == null || entries == null)
- return;
-
- // find the source attachments
- sourceAttachments = new ArrayList<SourceAttachmentUpdate>();
-
- for (IClasspathEntry entry : entries) {
- if (entry.getSourceAttachmentPath() != null || entry.getExtraAttributes() != null) {
- SourceAttachmentUpdate sau = new SourceAttachmentUpdate();
- sau.runtimeId = runtime.getId();
- sau.entry = entry.getPath();
- sau.sourceAttachmentPath = entry.getSourceAttachmentPath();
- sau.sourceAttachmentRootPath = entry.getSourceAttachmentRootPath();
- sau.attributes = entry.getExtraAttributes();
- sourceAttachments.add(sau);
- }
- }
- save();
- }
-
- /**
- * Load source attachment info.
- */
- private void load() {
- sourceAttachments = new ArrayList<SourceAttachmentUpdate>();
-
- String id = extensionId;
- String filename = JavaServerPlugin.getInstance().getStateLocation().append(id + ".xml").toOSString();
- if (!(new File(filename)).exists())
- return;
-
- try {
- IMemento memento = XMLMemento.loadMemento(filename);
-
- IMemento[] children = memento.getChildren("source-attachment");
- for (IMemento child : children) {
- try {
- SourceAttachmentUpdate sau = new SourceAttachmentUpdate();
- sau.runtimeId = child.getString("runtime-id");
- String temp = child.getString("entry");
- if (temp != null)
- sau.entry = new Path(temp);
- temp = child.getString("source-attachment-path");
- if (temp != null)
- sau.sourceAttachmentPath = new Path(temp);
- temp = child.getString("source-attachment-root-path");
- if (temp != null)
- sau.sourceAttachmentRootPath = new Path(temp);
- IMemento[] attrChildren = child.getChildren("attribute");
- if (attrChildren != null) {
- int size2 = attrChildren.length;
- sau.attributes = new IClasspathAttribute[size2];
- for (int j = 0; j < size2; j++) {
- String name = attrChildren[j].getString("name");
- String value = attrChildren[j].getString("value");
- sau.attributes[j] = JavaCore.newClasspathAttribute(name, value);
- }
- }
- sourceAttachments.add(sau);
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load source attachment: " + e);
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load source path info", e);
- }
- }
-
- /**
- * Save source attachment info.
- */
- private void save() {
- if (sourceAttachments == null)
- return;
- String id = extensionId;
- String filename = JavaServerPlugin.getInstance().getStateLocation().append(id + ".xml").toOSString();
- try {
- XMLMemento memento = XMLMemento.createWriteRoot("classpath");
-
- Iterator iterator = sourceAttachments.iterator();
- while (iterator.hasNext()) {
- SourceAttachmentUpdate sau = (SourceAttachmentUpdate) iterator.next();
- IMemento child = memento.createChild("source-attachment");
- child.putString("runtime-id", sau.runtimeId);
- if (sau.entry != null)
- child.putString("entry", sau.entry.toPortableString());
- if (sau.sourceAttachmentPath != null)
- child.putString("source-attachment-path", sau.sourceAttachmentPath.toPortableString());
- if (sau.sourceAttachmentRootPath != null)
- child.putString("source-attachment-root-path", sau.sourceAttachmentRootPath.toPortableString());
- if (sau.attributes != null) {
- for (IClasspathAttribute attr : sau.attributes) {
- IMemento attrChild = child.createChild("attribute");
- attrChild.putString("name", attr.getName());
- attrChild.putString("value", attr.getValue());
- }
- }
- }
-
- memento.saveToFile(filename);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error saving source path info", e);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ServerProfilerDelegate.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ServerProfilerDelegate.java
deleted file mode 100644
index 86f0dc8dd..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ServerProfilerDelegate.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.VMRunnerConfiguration;
-import org.eclipse.jst.server.core.internal.JavaServerPlugin;
-/**
- * A server profiler delegate.
- * <p>
- * <b>Provisional API:</b> This class/interface 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.
- * </p>
- */
-public abstract class ServerProfilerDelegate {
- /**
- * Create a new server profiler delegate. This class must have a public default constructor.
- */
- public ServerProfilerDelegate() {
- // ignore
- }
-
- /**
- * Processes the Java launch configuration about to be run to support profiling.
- * VM args or environment variables can be set to allow profiling.
- *
- * @param launch the launch
- * @param vmInstall the vm install being run against
- * @param vmConfig the configuration to process
- * @param monitor a progress monitor
- * @throws CoreException if there is a problem during configuration
- */
- public abstract void process(ILaunch launch, IVMInstall vmInstall, VMRunnerConfiguration vmConfig, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Processes the Java launch configuration about to be run to support profiling.
- * VM args or environment variables can be set to allow profiling.
- *
- * @param launch the launch
- * @param vmInstall the vm install being run against
- * @param vmConfig the configuration to process
- * @param monitor a progress monitor
- * @throws CoreException if there are no profilers configured or there is a problem
- * configuring the launch
- */
- public static void configureProfiling(ILaunch launch, IVMInstall vmInstall, VMRunnerConfiguration vmConfig, IProgressMonitor monitor) throws CoreException {
- JavaServerPlugin.configureProfiling(launch, vmInstall, vmConfig, monitor);
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/Servlet.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/Servlet.java
deleted file mode 100644
index b3cc4dcae..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/Servlet.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.jst.server.core.internal.Messages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.model.ModuleArtifactDelegate;
-/**
- * A J2EE Servlet.
- * <p>
- * <b>Provisional API:</b> This class/interface 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.
- * </p>
- * @plannedfor 3.0
- */
-public class Servlet extends ModuleArtifactDelegate {
- private String className;
- private String alias;
-
- /**
- * Create a reference to a servlet.
- *
- * @param module the module that the servlet is contained in
- * @param className the class name of the servlet
- * @param alias the servlet's alias
- */
- public Servlet(IModule module, String className, String alias) {
- super(module);
- this.className = className;
- this.alias = alias;
- }
-
- /**
- * Create a new empty servlet.
- */
- public Servlet() {
- super();
- }
-
- /**
- * Return the class name of the servlet.
- *
- * @return the class name of the servlet
- */
- public String getServletClassName() {
- return className;
- }
-
- /**
- * Return the servlet's alias.
- *
- * @return the servlet's alias
- */
- public String getAlias() {
- return alias;
- }
-
- /*
- * @see ModuleArtifactDelegate#getName()
- */
- public String getName() {
- return NLS.bind(Messages.artifactServlet, className);
- }
-
- /*
- * @see ModuleArtifactDelegate#deserialize(String)
- */
- public void deserialize(String s) {
- int ind = s.indexOf("//");
- super.deserialize(s.substring(0, ind));
- s = s.substring(ind+2);
- ind = s.indexOf("//");
- className = s.substring(0, ind);
- alias = s.substring(ind+2);
- }
-
- /*
- * @see ModuleArtifactDelegate#serialize()
- */
- public String serialize() {
- StringBuffer sb = new StringBuffer(super.serialize());
- sb.append("//");
- sb.append(className);
- sb.append("//");
- sb.append(alias);
- return sb.toString();
- }
-
- /**
- * @see Object#toString()
- */
- public String toString() {
- return "Servlet [module=" + getModule() + ", class=" + className + ", alias=" + alias + "]";
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntime.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntime.java
deleted file mode 100644
index 264fcaa1d..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntime.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMInstallType;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.model.RuntimeDelegate;
-/**
- *
- */
-public class GenericRuntime extends RuntimeDelegate implements IGenericRuntime, IGenericRuntimeWorkingCopy {
- protected static final String PROP_VM_INSTALL_TYPE_ID = "vm-install-type-id";
- protected static final String PROP_VM_INSTALL_ID = "vm-install-id";
-
- /**
- * Create a new generic runtime.
- */
- public GenericRuntime() {
- // do nothing
- }
-
- protected String getVMInstallTypeId() {
- return getAttribute(PROP_VM_INSTALL_TYPE_ID, (String)null);
- }
-
- protected String getVMInstallId() {
- return getAttribute(PROP_VM_INSTALL_ID, (String)null);
- }
-
- /**
- * Returns <code>true</code> if the runtime is using the default JRE.
- *
- * @return <code>true</code> if the runtime is using the default JRE,
- * and <code>false</code> otherwise
- */
- public boolean isUsingDefaultJRE() {
- return getVMInstallTypeId() == null;
- }
-
- /**
- * @see IGenericRuntime#getVMInstall()
- */
- public IVMInstall getVMInstall() {
- if (getVMInstallTypeId() == null)
- return JavaRuntime.getDefaultVMInstall();
- try {
- IVMInstallType vmInstallType = JavaRuntime.getVMInstallType(getVMInstallTypeId());
- IVMInstall[] vmInstalls = vmInstallType.getVMInstalls();
- String id = getVMInstallId();
- for (IVMInstall vmInst : vmInstalls) {
- if (id.equals(vmInst.getId()))
- return vmInst;
- }
- } catch (Exception e) {
- // ignore
- }
- return null;
- }
-
- /**
- * @see RuntimeDelegate#validate()
- */
- public IStatus validate() {
- IStatus status = super.validate();
- if (!status.isOK())
- return status;
-
- IRuntime runtime = getRuntime();
-
- IPath path = runtime.getLocation();
- if (!path.toFile().exists())
- return new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, Messages.errorLocation, null);
- else if (getVMInstall() == null)
- return new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, Messages.errorJRE, null);
- else
- return Status.OK_STATUS;
- }
-
- /**
- * @see IGenericRuntimeWorkingCopy#setVMInstall(IVMInstall)
- */
- public void setVMInstall(IVMInstall vmInstall) {
- if (vmInstall == null) {
- setVMInstall(null, null);
- } else
- setVMInstall(vmInstall.getVMInstallType().getId(), vmInstall.getId());
- }
-
- protected void setVMInstall(String typeId, String id) {
- if (typeId == null)
- setAttribute(PROP_VM_INSTALL_TYPE_ID, (String)null);
- else
- setAttribute(PROP_VM_INSTALL_TYPE_ID, typeId);
-
- if (id == null)
- setAttribute(PROP_VM_INSTALL_ID, (String)null);
- else
- setAttribute(PROP_VM_INSTALL_ID, id);
- }
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeClasspathProvider.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeClasspathProvider.java
deleted file mode 100644
index 862bb642e..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeClasspathProvider.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate;
-
-import org.eclipse.wst.server.core.IRuntime;
-/**
- *
- */
-public class GenericRuntimeClasspathProvider extends RuntimeClasspathProviderDelegate {
- /** (non-Javadoc)
- * @see RuntimeClasspathProviderDelegate#resolveClasspathContainer(IProject, IRuntime)
- */
- public IClasspathEntry[] resolveClasspathContainer(IProject project, IRuntime runtime) {
- IPath installPath = runtime.getLocation();
-
- if (installPath == null)
- return new IClasspathEntry[0];
-
- List<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
- addLibraryEntries(list, installPath.toFile(), false);
- return list.toArray(new IClasspathEntry[list.size()]);
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeUtil.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeUtil.java
deleted file mode 100644
index d5fbb11ea..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeUtil.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.wst.server.core.IRuntime;
-/**
- * Utility methods for the generic J2EE runtime.
- */
-public class GenericRuntimeUtil {
- protected static final String RUNTIME_TYPE_ID = "org.eclipse.jst.server.core.runtimeType";
-
- /**
- * Cannot create GenericRuntimeUtil - use static methods.
- */
- private GenericRuntimeUtil() {
- // can't create
- }
-
- /**
- * Returns <code>true</code> if the given runtime is a generic J2EE runtime, and
- * <code>false</code> otherwise. The runtime may not be null.
- *
- * @param runtime
- * @return <code>true</code> if
- */
- public static boolean isGenericJ2EERuntime(IRuntime runtime) {
- if (runtime == null)
- throw new IllegalArgumentException();
-
- return (runtime.getRuntimeType() != null &&
- runtime.getRuntimeType().getId().startsWith(RUNTIME_TYPE_ID));
- }
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntime.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntime.java
deleted file mode 100644
index 9a4bd3156..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntime.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.jst.server.core.IJavaRuntime;
-/**
- *
- */
-public interface IGenericRuntime extends IJavaRuntime {
- // no additional methods
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntimeWorkingCopy.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntimeWorkingCopy.java
deleted file mode 100644
index 36c19659a..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntimeWorkingCopy.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.jst.server.core.IJavaRuntimeWorkingCopy;
-/**
- *
- */
-public interface IGenericRuntimeWorkingCopy extends IGenericRuntime, IJavaRuntimeWorkingCopy {
- // no new methods
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IMemento.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IMemento.java
deleted file mode 100644
index 8c0d1f1d3..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IMemento.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-/**
- * Interface to a memento used for saving the important state of an object
- * in a form that can be persisted in the file system.
- * <p>
- * Mementos were designed with the following requirements in mind:
- * <ol>
- * <li>Certain objects need to be saved and restored across platform sessions.
- * </li>
- * <li>When an object is restored, an appropriate class for an object might not
- * be available. It must be possible to skip an object in this case.</li>
- * <li>When an object is restored, the appropriate class for the object may be
- * different from the one when the object was originally saved. If so, the
- * new class should still be able to read the old form of the data.</li>
- * </ol>
- * </p>
- * <p>
- * Mementos meet these requirements by providing support for storing a
- * mapping of arbitrary string keys to primitive values, and by allowing
- * mementos to have other mementos as children (arranged into a tree).
- * A robust external storage format based on XML is used.
- * </p><p>
- * The key for an attribute may be any alpha numeric value. However, the
- * value of <code>TAG_ID</code> is reserved for internal use.
- * </p><p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
-public interface IMemento {
- /**
- * Creates a new child of this memento with the given type.
- * <p>
- * The <code>getChild</code> and <code>getChildren</code> methods
- * are used to retrieve children of a given type.
- * </p>
- *
- * @param type the type
- * @return a new child memento
- * @see #getChild
- * @see #getChildren
- */
- public IMemento createChild(String type);
-
- /**
- * Returns the first child with the given type id.
- *
- * @param type the type id
- * @return the first child with the given type
- */
- public IMemento getChild(String type);
-
- /**
- * Returns all children with the given type id.
- *
- * @param type the type id
- * @return the list of children with the given type
- */
- public IMemento[] getChildren(String type);
-
- /**
- * Returns the string value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not an integer
- */
- public String getString(String key);
-
- /**
- * Sets the value of the given key to the given string.
- *
- * @param key the key
- * @param value the value
- */
- public void putString(String key, String value);
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EELaunchableClient.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EELaunchableClient.java
deleted file mode 100644
index a3fa50b62..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EELaunchableClient.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.jst.server.core.JndiLaunchable;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.model.ClientDelegate;
-/**
- *
- */
-public class J2EELaunchableClient extends ClientDelegate {
- /*
- * @see ClientDelegate#supports(ILaunchable)
- */
- public boolean supports(IServer server, Object launchable, String launchMode) {
- return (launchable instanceof JndiLaunchable);
- }
-
- /*
- * @see ClientDelegate#launch(ILaunchable)
- */
- public IStatus launch(IServer server, Object launchable, String launchMode, ILaunch launch) {
- Trace.trace(Trace.FINEST, "JNDI client launched");
- return null;
- }
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EEUtil.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EEUtil.java
deleted file mode 100644
index 2bbf8e975..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EEUtil.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jst.server.core.IEnterpriseApplication;
-import org.eclipse.jst.server.core.IJ2EEModule;
-import org.eclipse.jst.server.core.IWebModule;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.ServerUtil;
-/**
- * Utility class for dealing with J2EE modules.
- */
-public class J2EEUtil {
- private static final String EAR_MODULE = "jst.ear";
- private static final String WEB_MODULE = "jst.web";
-
- private static final IModule[] EMPTY_LIST = new IModule[0];
- private static Map<IModule, List<IModule>> earCache;
- private static Map<IJ2EEModule, List<IModule>> earCache2;
- private static Map<IModule, List<IModule>> webCache;
- protected static String cache;
-
- /**
- * Returns the enterprise applications that the module is contained within.
- *
- * @param module a J2EE module
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly empty array of enterprise applications
- */
- public static IModule[] getEnterpriseApplications(IJ2EEModule module, IProgressMonitor monitor) {
- if (shouldUseCache()) {
- List<IModule> list = earCache2.get(module);
- if (list == null)
- return EMPTY_LIST;
- return list.toArray(new IModule[list.size()]);
- }
-
- List<IModule> list = new ArrayList<IModule>();
- IModule[] modules = ServerUtil.getModules(EAR_MODULE);
- if (modules != null) {
- for (IModule module2 : modules) {
- IEnterpriseApplication ear = (IEnterpriseApplication) module2.loadAdapter(IEnterpriseApplication.class, monitor);
- if (ear != null) {
- IModule[] modules2 = ear.getModules();
- if (modules2 != null) {
- for (IModule m : modules2) {
- if (module.equals(m.loadAdapter(IJ2EEModule.class, monitor)))
- list.add(module2);
- }
- }
- }
- }
- }
-
- return list.toArray(new IModule[list.size()]);
- }
-
- /**
- * Returns the enterprise applications that the module is contained within.
- *
- * @param module a J2EE module or utility module
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly empty array of enterprise applications
- */
- public static IModule[] getEnterpriseApplications(IModule module, IProgressMonitor monitor) {
- if (shouldUseCache()) {
- List<IModule> list = earCache.get(module);
- if (list == null)
- return EMPTY_LIST;
- return list.toArray(new IModule[list.size()]);
- }
-
- List<IModule> list = new ArrayList<IModule>();
- IModule[] modules = ServerUtil.getModules(EAR_MODULE);
- if (modules != null) {
- for (IModule module2 : modules) {
- IEnterpriseApplication ear = (IEnterpriseApplication) module2.loadAdapter(IEnterpriseApplication.class, monitor);
- if (ear != null) {
- IModule[] modules2 = ear.getModules();
- if (modules2 != null) {
- for (IModule m : modules2) {
- if (module.equals(m))
- list.add(module2);
- }
- }
- }
- }
- }
-
- return list.toArray(new IModule[list.size()]);
- }
-
- /**
- * Returns the web modules that the utility module is contained within.
- *
- * @param module a utility module
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly empty array of web modules
- */
- public static IModule[] getWebModules(IModule module, IProgressMonitor monitor) {
- if (shouldUseCache()) {
- List<IModule> list = webCache.get(module);
- if (list == null)
- return EMPTY_LIST;
- return list.toArray(new IModule[list.size()]);
- }
-
- List<IModule> list = new ArrayList<IModule>();
- IModule[] modules = ServerUtil.getModules(WEB_MODULE);
- if (modules != null) {
- for (IModule module2 : modules) {
- IWebModule web = (IWebModule) module2.loadAdapter(IWebModule.class, monitor);
- if (web != null) {
- IModule[] modules2 = web.getModules();
- if (modules2 != null) {
- for (IModule m : modules2) {
- if (module.equals(m))
- list.add(module2);
- }
- }
- }
- }
- }
-
- return list.toArray(new IModule[list.size()]);
- }
-
- private static void fillCache(IProgressMonitor monitor) {
- earCache = new HashMap<IModule, List<IModule>>();
- earCache2 = new HashMap<IJ2EEModule, List<IModule>>();
- webCache = new HashMap<IModule, List<IModule>>();
-
- IModule[] modules = ServerUtil.getModules(EAR_MODULE);
- if (modules != null) {
- for (IModule module2 : modules) {
- IEnterpriseApplication ear = (IEnterpriseApplication) module2.loadAdapter(IEnterpriseApplication.class, monitor);
- if (ear != null) {
- IModule[] modules2 = ear.getModules();
- if (modules2 != null) {
- for (IModule mm : modules2) {
- List<IModule> m = earCache.get(mm);
- if (m == null) {
- m = new ArrayList<IModule>(2);
- earCache.put(mm, m);
- }
- m.add(module2);
-
- IJ2EEModule mod = (IJ2EEModule) mm.loadAdapter(IJ2EEModule.class, monitor);
- if (mod != null) {
- m = earCache2.get(mod);
- if (m == null) {
- m = new ArrayList<IModule>(2);
- earCache2.put(mod, m);
- }
- m.add(module2);
- }
- }
- }
- }
- }
- }
-
- modules = ServerUtil.getModules(WEB_MODULE);
- if (modules != null) {
- for (IModule module2 : modules) {
- IWebModule web = (IWebModule) module2.loadAdapter(IWebModule.class, monitor);
- if (web != null) {
- IModule[] modules2 = web.getModules();
- if (modules2 != null) {
- for (IModule mm : modules2) {
- List<IModule> m = webCache.get(mm);
- if (m == null) {
- m = new ArrayList<IModule>(2);
- webCache.put(mm, m);
- }
- m.add(module2);
- }
- }
- }
- }
- }
- }
-
- private static boolean shouldUseCache() {
- String s = System.getProperty("J2EEcache");
- if (s == null || "".equals(s) || "false".equals(s)) {
- webCache = null;
- earCache = null;
- return false;
- }
- if (cache == null || !cache.equals(s)) {
- cache = s;
- fillCache(null);
- }
- return true;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JRERuntimeComponentProvider.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JRERuntimeComponentProvider.java
deleted file mode 100644
index 89afad8e7..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JRERuntimeComponentProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007,2008 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jst.common.project.facet.core.StandardJreRuntimeComponent;
-import org.eclipse.jst.server.core.IJavaRuntime;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
-import org.eclipse.wst.server.core.IRuntime;
-
-public class JRERuntimeComponentProvider extends RuntimeComponentProviderDelegate {
-
- public List<IRuntimeComponent> getRuntimeComponents(IRuntime runtime) {
- // define JRE component
- IJavaRuntime javaRuntime = (IJavaRuntime) runtime.loadAdapter(IJavaRuntime.class, null);
- if (javaRuntime != null) {
- final IVMInstall vmInstall = javaRuntime.getVMInstall();
- final IRuntimeComponent rc = StandardJreRuntimeComponent.create( vmInstall );
- return Collections.singletonList( rc );
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JavaServerPlugin.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JavaServerPlugin.java
deleted file mode 100644
index 92e05c795..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JavaServerPlugin.java
+++ /dev/null
@@ -1,363 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.VMRunnerConfiguration;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeLifecycleListener;
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.osgi.framework.BundleContext;
-/**
- * The main server tooling plugin class.
- */
-public class JavaServerPlugin extends Plugin {
- /**
- * Java server plugin id
- */
- public static final String PLUGIN_ID = "org.eclipse.jst.server.core";
-
- // singleton instance of this class
- private static JavaServerPlugin singleton;
-
- // cached copy of all runtime classpath providers
- private static List<RuntimeClasspathProviderWrapper> runtimeClasspathProviders;
-
- // cached copy of all server profilers
- private static List<ServerProfiler> serverProfilers;
-
- // runtime listener
- private static IRuntimeLifecycleListener runtimeListener;
-
- /**
- * Create the JavaServerPlugin.
- */
- public JavaServerPlugin() {
- super();
- singleton = this;
- }
-
- /**
- * Returns the singleton instance of this plugin.
- *
- * @return a singleton instance
- */
- public static JavaServerPlugin getInstance() {
- return singleton;
- }
-
- /**
- * @see Plugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
-
- runtimeListener = new IRuntimeLifecycleListener() {
- public void runtimeAdded(IRuntime runtime) {
- handleRuntimeChange(runtime, 0);
- }
-
- public void runtimeChanged(IRuntime runtime) {
- handleRuntimeChange(runtime, 1);
- }
-
- public void runtimeRemoved(IRuntime runtime) {
- handleRuntimeChange(runtime, 2);
- }
- };
-
- ServerCore.addRuntimeLifecycleListener(runtimeListener);
- }
-
- /**
- * @see Plugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context2) throws Exception {
- ServerCore.removeRuntimeLifecycleListener(runtimeListener);
- super.stop(context2);
- }
-
- /**
- * Handle a runtime change by potentially updating the classpath container.
- *
- * @param runtime a runtime
- */
- protected void handleRuntimeChange(final IRuntime runtime, final int act) {
- if (runtime == null)
- throw new IllegalArgumentException();
-
- Trace.trace(Trace.FINEST, "Possible runtime change: " + runtime);
-
- if (runtime.getRuntimeType() == null)
- return;
-
- final RuntimeClasspathProviderWrapper rcpw = findRuntimeClasspathProvider(runtime.getRuntimeType());
- if (rcpw != null && (rcpw.hasRuntimeClasspathChanged(runtime) || act != 1)) {
- final IPath serverContainerPath = new Path(RuntimeClasspathContainer.SERVER_CONTAINER)
- .append(rcpw.getId()).append(runtime.getId());
-
- class RebuildRuntimeReferencesJob extends Job {
- public RebuildRuntimeReferencesJob() {
- super(NLS.bind(Messages.updateClasspathContainers, runtime.getName()));
- }
-
- public boolean belongsTo(Object family) {
- return ServerUtil.SERVER_JOB_FAMILY.equals(family);
- }
-
- public IStatus run(IProgressMonitor monitor) {
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- if (projects != null) {
- for (IProject project : projects) {
- if (project.isAccessible()) {
- try {
- if (!project.isNatureEnabled(JavaCore.NATURE_ID))
- continue;
-
- IJavaProject javaProject = JavaCore.create(project);
-
- boolean found = false;
- IClasspathEntry[] ce = javaProject.getRawClasspath();
- for (IClasspathEntry cp : ce) {
- if (cp.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
- if (serverContainerPath.isPrefixOf(cp.getPath()))
- found = true;
- }
- }
-
- Trace.trace(Trace.FINEST, "Classpath change on: " + project + " " + found);
-
- if (found) {
- IRuntime runtime2 = runtime;
- if (act == 2)
- runtime2 = null;
- RuntimeClasspathContainer container = new RuntimeClasspathContainer(project,
- serverContainerPath, rcpw, runtime2, runtime.getId());
- JavaCore.setClasspathContainer(serverContainerPath, new IJavaProject[] { javaProject },
- new IClasspathContainer[] {container}, null);
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not update classpath container", e);
- }
- }
- }
- }
-
- return Status.OK_STATUS;
- }
- }
- RebuildRuntimeReferencesJob job = new RebuildRuntimeReferencesJob();
- job.schedule();
- }
- }
-
- /**
- * Convenience method for logging.
- *
- * @param status a status
- */
- private static void log(IStatus status) {
- getInstance().getLog().log(status);
- }
-
- public static void logWarning(String msg) {
- log(new Status(IStatus.WARNING, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- /**
- * Returns an array of all known runtime classpath provider instances.
- * <p>
- * A new array is returned on each call, so clients may store or modify the
- * result.
- * </p>
- *
- * @return a possibly-empty array of runtime classpath provider instances
- * {@link RuntimeClasspathProviderWrapper}
- */
- public static RuntimeClasspathProviderWrapper[] getRuntimeClasspathProviders() {
- if (runtimeClasspathProviders == null)
- loadRuntimeClasspathProviders();
-
- RuntimeClasspathProviderWrapper[] rth = new RuntimeClasspathProviderWrapper[runtimeClasspathProviders.size()];
- runtimeClasspathProviders.toArray(rth);
- return rth;
- }
-
- /**
- * Returns the runtime classpath provider that supports the given runtime type, or <code>null</code>
- * if none. This convenience method searches the list of known runtime
- * classpath providers ({@link #getRuntimeClasspathProviders()}) for the one with
- * a matching runtime type.
- * The runtimeType may not be null.
- *
- * @param runtimeType a runtime type
- * @return the runtime classpath provider instance, or <code>null</code> if
- * there is no runtime classpath provider that supports the given id
- */
- public static RuntimeClasspathProviderWrapper findRuntimeClasspathProvider(IRuntimeType runtimeType) {
- if (runtimeType == null)
- throw new IllegalArgumentException();
-
- if (runtimeClasspathProviders == null)
- loadRuntimeClasspathProviders();
-
- Iterator iterator = runtimeClasspathProviders.iterator();
- while (iterator.hasNext()) {
- RuntimeClasspathProviderWrapper runtimeClasspathProvider = (RuntimeClasspathProviderWrapper) iterator.next();
- if (runtimeClasspathProvider.supportsRuntimeType(runtimeType))
- return runtimeClasspathProvider;
- }
- return null;
- }
-
- /**
- * Returns the runtime classpath provider that supports the given runtime type id,
- * or <code>null</code> if none. This convenience method searches the list of known
- * runtime classpath providers ({@link #getRuntimeClasspathProviders()}) for the one
- * with a matching runtime type id. The id may not be null.
- *
- * @param id a runtime type id
- * @return the runtime classpath provider instance, or <code>null</code> if
- * there is no runtime classpath provider that supports the given id
- */
- public static RuntimeClasspathProviderWrapper findRuntimeClasspathProviderBySupport(String id) {
- if (id == null)
- throw new IllegalArgumentException();
-
- if (runtimeClasspathProviders == null)
- loadRuntimeClasspathProviders();
-
- Iterator iterator = runtimeClasspathProviders.iterator();
- while (iterator.hasNext()) {
- RuntimeClasspathProviderWrapper runtimeClasspathProvider = (RuntimeClasspathProviderWrapper) iterator.next();
- if (runtimeClasspathProvider.supportsRuntimeType(id))
- return runtimeClasspathProvider;
- }
- return null;
- }
-
- /**
- * Returns the runtime classpath provider with the given id, or <code>null</code>
- * if none. This convenience method searches the list of known runtime
- * classpath providers ({@link #getRuntimeClasspathProviders()}) for the one with
- * a matching runtime classpath provider id ({@link RuntimeClasspathProviderWrapper#getId()}).
- * The id may not be null.
- *
- * @param id the runtime classpath provider id
- * @return the runtime classpath provider instance, or <code>null</code> if
- * there is no runtime classpath provider with the given id
- */
- public static RuntimeClasspathProviderWrapper findRuntimeClasspathProvider(String id) {
- if (id == null)
- throw new IllegalArgumentException();
-
- if (runtimeClasspathProviders == null)
- loadRuntimeClasspathProviders();
-
- Iterator iterator = runtimeClasspathProviders.iterator();
- while (iterator.hasNext()) {
- RuntimeClasspathProviderWrapper runtimeClasspathProvider = (RuntimeClasspathProviderWrapper) iterator.next();
- if (id.equals(runtimeClasspathProvider.getId()))
- return runtimeClasspathProvider;
- }
- return null;
- }
-
- /**
- * Load the runtime classpath providers.
- */
- private static synchronized void loadRuntimeClasspathProviders() {
- if (runtimeClasspathProviders != null)
- return;
- Trace.trace(Trace.CONFIG, "->- Loading .runtimeClasspathProviders extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(JavaServerPlugin.PLUGIN_ID, "runtimeClasspathProviders");
-
- List<RuntimeClasspathProviderWrapper> list = new ArrayList<RuntimeClasspathProviderWrapper>(cf.length);
- for (IConfigurationElement ce : cf) {
- try {
- list.add(new RuntimeClasspathProviderWrapper(ce));
- Trace.trace(Trace.CONFIG, " Loaded runtimeClasspathProviders: " + ce.getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load runtimeClasspathProviders: " + ce.getAttribute("id"), t);
- }
- }
- runtimeClasspathProviders = list;
-
- Trace.trace(Trace.CONFIG, "-<- Done loading .runtimeClasspathProviders extension point -<-");
- }
-
- /**
- * Returns an array of all known server profiler instances.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of server profiler instances
- * {@link ServerProfiler}
- */
- public static ServerProfiler[] getServerProfilers() {
- if (serverProfilers == null)
- loadServerProfilers();
-
- ServerProfiler[] sp = new ServerProfiler[serverProfilers.size()];
- serverProfilers.toArray(sp);
- return sp;
- }
-
- /**
- * Load the server profilers.
- */
- private static synchronized void loadServerProfilers() {
- if (serverProfilers != null)
- return;
- Trace.trace(Trace.CONFIG, "->- Loading .serverProfilers extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(JavaServerPlugin.PLUGIN_ID, "serverProfilers");
-
- List<ServerProfiler> list = new ArrayList<ServerProfiler>(cf.length);
- for (IConfigurationElement ce : cf) {
- try {
- list.add(new ServerProfiler(ce));
- Trace.trace(Trace.CONFIG, " Loaded serverProfiler: " + ce.getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load serverProfiler: " + ce.getAttribute("id"), t);
- }
- }
- serverProfilers = list;
-
- Trace.trace(Trace.CONFIG, "-<- Done loading .serverProfilers extension point -<-");
- }
-
- public static void configureProfiling(ILaunch launch, IVMInstall vmInstall, VMRunnerConfiguration vmConfig, IProgressMonitor monitor) throws CoreException {
- ServerProfiler[] sp = JavaServerPlugin.getServerProfilers();
- if (sp == null || sp.length == 0)
- throw new CoreException(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, Messages.errorNoProfiler, null));
-
- sp[0].process(launch, vmInstall, vmConfig, monitor);
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/LaunchConfigurationUtil.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/LaunchConfigurationUtil.java
deleted file mode 100644
index 2ffe1686a..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/LaunchConfigurationUtil.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-/**
- *
- */
-public class LaunchConfigurationUtil {
- /**
- * Gets the classpath from the launch configuration of the given server.
- * If create is false, it will return null if there is no launch configuration
- * (i.e. the server has not been run before) If create is true, it will create
- * a launch configuration if one does not exist.
- *
- * @param server
- * @param create
- * @param monitor a progress monitor
- * @return an array containing runtime classpath entries
- * @throws CoreException
- */
- /*public static IRuntimeClasspathEntry[] getClasspath(IServer server, boolean create, IProgressMonitor monitor) throws CoreException {
- ILaunchConfiguration config = server.getLaunchConfiguration(create, monitor);
- if (config == null)
- return null;
-
- return JavaRuntime.computeUnresolvedRuntimeClasspath(config);
- }*/
-
- /**
- * Sets the classpath on the given server's launch configuration.
- *
- * @param server
- * @param classpath
- * @throws CoreException
- */
- /*public static void setClasspath(IServer server, IRuntimeClasspathEntry[] classpath, IProgressMonitor monitor) throws CoreException {
- ILaunchConfiguration config = server.getLaunchConfiguration(true, monitor);
- ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
-
- List mementos = new ArrayList(classpath.length);
- for (int i = 0; i < classpath.length; i++) {
- IRuntimeClasspathEntry entry = classpath[i];
- mementos.add(entry.getMemento());
- }
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, mementos);
- wc.doSave();
- }*/
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.java
deleted file mode 100644
index 472d5b686..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-/**
- * Translated messages.
- */
-public class Messages extends NLS {
- public static String errorLocation;
- public static String errorJRE;
- public static String classpathContainerDescription;
- public static String classpathContainer;
- public static String classpathContainerUnbound;
-
- public static String copyingTask;
- public static String deletingTask;
- public static String errorCopyingFile;
- public static String errorCreatingZipFile;
- public static String errorDelete;
- public static String errorRename;
- public static String errorReading;
- public static String updateClasspathContainers;
- public static String errorNoRuntime;
- public static String errorFacet;
- public static String errorDeleting;
- public static String errorNotADirectory;
- public static String errorMkdir;
-
- public static String artifactServlet;
- public static String artifactEJB;
- public static String artifactJNDI;
-
- public static String canModifyModules;
- public static String errorNoProfiler;
- public static String errorPublish;
- public static String httpPort;
- public static String errorPortInUse;
-
- static {
- NLS.initializeMessages(JavaServerPlugin.PLUGIN_ID + ".internal.Messages", Messages.class);
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.properties b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.properties
deleted file mode 100644
index dafe96be3..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 2007 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
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-classpathContainerDescription=Server Library
-classpathContainer={0} [{1}]
-classpathContainerUnbound={0} [{1}] (unbound)
-
-errorLocation=Invalid location.
-errorJRE=Invalid JRE.
-
-copyingTask=Copying from {0} to {1}
-deletingTask=Deleting {0}
-errorCopyingFile=Error copying file {0}: {1}
-errorCreatingZipFile=Error creating zip file {0}: {1}
-errorDelete=Could not delete previous copy, which may be locked by another process.
-errorRename=Could not replace with temp file {0}.
-errorReading=Error reading file {0}
-errorNoRuntime=Cannot verify facets because there is no runtime associated with the server.
-errorFacet=Project facet {0} version {1} is not supported.
-errorDeleting=Could not delete {0}. May be locked by another process.
-errorNotADirectory=Could not delete {0} since it is not a directory.
-errorMkdir=Could not create directory {0}.
-
-updateClasspathContainers=Updating classpath container for {0}
-
-artifactServlet=Servlet {0}
-artifactEJB=EJB {0}
-artifactJNDI=JNDI {0}
-
-canModifyModules=Web module can be added to the server.
-errorNoProfiler=Could not launch in profiling mode because no profilers are configured.
-errorPublish=An error occurred during publishing.
-httpPort=HTTP Port
-errorPortInUse=Port {0} required by {1} is already in use. The server may already be running in another process, or a system process may be using the port. \
- To start this server you will need to stop the other process or change the port number(s). \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ProgressUtil.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ProgressUtil.java
deleted file mode 100644
index 61d99d626..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ProgressUtil.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.core.runtime.*;
-/**
- * Progress Monitor utility.
- */
-public class ProgressUtil {
- /**
- * ProgressUtil constructor comment.
- */
- private ProgressUtil() {
- super();
- }
-
- /**
- * Return a valid progress monitor.
- *
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- * @return org.eclipse.core.runtime.IProgressMonitor
- */
- public static IProgressMonitor getMonitorFor(IProgressMonitor monitor) {
- if (monitor == null)
- return new NullProgressMonitor();
- return monitor;
- }
-
- /**
- * Return a sub-progress monitor with the given amount on the
- * current progress monitor.
- *
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- * @param ticks int
- * @return org.eclipse.core.runtime.IProgressMonitor
- */
- public static IProgressMonitor getSubMonitorFor(IProgressMonitor monitor, int ticks) {
- if (monitor == null)
- return new NullProgressMonitor();
- if (monitor instanceof NullProgressMonitor)
- return monitor;
- return new SubProgressMonitor(monitor, ticks);
- }
-
- /**
- * Return a sub-progress monitor with the given amount on the
- * current progress monitor.
- *
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- * @param ticks a number of ticks
- * @param style a style
- * @return org.eclipse.core.runtime.IProgressMonitor
- */
- public static IProgressMonitor getSubMonitorFor(IProgressMonitor monitor, int ticks, int style) {
- if (monitor == null)
- return new NullProgressMonitor();
- if (monitor instanceof NullProgressMonitor)
- return monitor;
- return new SubProgressMonitor(monitor, ticks, style);
- }
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java
deleted file mode 100644
index d044b051c..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.osgi.util.NLS;
-
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeType;
-/**
- *
- */
-public class RuntimeClasspathContainer implements IClasspathContainer {
- /**
- * The server container id.
- */
- public static final String SERVER_CONTAINER = JavaServerPlugin.PLUGIN_ID + ".container";
-
- private IPath path;
- private RuntimeClasspathProviderWrapper delegate;
- private IRuntime runtime;
- private String runtimeId;
- private IProject project;
-
- /**
- * Create a new runtime classpath container.
- *
- * @param path
- * @param delegate
- * @param runtime
- * @deprecated should use the constructor that accepts a project
- */
- public RuntimeClasspathContainer(IPath path, RuntimeClasspathProviderWrapper delegate, IRuntime runtime) {
- this.path = path;
- this.delegate = delegate;
- this.runtime = runtime;
- }
-
- /**
- * Create a new runtime classpath container.
- *
- * @param project
- * @param path
- * @param delegate
- * @param runtime
- * @param runtimeId
- */
- public RuntimeClasspathContainer(IProject project, IPath path, RuntimeClasspathProviderWrapper delegate, IRuntime runtime, String runtimeId) {
- this.project = project;
- this.path = path;
- this.delegate = delegate;
- this.runtime = runtime;
- this.runtimeId = runtimeId;
- }
-
- /** (non-Javadoc)
- * @see org.eclipse.jdt.core.IClasspathContainer#getClasspathEntries()
- */
- public IClasspathEntry[] getClasspathEntries() {
- IClasspathEntry[] entries = null;
- if (delegate != null && runtime != null)
- entries = delegate.resolveClasspathContainerImpl(project, runtime);
-
- if (entries == null)
- return new IClasspathEntry[0];
-
- return entries;
- }
-
- /** (non-Javadoc)
- * @see org.eclipse.jdt.core.IClasspathContainer#getDescription()
- */
- public String getDescription() {
- if (runtime != null) {
- IRuntimeType runtimeType = runtime.getRuntimeType();
- if (runtimeType != null)
- return NLS.bind(Messages.classpathContainer, runtimeType.getName(), runtime.getName());
- }
- return NLS.bind(Messages.classpathContainerUnbound, Messages.classpathContainerDescription, runtimeId);
- }
-
- /** (non-Javadoc)
- * @see org.eclipse.jdt.core.IClasspathContainer#getKind()
- */
- public int getKind() {
- return IClasspathContainer.K_APPLICATION;
- }
-
- /** (non-Javadoc)
- * @see org.eclipse.jdt.core.IClasspathContainer#getPath()
- */
- public IPath getPath() {
- return path;
- }
-
- public boolean equals(Object obj) {
- if (!(obj instanceof RuntimeClasspathContainer))
- return false;
-
- RuntimeClasspathContainer rcc = (RuntimeClasspathContainer) obj;
- if (delegate != null && !delegate.equals(rcc.delegate))
- return false;
-
- if (runtime == null && rcc.runtime != null)
- return false;
-
- if (runtime != null && !runtime.equals(rcc.runtime))
- return false;
-
- if (runtimeId != null && !runtimeId.equals(rcc.runtimeId))
- return false;
-
- if (project == null && rcc.project != null)
- return false;
-
- if (project != null && !project.equals(rcc.project))
- return false;
-
- if (path != null && !path.equals(rcc.path))
- return false;
-
- return true;
- }
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainerInitializer.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainerInitializer.java
deleted file mode 100644
index 4d17ce5b3..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainerInitializer.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jdt.core.*;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.ServerUtil;
-/**
- *
- */
-public class RuntimeClasspathContainerInitializer extends ClasspathContainerInitializer {
- /** (non-Javadoc)
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#initialize(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
- */
- public void initialize(IPath containerPath, IJavaProject project) throws CoreException {
- if (containerPath.segmentCount() > 0) {
- if (containerPath.segment(0).equals(RuntimeClasspathContainer.SERVER_CONTAINER)) {
- RuntimeClasspathProviderWrapper delegate = null;
- IRuntime runtime = null;
- String runtimeId = null;
- if (containerPath.segmentCount() > 2) {
- delegate = JavaServerPlugin.findRuntimeClasspathProvider(containerPath.segment(1));
-
- runtimeId = containerPath.segment(2);
- if (runtimeId != null)
- runtime = ServerCore.findRuntime(runtimeId);
- }
- RuntimeClasspathContainer container = new RuntimeClasspathContainer(project.getProject(), containerPath, delegate, runtime, runtimeId);
- JavaCore.setClasspathContainer(containerPath, new IJavaProject[] {project}, new IClasspathContainer[] {container}, null);
- }
- }
- }
-
- /** (non-Javadoc)
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#getDescription(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
- */
- public String getDescription(IPath containerPath, IJavaProject project) {
- return Messages.classpathContainerDescription;
- }
-
- /** (non-Javadoc)
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#canUpdateClasspathContainer(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
- */
- public boolean canUpdateClasspathContainer(IPath containerPath, IJavaProject project) {
- return true;
- }
-
- /** (non-Javadoc)
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#requestClasspathContainerUpdate(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject, org.eclipse.jdt.core.IClasspathContainer)
- */
- public void requestClasspathContainerUpdate(IPath containerPath, IJavaProject project, IClasspathContainer containerSuggestion) throws CoreException {
- if (containerPath.segmentCount() > 0) {
- if (containerPath.segment(0).equals(RuntimeClasspathContainer.SERVER_CONTAINER)) {
- RuntimeClasspathProviderWrapper delegate = null;
- IRuntime runtime = null;
- if (containerPath.segmentCount() > 2) {
- delegate = JavaServerPlugin.findRuntimeClasspathProvider(containerPath.segment(1));
- String runtimeId = containerPath.segment(2);
- if (runtimeId != null)
- runtime = ServerCore.findRuntime(runtimeId);
- delegate.requestClasspathContainerUpdate(runtime, containerSuggestion.getClasspathEntries());
- //JavaCore.setClasspathContainer(containerPath, new IJavaProject[] { project },
- // new IClasspathContainer[] { containerSuggestion }, new NullProgressMonitor());
- updateClasspath(runtime, containerPath, containerSuggestion);
- }
- }
- }
- }
-
- public static void updateClasspath(final IRuntime runtime, final IPath containerPath, final IClasspathContainer containerSuggestion) {
- class UpdateClasspathJob extends Job {
- public UpdateClasspathJob() {
- super(NLS.bind(Messages.updateClasspathContainers, runtime.getName()));
- }
-
- public boolean belongsTo(Object family) {
- return ServerUtil.SERVER_JOB_FAMILY.equals(family);
- }
-
- public IStatus run(IProgressMonitor monitor) {
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- List<IJavaProject> list = new ArrayList<IJavaProject>();
- if (projects != null) {
- for (IProject project : projects) {
- if (project.isAccessible()) {
- try {
- if (!project.isNatureEnabled(JavaCore.NATURE_ID))
- continue;
-
- IJavaProject javaProject = JavaCore.create(project);
-
- boolean found = false;
- IClasspathEntry[] ce = javaProject.getRawClasspath();
- for (IClasspathEntry cp : ce) {
- if (cp.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
- if (containerPath.isPrefixOf(cp.getPath()))
- found = true;
- }
- }
-
- Trace.trace(Trace.FINEST, "Classpath change on: " + project + " " + found);
-
- if (found)
- list.add(javaProject);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not update classpath container", e);
- }
- }
- }
- }
-
- int size = list.size();
- if (size > 0) {
- IJavaProject[] javaProjects = new IJavaProject[size];
- list.toArray(javaProjects);
- IClasspathContainer[] containers = new IClasspathContainer[size];
- for (int i = 0; i < size; i++)
- containers[i] = containerSuggestion;
-
- try {
- JavaCore.setClasspathContainer(containerPath, javaProjects, containers, monitor);
- } catch (JavaModelException jme) {
- return jme.getStatus();
- }
- }
-
- return Status.OK_STATUS;
- }
- }
- UpdateClasspathJob job = new UpdateClasspathJob();
- job.schedule();
- }
-
- /** (non-Javadoc)
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#getComparisonID(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
- */
- public Object getComparisonID(IPath containerPath, IJavaProject project) {
- if (containerPath == null)
- return null;
-
- return containerPath.toPortableString();
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProvider.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProvider.java
deleted file mode 100644
index 86aafe98f..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProvider.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2005, 2007 BEA Systems, Inc.
- * 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Konstantin Komissarchik - initial API and implementation
- * IBM Corporation - Support for all server types
- ******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.common.project.facet.core.IClasspathProvider;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
-/**
- *
- */
-public class RuntimeClasspathProvider implements IClasspathProvider {
- private static final IProjectFacet WEB_FACET = ProjectFacetsManager.getProjectFacet("jst.web");
- private static final IProjectFacet EJB_FACET = ProjectFacetsManager.getProjectFacet("jst.ejb");
- private static final IProjectFacet EAR_FACET = ProjectFacetsManager.getProjectFacet("jst.ear");
- private static final IProjectFacet UTILITY_FACET = ProjectFacetsManager.getProjectFacet("jst.utility");
- private static final IProjectFacet CONNECTOR_FACET = ProjectFacetsManager.getProjectFacet("jst.connector");
- private static final IProjectFacet APP_CLIENT_FACET = ProjectFacetsManager.getProjectFacet("jst.appclient");
-
- private IRuntimeComponent rc;
-
- public RuntimeClasspathProvider(IRuntimeComponent rc) {
- this.rc = rc;
- }
-
- public List getClasspathEntries(IProjectFacetVersion fv) {
- IProjectFacet pf = fv.getProjectFacet();
- if (pf == null)
- return null;
-
- if (pf.equals(WEB_FACET) || pf.equals(EJB_FACET) || pf.equals(EAR_FACET) ||
- pf.equals(UTILITY_FACET) || pf.equals(CONNECTOR_FACET) || pf.equals(APP_CLIENT_FACET)) {
- String runtimeTypeId = rc.getProperty("type-id");
- String runtimeId = rc.getProperty("id");
- if (runtimeTypeId == null || runtimeId == null)
- return null;
- RuntimeClasspathProviderWrapper rcpw = JavaServerPlugin.findRuntimeClasspathProviderBySupport(runtimeTypeId);
- if (rcpw != null) {
- IPath path = new Path(RuntimeClasspathContainer.SERVER_CONTAINER);
- path = path.append(rcpw.getId()).append(runtimeId);
- IClasspathEntry cpentry = JavaCore.newContainerEntry(path);
- return Collections.singletonList(cpentry);
- }
- }
-
- return null;
- }
-
- public static final class Factory implements IAdapterFactory {
- private static final Class[] ADAPTER_TYPES = { IClasspathProvider.class };
-
- public Object getAdapter(Object adaptable, Class adapterType) {
- IRuntimeComponent rc = (IRuntimeComponent) adaptable;
- return new RuntimeClasspathProvider(rc);
- }
-
- public Class[] getAdapterList() {
- return ADAPTER_TYPES;
- }
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProviderWrapper.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProviderWrapper.java
deleted file mode 100644
index 279a7f1cc..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProviderWrapper.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-/**
- *
- */
-public class RuntimeClasspathProviderWrapper {
- private IConfigurationElement element;
- private RuntimeClasspathProviderDelegate delegate;
-
- /**
- * Create a new runtime target handler.
- *
- * @param element a configuration element
- */
- public RuntimeClasspathProviderWrapper(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- protected IConfigurationElement getElement() {
- return element;
- }
-
- /**
- *
- * @return the id
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /**
- * Returns the order.
- *
- * @return the order
- */
- public int getOrder() {
- try {
- String o = element.getAttribute("order");
- return Integer.parseInt(o);
- } catch (NumberFormatException e) {
- return -1;
- }
- }
-
- public String[] getRuntimeTypeIds() {
- try {
- List<String> list = new ArrayList<String>();
- StringTokenizer st = new StringTokenizer(element.getAttribute("runtimeTypeIds"), ",");
- while (st.hasMoreTokens()) {
- String str = st.nextToken();
- if (str != null && str.length() > 0)
- list.add(str.trim());
- }
- String[] s = new String[list.size()];
- list.toArray(s);
- return s;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not parse runtime type ids: " + element);
- return null;
- }
- }
-
- /**
- * Returns true if the given server resource type (given by the
- * id) can be opened with this editor. This result is based on
- * the result of the getServerResources() method.
- *
- * @param runtimeType a runtime type
- * @return boolean
- */
- public boolean supportsRuntimeType(IRuntimeType runtimeType) {
- if (runtimeType == null)
- return false;
- return supportsRuntimeType(runtimeType.getId());
- }
-
- /**
- * Returns true if the given server resource type (given by the
- * id) can be opened with this editor. This result is based on
- * the result of the getServerResources() method.
- *
- * @param id a runtime type id
- * @return boolean
- */
- public boolean supportsRuntimeType(String id) {
- if (id == null || id.length() == 0)
- return false;
-
- String[] s = getRuntimeTypeIds();
- if (s == null)
- return false;
-
- for (String ss : s) {
- if (ss.endsWith("*")) {
- if (id.length() >= ss.length() && id.startsWith(ss.substring(0, ss.length() - 1)))
- return true;
- } else if (id.equals(ss))
- return true;
- }
- return false;
- }
-
- /*
- * Loads the delegate class.
- */
- public RuntimeClasspathProviderDelegate getDelegate() {
- if (delegate == null) {
- try {
- delegate = (RuntimeClasspathProviderDelegate) element.createExecutableExtension("class");
- delegate.initialize(getId());
- } catch (Throwable t) {
- ServerPlugin.logExtensionFailure(toString(), t);
- }
- }
- return delegate;
- }
-
- /*
- * @see RuntimeClasspathProviderDelegate#resolveClasspathContainerImpl(IProject, IRuntime)
- */
- public IClasspathEntry[] resolveClasspathContainerImpl(IProject project, IRuntime runtime) {
- if (runtime == null)
- return null;
- try {
- return getDelegate().resolveClasspathContainerImpl(project, runtime);
- } catch (Exception e) {
- ServerPlugin.logExtensionFailure(toString(), e);
- }
- return null;
- }
-
- public void requestClasspathContainerUpdate(IRuntime runtime, IClasspathEntry[] entries) {
- if (runtime == null)
- return;
- try {
- getDelegate().requestClasspathContainerUpdate(runtime, entries);
- } catch (Exception e) {
- ServerPlugin.logExtensionFailure(toString(), e);
- }
- }
-
- /*
- * @see RuntimeClasspathProviderDelegate#hasRuntimeClasspathChanged(IRuntime)
- */
- public boolean hasRuntimeClasspathChanged(IRuntime runtime) {
- if (runtime == null)
- return false;
- try {
- return getDelegate().hasRuntimeClasspathChanged(runtime);
- } catch (Exception e) {
- ServerPlugin.logExtensionFailure(toString(), e);
- }
- return false;
- }
-
- public String toString() {
- return "RuntimeClasspathProviderWrapper[" + getId() + "]";
- }
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderDelegate.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderDelegate.java
deleted file mode 100644
index 968e4dd46..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderDelegate.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.wst.server.core.internal.facets.RuntimeFacetComponentProviderDelegate;
-/**
- * A runtime component provider can provide additional runtime components for a facet runtime.
- * This provider is scoped by runtime type and may provide components for multiple
- * runtime instances.
- * <p>
- * This abstract class is intended to be extended only by clients
- * to extend the <code>internalRuntimeComponentProviders</code> extension point.
- * </p>
- * <p>
- * <b>Provisional API:</b> This class/interface 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.
- * </p>
- *
- * @plannedfor 2.0
- */
-public abstract class RuntimeComponentProviderDelegate extends RuntimeFacetComponentProviderDelegate {
- // nothing added
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderWrapper.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderWrapper.java
deleted file mode 100644
index 522eafb20..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderWrapper.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-/**
- *
- */
-public class RuntimeComponentProviderWrapper {
- private IConfigurationElement element;
- private RuntimeComponentProviderDelegate delegate;
-
- /**
- * Create a new runtime component handler.
- *
- * @param element a configuration element
- */
- public RuntimeComponentProviderWrapper(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- protected IConfigurationElement getElement() {
- return element;
- }
-
- /**
- *
- * @return the id
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- public String[] getRuntimeTypeIds() {
- try {
- List<String> list = new ArrayList<String>();
- StringTokenizer st = new StringTokenizer(element.getAttribute("runtimeTypeIds"), ",");
- while (st.hasMoreTokens()) {
- String str = st.nextToken();
- if (str != null && str.length() > 0)
- list.add(str.trim());
- }
- String[] s = new String[list.size()];
- list.toArray(s);
- return s;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not parse runtime type ids: " + element);
- return null;
- }
- }
-
- /**
- * Returns true if the given server resource type (given by the
- * id) can be opened with this editor. This result is based on
- * the result of the getServerResources() method.
- *
- * @param runtimeType a runtime type
- * @return boolean
- */
- public boolean supportsRuntimeType(IRuntimeType runtimeType) {
- if (runtimeType == null)
- return false;
- String id = runtimeType.getId();
- if (id == null || id.length() == 0)
- return false;
-
- String[] s = getRuntimeTypeIds();
- if (s == null)
- return false;
-
- for (String ss : s) {
- if (ss.endsWith("*")) {
- if (id.length() >= ss.length() && id.startsWith(ss.substring(0, ss.length() - 1)))
- return true;
- } else if (id.equals(ss))
- return true;
- }
- return false;
- }
-
- /*
- * Loads the delegate class.
- */
- protected RuntimeComponentProviderDelegate getDelegate() {
- if (delegate == null) {
- try {
- delegate = (RuntimeComponentProviderDelegate) element.createExecutableExtension("class");
- } catch (Throwable t) {
- ServerPlugin.logExtensionFailure(toString(), t);
- }
- }
- return delegate;
- }
-
- /*
- * @see RuntimeFacetComponentProviderDelegate#getRuntimeComponents(IRuntime)
- */
- public List<IRuntimeComponent> getComponents(IRuntime runtime) {
- if (runtime == null)
- return null;
- try {
- return getDelegate().getRuntimeComponents(runtime);
- } catch (Exception e) {
- ServerPlugin.logExtensionFailure(toString(), e);
- }
- return null;
- }
-
- public String toString() {
- return "RuntimeComponentProviderWrapper[" + getId() + "]";
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeFacetMapping.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeFacetMapping.java
deleted file mode 100644
index 72cd04537..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeFacetMapping.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-/**
- *
- */
-public class RuntimeFacetMapping {
- private IConfigurationElement element;
-
- /**
- * Create a new runtime facet mapping.
- *
- * @param element a configuration element
- */
- public RuntimeFacetMapping(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- /**
- *
- * @return the id
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /**
- *
- * @return the id
- */
- public String getRuntimeTypeId() {
- return element.getAttribute("runtimeTypeId");
- }
-
- /**
- *
- * @return the id
- */
- public String getVersion() {
- return element.getAttribute("version");
- }
-
- /**
- *
- * @return the id
- */
- public String getRuntimeComponent() {
- return element.getAttribute("runtime-component");
- }
-
- public String toString() {
- return "RuntimeFacetMapping[" + getId() + "]";
- }
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ServerProfiler.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ServerProfiler.java
deleted file mode 100644
index 7ab30035d..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ServerProfiler.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.VMRunnerConfiguration;
-import org.eclipse.jst.server.core.ServerProfilerDelegate;
-/**
- *
- */
-public class ServerProfiler {
- private IConfigurationElement element;
- private ServerProfilerDelegate delegate;
-
- /**
- * Create a new server profiler.
- *
- * @param element a configuration element
- */
- public ServerProfiler(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- /**
- *
- * @return the id
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /**
- *
- * @return the name
- */
- public String getName() {
- return element.getAttribute("name");
- }
-
- /*
- * Loads the delegate class.
- */
- protected ServerProfilerDelegate getDelegate() {
- if (delegate == null) {
- if (element.getAttribute("class") == null)
- return null;
- try {
- delegate = (ServerProfilerDelegate) element.createExecutableExtension("class");
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create delegate " + toString(), t);
- }
- }
- return delegate;
- }
-
- /**
- * @deprecated Switch to new API via TODO
- * @return the VM args
- */
- public String getVMArgs() {
- return null;
- }
-
- public void process(ILaunch launch, IVMInstall vmInstall, VMRunnerConfiguration vmConfig, IProgressMonitor monitor) throws CoreException {
- try {
- ServerProfilerDelegate del = getDelegate();
- if (del != null)
- del.process(launch, vmInstall, vmConfig, monitor);
- } catch (CoreException ce) {
- Trace.trace(Trace.SEVERE, "Could not create delegate " + toString(), ce);
- throw ce;
- }
- }
-
- public String toString() {
- return "ServerProfiler[" + getId() + "]";
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Trace.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Trace.java
deleted file mode 100644
index fd470af25..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Trace.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-/**
- * Helper class to route trace output.
- */
-public class Trace {
- /**
- * Config tracing
- */
- public static final byte CONFIG = 0;
- /**
- * Warning tracing
- */
- public static final byte WARNING = 1;
- /**
- * Severe tracing
- */
- public static final byte SEVERE = 2;
- /**
- * Finest tracing
- */
- public static final byte FINEST = 3;
-
- public static final byte PUBLISHING = 4;
-
- private static Set<String> logged = new HashSet<String>();
-
- /**
- * Trace constructor comment.
- */
- private Trace() {
- super();
- }
-
- /**
- * Trace the given text.
- *
- * @param level trace level
- * @param s String
- */
- public static void trace(byte level, String s) {
- Trace.trace(level, s, null);
- }
-
- /**
- * Trace the given message and exception.
- *
- * @param level trace level
- * @param s String
- * @param t Throwable
- */
- public static void trace(byte level, String s, Throwable t) {
- if (s == null)
- return;
-
- if (level == SEVERE) {
- if (!logged.contains(s)) {
- JavaServerPlugin.getInstance().getLog().log(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, s, t));
- logged.add(s);
- }
- }
-
- if (!JavaServerPlugin.getInstance().isDebugging())
- return;
-
- System.out.println(JavaServerPlugin.PLUGIN_ID + " " + s);
- if (t != null)
- t.printStackTrace();
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/XMLMemento.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/XMLMemento.java
deleted file mode 100644
index 119f14ddf..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/XMLMemento.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.io.*;
-import java.util.*;
-
-import org.w3c.dom.*;
-import org.xml.sax.*;
-
-import javax.xml.parsers.*;
-import javax.xml.transform.*;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-/**
- * A Memento is a class independent container for persistence
- * info. It is a reflection of 3 storage requirements.
- *
- * 1) We need the ability to persist an object and restore it.
- * 2) The class for an object may be absent. If so we would
- * like to skip the object and keep reading.
- * 3) The class for an object may change. If so the new class
- * should be able to read the old persistence info.
- *
- * We could ask the objects to serialize themselves into an
- * ObjectOutputStream, DataOutputStream, or Hashtable. However
- * all of these approaches fail to meet the second requirement.
- *
- * Memento supports binary persistance with a version ID.
- */
-public final class XMLMemento implements IMemento {
- private Document factory;
- private Element element;
-
- /**
- * Answer a memento for the document and element. For simplicity
- * you should use createReadRoot and createWriteRoot to create the initial
- * mementos on a document.
- */
- private XMLMemento(Document doc, Element el) {
- factory = doc;
- element = el;
- }
-
- /**
- * @see IMemento#createChild(String)
- */
- public IMemento createChild(String type) {
- Element child = factory.createElement(type);
- element.appendChild(child);
- return new XMLMemento(factory, child);
- }
-
- /**
- * Create a Document from a Reader and answer a root memento for reading
- * a document.
- */
- private static XMLMemento createReadRoot(InputStream in) {
- Document document = null;
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder parser = factory.newDocumentBuilder();
- document = parser.parse(new InputSource(in));
- Node node = document.getFirstChild();
- if (node instanceof Element)
- return new XMLMemento(document, (Element) node);
- } catch (Exception e) {
- // ignore
- } finally {
- try {
- in.close();
- } catch (Exception e) {
- // ignore
- }
- }
- return null;
- }
-
- /**
- * Answer a root memento for writing a document.
- *
- * @param type a type
- * @return a memento
- */
- public static XMLMemento createWriteRoot(String type) {
- Document document;
- try {
- document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
- Element element = document.createElement(type);
- document.appendChild(element);
- return new XMLMemento(document, element);
- } catch (ParserConfigurationException e) {
- throw new Error(e);
- }
- }
-
- /*
- * @see IMemento
- */
- public IMemento getChild(String type) {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0)
- return null;
-
- // Find the first node which is a child of this node.
- for (int nX = 0; nX < size; nX ++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element2 = (Element)node;
- if (element2.getNodeName().equals(type))
- return new XMLMemento(factory, element2);
- }
- }
-
- // A child was not found.
- return null;
- }
-
- /*
- * @see IMemento
- */
- public IMemento [] getChildren(String type) {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0)
- return new IMemento[0];
-
- // Extract each node with given type.
- List<Element> list = new ArrayList<Element>(size);
- for (int nX = 0; nX < size; nX ++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element2 = (Element)node;
- if (element2.getNodeName().equals(type))
- list.add(element2);
- }
- }
-
- // Create a memento for each node.
- size = list.size();
- IMemento [] results = new IMemento[size];
- for (int x = 0; x < size; x ++) {
- results[x] = new XMLMemento(factory, list.get(x));
- }
- return results;
- }
-
- /*
- * @see IMemento
- */
- public String getString(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- return attr.getValue();
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param filename java.lang.String
- * @exception java.io.IOException
- * @return a memento
- */
- public static IMemento loadMemento(String filename) throws IOException {
- InputStream in = null;
- try {
- in = new BufferedInputStream(new FileInputStream(filename));
- return XMLMemento.createReadRoot(in);
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
-
- /*
- * @see IMemento
- */
- public void putString(String key, String value) {
- if (value == null)
- return;
- element.setAttribute(key, value);
- }
-
- /**
- * Save this Memento to a Writer.
- *
- * @param os an output stream
- * @throws IOException if anything goes wrong
- */
- private void save(OutputStream os) throws IOException {
- Result result = new StreamResult(os);
- Source source = new DOMSource(factory);
- try {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "yes");
- transformer.setOutputProperty(OutputKeys.METHOD, "xml");
- transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
- transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "2");
- transformer.transform(source, result);
- } catch (Exception e) {
- throw (IOException) (new IOException().initCause(e));
- }
- }
-
- /**
- * Saves the memento to the given file.
- *
- * @param filename java.lang.String
- * @exception java.io.IOException
- */
- public void saveToFile(String filename) throws IOException {
- FileOutputStream w = null;
- try {
- w = new FileOutputStream(filename);
- save(w);
- } catch (IOException e) {
- throw e;
- } catch (Exception e) {
- throw new IOException(e.getLocalizedMessage());
- } finally {
- if (w != null) {
- try {
- w.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.html b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.html
deleted file mode 100644
index 0dfa3c3ae..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../../../../..//apistyles.css" type="text/css">
-<title>WTP API overview</title>
-</head>
-<body>
-<table width="500">
-<tr>
-<td>
-<p>Support for Java and J2EE server types.</p>
-</td>
-</tr>
-</table>
-<table width="500">
-<tr>
-<td>
-<p>The ClasspathRuntimeTargetHandler class provides a common subclass
-for runtime target handlers that need to modify a project's classpath
-when a project is targetted to a particular runtime.</p>
-</td>
-</tr>
-</table>
-<table width="500">
-<tr>
-<td>
-<p>IGenericRuntime and its working copy provide type-specific access
-to the generic runtime type. When using a generic runtime, clients can
-access the type specific information by adapting to these types using
-<pre>IGenericRuntime gr = (IGenericRuntime) runtime.getAdapter(IGenericRuntime.class)</pre>.
-GenericRuntimeUtil contains some utility methods for handling the
-generic runtime type.</p>
-</td>
-</tr>
-</table>
-<table width="500">
-<tr>
-<td>
-<p>IEnterpriseApplication, IEJBModule, IWebModule, IApplicationClientModule,
-and IConnectorModule are J2EE module interfaces meant to be implemented
-by module delegates that provide J2EE module support.</p>
-</td>
-</tr>
-</table>
-<table width="500">
-<tr>
-<td>
-<p>ILooseArchive and ILooseArchiveSupport are module interfaces for modules
-that take advantage of loose archive support - allowing JARs contained within
-the module to be available in a separate Java project instead of directly
-within the module.</p>
-</td>
-</tr>
-</table>
-<table width="500">
-<tr>
-<td>
-<p>The remainder of the classes in this package are module artifact and
-launchable types to provide access to J2EE resource types for the server tool
-framework.</p>
-</td>
-</tr>
-</table>
-</body>
-</html>
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.xml b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.xml
deleted file mode 100644
index b4c05295a..000000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<html>
-<head>
- <!-- Escape to the root of your source folder -->
- <meta
- name="root"
- content="../../../../../" />
- <title>WTP API overview</title>
-</head>
-
-<body>
-
-<p>Support for Java and J2EE server types.</p>
-
-<p>The ClasspathRuntimeTargetHandler class provides a common subclass
-for runtime target handlers that need to modify a project's classpath
-when a project is targetted to a particular runtime.</p>
-
-<p>IGenericRuntime and its working copy provide type-specific access
-to the generic runtime type. When using a generic runtime, clients can
-access the type specific information by adapting to these types using
-<pre>IGenericRuntime gr = (IGenericRuntime) runtime.getAdapter(IGenericRuntime.class)</pre>.
-GenericRuntimeUtil contains some utility methods for handling the
-generic runtime type.</p>
-
-<p>IEnterpriseApplication, IEJBModule, IWebModule, IApplicationClientModule,
-and IConnectorModule are J2EE module interfaces meant to be implemented
-by module delegates that provide J2EE module support.</p>
-
-<p>ILooseArchive and ILooseArchiveSupport are module interfaces for modules
-that take advantage of loose archive support - allowing JARs contained within
-the module to be available in a separate Java project instead of directly
-within the module.</p>
-
-<p>The remainder of the classes in this package are module artifact and
-launchable types to provide access to J2EE resource types for the server tool
-framework.</p>
-
-</body>
-</html> \ No newline at end of file

Back to the top