diff options
Diffstat (limited to 'plugins/org.eclipse.jst.server.core')
62 files changed, 0 insertions, 6339 deletions
diff --git a/plugins/org.eclipse.jst.server.core/.classpath b/plugins/org.eclipse.jst.server.core/.classpath deleted file mode 100644 index 8eae54620..000000000 --- a/plugins/org.eclipse.jst.server.core/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="sjavacore/"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/plugins/org.eclipse.jst.server.core/.cvsignore b/plugins/org.eclipse.jst.server.core/.cvsignore deleted file mode 100644 index c0cf45b07..000000000 --- a/plugins/org.eclipse.jst.server.core/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -bin -build.xml -org.eclipse.jst.server.core_3.0.0.jar -sjavacore.jar -temp.folder -@dot -src.zip -javaCompiler...args diff --git a/plugins/org.eclipse.jst.server.core/.options b/plugins/org.eclipse.jst.server.core/.options deleted file mode 100644 index c0ef0b396..000000000 --- a/plugins/org.eclipse.jst.server.core/.options +++ /dev/null @@ -1,7 +0,0 @@ -# Debugging options for the org.eclipse.jst.server.core plugin - -# Turn on general debugging -org.eclipse.jst.server.core/debug=true - -# Turn on general debugging -org.eclipse.jst.server.core/publishing=false
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/.project b/plugins/org.eclipse.jst.server.core/.project deleted file mode 100644 index 7d5e17d5b..000000000 --- a/plugins/org.eclipse.jst.server.core/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.jst.server.core</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ManifestBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.SchemaBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - <nature>org.eclipse.pde.PluginNature</nature> - </natures> -</projectDescription> diff --git a/plugins/org.eclipse.jst.server.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.server.core/META-INF/MANIFEST.MF deleted file mode 100644 index 83aef149e..000000000 --- a/plugins/org.eclipse.jst.server.core/META-INF/MANIFEST.MF +++ /dev/null @@ -1,21 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.jst.server.core; singleton:=true -Bundle-Version: 1.0.104.qualifier -Bundle-Activator: org.eclipse.jst.server.core.internal.JavaServerPlugin -Bundle-Vendor: %providerName -Bundle-Localization: plugin -Export-Package: org.eclipse.jst.server.core, - org.eclipse.jst.server.core.internal;x-friends:="org.eclipse.jst.server.ui", - org.eclipse.jst.server.core.internal.cactus;x-friends:="org.eclipse.jst.server.ui" -Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", - org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)", - org.eclipse.core.expressions;bundle-version="[3.2.0,4.0.0)", - org.eclipse.debug.core;bundle-version="[3.2.0,4.0.0)", - org.eclipse.jdt.core;bundle-version="[3.2.0,4.0.0)", - org.eclipse.jdt.launching;bundle-version="[3.2.0,4.0.0)", - org.eclipse.wst.server.core;bundle-version="[1.0.103,1.1.0)", - org.eclipse.wst.common.project.facet.core;bundle-version="[1.1.0,1.2.0)", - org.eclipse.jst.common.project.facet.core;bundle-version="[1.1.0,1.2.0)" -Eclipse-LazyStart: true diff --git a/plugins/org.eclipse.jst.server.core/about.html b/plugins/org.eclipse.jst.server.core/about.html deleted file mode 100644 index 4ec598958..000000000 --- a/plugins/org.eclipse.jst.server.core/about.html +++ /dev/null @@ -1,34 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> -<HTML> - -<head> -<title>About</title> -<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1"> -</head> - -<BODY lang="EN-US"> - -<H3>About This Content</H3> - -<P>May 2, 2006</P> - -<H3>License</H3> - -<P>The Eclipse Foundation makes available all content in this plug-in -("Content"). Unless otherwise indicated below, the Content is provided to you -under the terms and conditions of the Eclipse Public License Version 1.0 -("EPL"). A copy of the EPL is available at -<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>. -For purposes of the EPL, "Program" will mean the Content.</P> - -<P>If you did not receive this Content directly from the Eclipse Foundation, the -Content is being redistributed by another party ("Redistributor") and different -terms and conditions may apply to your use of any object code in the Content. -Check the Redistributor’s license that was provided with the Content. If no such -license exists, contact the Redistributor. Unless otherwise indicated below, the -terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at -<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P> - -</BODY> -</HTML> diff --git a/plugins/org.eclipse.jst.server.core/build.properties b/plugins/org.eclipse.jst.server.core/build.properties deleted file mode 100644 index 0ba4473b8..000000000 --- a/plugins/org.eclipse.jst.server.core/build.properties +++ /dev/null @@ -1,21 +0,0 @@ -############################################################################### -# Copyright (c) 2004 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 -############################################################################### -bin.includes = plugin.xml,\ - plugin.properties,\ - .,\ - META-INF/,\ - about.html -bin.excludes = bin/**,\ - @dot/**,\ - temp.folder/** -src.includes = schema/,\ - component.xml -source.. = sjavacore/ diff --git a/plugins/org.eclipse.jst.server.core/component.xml b/plugins/org.eclipse.jst.server.core/component.xml deleted file mode 100644 index e458e3d16..000000000 --- a/plugins/org.eclipse.jst.server.core/component.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jst.server"> -<component-depends unrestricted="true"/> - <plugin id="org.eclipse.jst.server.core" fragment="false"/> -<!-- <package name="org.eclipse.jst.server.core"> - <type name="IConnectorModule"/> - <type name="IEJBModule"/> - <type name="IJ2EEModule"/> - <type name="Servlet"/> - <type name="IWebModule"/> - <type name="IEnterpriseApplication"/> - <type name="JndiObject"/> - <type name="ClasspathRuntimeTargetHandler"/> - <type name="IApplicationClientModule"/> - <type name="EJBBean"/> - <type name="JndiLaunchable"/> - <type name="PublishUtil"/> - <type name="IJavaRuntime"/> - </package>--> - - <plugin id="org.eclipse.jst.server.ui" fragment="false"/> - - <plugin id="org.eclipse.jst.server.generic.core" fragment="false"/> - - <plugin id="org.eclipse.jst.server.generic.serverdefinitions" fragment="false"/> - - <plugin id="org.eclipse.jst.server.generic.ui" fragment="false"/> - - <plugin id="org.eclipse.jst.server.tomcat.core" fragment="false"/> - - <plugin id="org.eclipse.jst.server.tomcat.ui" fragment="false"/> - - <plugin id="org.eclipse.jst.server.websphere.core" fragment="false"/> -</component>
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/plugin.properties b/plugins/org.eclipse.jst.server.core/plugin.properties deleted file mode 100644 index 3ac857b71..000000000 --- a/plugins/org.eclipse.jst.server.core/plugin.properties +++ /dev/null @@ -1,29 +0,0 @@ -############################################################################### -# Copyright (c) 2004, 2005 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 -############################################################################### -pluginName=Java Server Support -providerName=Eclipse.org - -extensionPointRuntimeClasspathProviders=Runtime Classpath Providers -extensionPointRuntimeFacetMapping=Runtime Facet Mappings -extensionPointServerProfilers=Server Profilers - -runtimeTypeName=J2EE Runtime Library -runtimeTypeDescription=A runtime that represents a set of J2EE runtime libraries. - -moduleTypeJ2EEWebName=J2EE Web module -moduleTypeJ2EEEJBName=J2EE EJB module -moduleTypeJ2EERARName=J2EE Connector module -moduleTypeJ2EEClientName=J2EE Application Client module -moduleTypeJ2EEEARName=J2EE Enterprise application -moduleTypeJ2EEUtilityName=J2EE utility jar - -launchableJndi=JNDI Object -launchableJndiDescription=Silently start an object locatable by JNDI.
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/plugin.xml b/plugins/org.eclipse.jst.server.core/plugin.xml deleted file mode 100644 index cf237539a..000000000 --- a/plugins/org.eclipse.jst.server.core/plugin.xml +++ /dev/null @@ -1,195 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.0"?> - -<plugin> - <extension-point id="runtimeClasspathProviders" name="%extensionPointRuntimeClasspathProviders" schema="schema/runtimeClasspathProviders.exsd"/> - <extension-point id="runtimeFacetMappings" name="%extensionPointRuntimeFacetMappings" schema="schema/runtimeFacetMappings.exsd"/> - <extension-point id="serverProfilers" name="%extensionPointServerProfilers" schema="schema/serverProfilers.exsd"/> - <extension-point id="internalRuntimeComponentProviders" name="internalRuntimeComponentProviders" schema="schema/internalRuntimeComponentProviders.exsd"/> - - <extension point="org.eclipse.jdt.core.classpathContainerInitializer"> - <classpathContainerInitializer - id="org.eclipse.jst.server.core.container" - class="org.eclipse.jst.server.core.internal.RuntimeClasspathContainerInitializer"/> - </extension> - - <extension point="org.eclipse.wst.server.core.moduleTypes"> - <moduleType - id="jst.web" - name="%moduleTypeJ2EEWebName"/> - <moduleType - id="jst.ejb" - name="%moduleTypeJ2EEEJBName"/> - <moduleType - id="jst.appclient" - name="%moduleTypeJ2EEClientName"/> - <moduleType - id="jst.connector" - name="%moduleTypeJ2EERARName"/> - <moduleType - id="jst.ear" - name="%moduleTypeJ2EEEARName"/> - <moduleType - id="jst.utility" - name="%moduleTypeJ2EEUtilityName"/> - </extension> - - <extension point="org.eclipse.wst.server.core.runtimeTypes"> - <runtimeType - id="org.eclipse.jst.server.core.runtimeType" - name="%runtimeTypeName" - description="%runtimeTypeDescription" - class="org.eclipse.jst.server.core.internal.GenericRuntime"> - <moduleType - types="jst.*" - versions="*"/> - </runtimeType> - </extension> - - <extension point="org.eclipse.jst.server.core.runtimeClasspathProviders"> - <runtimeClasspathProvider - id="org.eclipse.jst.server.core.runtimeTarget" - runtimeTypeIds="org.eclipse.jst.server.core.runtimeType" - class="org.eclipse.jst.server.core.internal.GenericRuntimeClasspathProvider"/> - </extension> - - <extension point="org.eclipse.core.expressions.propertyTesters"> - <propertyTester - namespace="org.eclipse.jst.cactus.expressions" - type="org.eclipse.core.runtime.IAdaptable" - class="org.eclipse.jst.server.core.internal.cactus.ServletTestCasePropertyTester" - properties="isServletTestCase" - id="org.eclipse.jst.server.cactus.expression"/> - </extension> - - <extension point="org.eclipse.wst.server.core.moduleArtifactAdapters"> - <moduleArtifactAdapter - id="org.eclipse.jst.server.cactus.moduleArtifactAdapter" - class="org.eclipse.jst.server.core.internal.cactus.CactusModuleArtifactAdapterDelegate" - priority="10"> - <enablement> - <or> - <instanceof value="org.eclipse.jdt.core.IMethod"/> - <instanceof value="org.eclipse.jdt.core.ICompilationUnit"/> - <instanceof value="org.eclipse.jdt.core.IType"/> - <instanceof value="org.eclipse.core.resources.IFile"/> - </or> - </enablement> - </moduleArtifactAdapter> - </extension> - - <extension point="org.eclipse.wst.server.core.launchableAdapters"> - <launchableAdapter - id="org.eclipse.jst.server.cactus.launchableAdapter" - class="org.eclipse.jst.server.core.internal.cactus.CactusLaunchableAdapterDelegate"/> - </extension> - - <extension point="org.eclipse.wst.server.core.clients"> - <client - id="org.eclipse.jst.server.jndi" - name="%launchableJndi" - description="%launchableJndiDescription" - priority="-100" - launchable="org.eclipse.jst.server.core.JndiLaunchable" - class="org.eclipse.jst.server.core.internal.J2EELaunchableClient"/> - </extension> - - <extension point="org.eclipse.wst.common.project.facet.core.runtimes"> - <runtime-component-type id="standard.jre"/> - - <runtime-component-version - type="standard.jre" - version="1.3"/> - <runtime-component-version - type="standard.jre" - version="1.4"/> - <runtime-component-version - type="standard.jre" - version="5.0"/> - <runtime-component-version - type="standard.jre" - version="6.0"/> - - <adapter> - <runtime-component id="standard.jre"/> - <factory class="org.eclipse.jst.server.core.internal.StandardJreClasspathProvider$Factory"/> - <type class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/> - </adapter> - - <supported> - <facet id="jst.java" version="1.3"/> - <runtime-component id="standard.jre" version="[1.3"/> - </supported> - - <supported> - <facet id="jst.java" version="1.4"/> - <runtime-component id="standard.jre" version="[1.4"/> - </supported> - - <supported> - <facet id="jst.java" version="5.0"/> - <runtime-component id="standard.jre" version="[5.0"/> - </supported> - - <supported> - <facet id="jst.java" version="6.0"/> - <runtime-component id="standard.jre" version="[6.0"/> - </supported> - </extension> - - <extension point="org.eclipse.wst.common.project.facet.core.runtimeBridges"> - <bridge - id="org.eclipse.jst.server.core.default" - class="org.eclipse.jst.server.core.internal.RuntimeBridge"/> - </extension> - - <extension point="org.eclipse.wst.common.project.facet.core.runtimes"> - <runtime-component-type - id="org.eclipse.jst.server.core.runtimeType"/> - - <runtime-component-version - type="org.eclipse.jst.server.core.runtimeType" - version="1.0"/> - - <adapter> - <runtime-component - id="org.eclipse.jst.server.core.runtimeType"/> - <factory - class="org.eclipse.jst.server.core.internal.RuntimeClasspathProvider$Factory"/> - <type - class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/> - </adapter> - - <supported> - <runtime-component - id="org.eclipse.jst.server.core.runtimeType" - version="1.0"/> - <facet - id="jst.web" - version="2.2,2.3,2.4"/> - <facet - id="jst.ejb" - version="1.1,2.0,2.1"/> - <facet - id="jst.ear" - version="1.2,1.3,1.4"/> - <facet - id="jst.connector" - version="1.0,1.5"/> - <facet - id="jst.appclient" - version="1.2,1.3,1.4"/> - <facet - id="jst.utility" - version="1.0"/> - </supported> - </extension> - - <extension point="org.eclipse.jst.server.core.runtimeFacetMappings"> - <runtimeFacetMapping - runtimeTypeId="org.eclipse.jst.server.core.runtimeType" - runtime-component="org.eclipse.jst.server.core.runtimeType" - version="1.0"/> - </extension> - -</plugin>
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/schema/internalRuntimeComponentProviders.exsd b/plugins/org.eclipse.jst.server.core/schema/internalRuntimeComponentProviders.exsd deleted file mode 100644 index bacc5c9f1..000000000 --- a/plugins/org.eclipse.jst.server.core/schema/internalRuntimeComponentProviders.exsd +++ /dev/null @@ -1,138 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Schema file written by PDE --> -<schema targetNamespace="org.eclipse.jst.server.core"> -<annotation> - <appInfo> - <meta.schema plugin="org.eclipse.jst.server.core" id="runtimeComponentProviders" name="Runtime Component Providers"/> - </appInfo> - <documentation> - This extension point is internal and experimental and should not be used by downstream components. -This extension point is used to provide new runtime components to an existing facet runtime. - </documentation> - </annotation> - - <element name="extension"> - <complexType> - <sequence> - <element ref="runtimeComponentProvider" minOccurs="1" maxOccurs="unbounded"/> - </sequence> - <attribute name="point" type="string" use="required"> - <annotation> - <documentation> - a fully qualified identifier of the target extension point - </documentation> - </annotation> - </attribute> - <attribute name="id" type="string"> - <annotation> - <documentation> - an optional identifier of the extension instance - </documentation> - </annotation> - </attribute> - <attribute name="name" type="string"> - <annotation> - <documentation> - an optional name of the extension instance - </documentation> - </annotation> - </attribute> - </complexType> - </element> - - <element name="runtimeComponentProvider"> - <annotation> - <appInfo> - <meta.element labelAttribute="name"/> - </appInfo> - </annotation> - <complexType> - <sequence> - </sequence> - <attribute name="id" type="string" use="required"> - <annotation> - <documentation> - specifies a unique identifier for this extension point - </documentation> - </annotation> - </attribute> - <attribute name="runtimeTypeIds" type="string" use="required"> - <annotation> - <documentation> - a comma separated list of runtime type ids that this provider may support. Used for memory & performance reasons - </documentation> - </annotation> - </attribute> - <attribute name="class" type="string" use="required"> - <annotation> - <documentation> - specifies the fully qualified name of the Java class that extends <samp>RuntimeClasspathProviderDelegate</samp>. -Runtime classpath provider instances of this type will delegate to instances of this class. - </documentation> - <appInfo> - <meta.attribute kind="java" basedOn="org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate"/> - </appInfo> - </annotation> - </attribute> - </complexType> - </element> - - <annotation> - <appInfo> - <meta.section type="since"/> - </appInfo> - <documentation> - 1.5.1 - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="examples"/> - </appInfo> - <documentation> - The following is an example of a runtime component provider extension point: - -<pre> - <extension point="org.eclipse.jst.server.core.runtimeComponentProviders"> - <runtimeComponentProvider - id="com.example.runtimeComponentProvider" - runtimeTypeIds="com.example.runtime, com.example2.*" - class="com.example.ExampleRuntimeComponentProvider"/> - </extension> -</pre> - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="apiInfo"/> - </appInfo> - <documentation> - Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends <b>org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate</b> and contains a public 0-arg constructor. - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="implementation"/> - </appInfo> - <documentation> - - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="copyright"/> - </appInfo> - <documentation> - Copyright (c) 2006 IBM Corporation and others.<br> -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 -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - </documentation> - </annotation> - -</schema> diff --git a/plugins/org.eclipse.jst.server.core/schema/runtimeClasspathProviders.exsd b/plugins/org.eclipse.jst.server.core/schema/runtimeClasspathProviders.exsd deleted file mode 100644 index 33ae4d421..000000000 --- a/plugins/org.eclipse.jst.server.core/schema/runtimeClasspathProviders.exsd +++ /dev/null @@ -1,137 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Schema file written by PDE --> -<schema targetNamespace="org.eclipse.jst.server.core"> -<annotation> - <appInfo> - <meta.schema plugin="org.eclipse.jst.server.core" id="runtimeClasspathProviders" name="Runtime Classpath Providers"/> - </appInfo> - <documentation> - This extension point is used to provide a new runtime classpath provider. Runtime classpath providers provide the classpath for Java server runtimes. - </documentation> - </annotation> - - <element name="extension"> - <complexType> - <sequence> - <element ref="runtimeClasspathProvider" minOccurs="0" maxOccurs="unbounded"/> - </sequence> - <attribute name="point" type="string" use="required"> - <annotation> - <documentation> - a fully qualified identifier of the target extension point - </documentation> - </annotation> - </attribute> - <attribute name="id" type="string"> - <annotation> - <documentation> - an optional identifier of the extension instance - </documentation> - </annotation> - </attribute> - <attribute name="name" type="string"> - <annotation> - <documentation> - an optional name of the extension instance - </documentation> - </annotation> - </attribute> - </complexType> - </element> - - <element name="runtimeClasspathProvider"> - <annotation> - <appInfo> - <meta.element labelAttribute="name"/> - </appInfo> - </annotation> - <complexType> - <sequence> - </sequence> - <attribute name="id" type="string" use="required"> - <annotation> - <documentation> - specifies a unique identifier for this extension point - </documentation> - </annotation> - </attribute> - <attribute name="runtimeTypeIds" type="string" use="required"> - <annotation> - <documentation> - a comma separated list of runtime type ids that this provider may support. Used for memory & performance reasons - </documentation> - </annotation> - </attribute> - <attribute name="class" type="string" use="required"> - <annotation> - <documentation> - specifies the fully qualified name of the Java class that extends <samp>RuntimeClasspathProviderDelegate</samp>. -Runtime classpath provider instances of this type will delegate to instances of this class. - </documentation> - <appInfo> - <meta.attribute kind="java" basedOn="org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate"/> - </appInfo> - </annotation> - </attribute> - </complexType> - </element> - - <annotation> - <appInfo> - <meta.section type="since"/> - </appInfo> - <documentation> - 1.0 - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="examples"/> - </appInfo> - <documentation> - The following is an example of a runtime classpath provider extension point: - -<pre> - <extension point="org.eclipse.jst.server.core.runtimeClasspathProviders"> - <runtimeClasspathProvider - id="com.example.runtimeClasspathProvider" - runtimeTypeIds="com.example.runtime, com.example2.*" - class="com.example.ExampleRuntimeClasspathProvider"/> - </extension> -</pre> - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="apiInfo"/> - </appInfo> - <documentation> - Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends <b>org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate</b> and contains a public 0-arg constructor. - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="implementation"/> - </appInfo> - <documentation> - - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="copyright"/> - </appInfo> - <documentation> - Copyright (c) 2000, 2005 IBM Corporation and others.<br> -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 -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - </documentation> - </annotation> - -</schema> diff --git a/plugins/org.eclipse.jst.server.core/schema/runtimeFacetMappings.exsd b/plugins/org.eclipse.jst.server.core/schema/runtimeFacetMappings.exsd deleted file mode 100644 index 0367663af..000000000 --- a/plugins/org.eclipse.jst.server.core/schema/runtimeFacetMappings.exsd +++ /dev/null @@ -1,141 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Schema file written by PDE --> -<schema targetNamespace="org.eclipse.jst.server.core"> -<annotation> - <appInfo> - <meta.schema plugin="org.eclipse.jst.server.core" id="runtimeFacetMappings" name="Runtime Facet Mappings"/> - </appInfo> - <documentation> - This extension point is used to map between a facet runtime component and a server runtime type. - </documentation> - </annotation> - - <element name="extension"> - <complexType> - <sequence> - <element ref="runtimeFacetMapping" minOccurs="0" maxOccurs="unbounded"/> - </sequence> - <attribute name="point" type="string" use="required"> - <annotation> - <documentation> - a fully qualified identifier of the target extension point - </documentation> - </annotation> - </attribute> - <attribute name="id" type="string"> - <annotation> - <documentation> - an optional identifier of the extension instance - </documentation> - </annotation> - </attribute> - <attribute name="name" type="string"> - <annotation> - <documentation> - an optional name of the extension instance - </documentation> - </annotation> - </attribute> - </complexType> - </element> - - <element name="runtimeFacetMapping"> - <annotation> - <appInfo> - <meta.element labelAttribute="name"/> - </appInfo> - </annotation> - <complexType> - <sequence> - </sequence> - <attribute name="id" type="string"> - <annotation> - <documentation> - specifies a unique identifier for this extension point - </documentation> - </annotation> - </attribute> - <attribute name="runtimeTypeId" type="string" use="required"> - <annotation> - <documentation> - a runtime type id - </documentation> - </annotation> - </attribute> - <attribute name="runtime-component" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="version" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - </complexType> - </element> - - <annotation> - <appInfo> - <meta.section type="since"/> - </appInfo> - <documentation> - 1.0 - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="examples"/> - </appInfo> - <documentation> - The following is an example of a runtime facet mapping extension point: - -<pre> - <extension point="org.eclipse.jst.server.core.runtimeFacetMappings"> - <runtimeFacetMapping - id="com.example.runtimeClasspathProvider" - runtimeTypeId="com.example.runtime.32" - runtime-component="com.example.ExampleRuntimeClasspathProvider" - version="3.2"/> - </extension> -</pre> - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="apiInfo"/> - </appInfo> - <documentation> - - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="implementation"/> - </appInfo> - <documentation> - - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="copyright"/> - </appInfo> - <documentation> - Copyright (c) 2000, 2005 IBM Corporation and others.<br> -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 -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - </documentation> - </annotation> - -</schema> diff --git a/plugins/org.eclipse.jst.server.core/schema/serverProfilers.exsd b/plugins/org.eclipse.jst.server.core/schema/serverProfilers.exsd deleted file mode 100644 index 3189d7bee..000000000 --- a/plugins/org.eclipse.jst.server.core/schema/serverProfilers.exsd +++ /dev/null @@ -1,133 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Schema file written by PDE --> -<schema targetNamespace="org.eclipse.jst.server.core"> -<annotation> - <appInfo> - <meta.schema plugin="org.eclipse.jst.server.core" id="serverProfilers" name="Server Profiler"/> - </appInfo> - <documentation> - This extension point is used to provide support for profiling servers. - </documentation> - </annotation> - - <element name="extension"> - <complexType> - <sequence> - <element ref="serverProfiler" minOccurs="0" maxOccurs="unbounded"/> - </sequence> - <attribute name="point" type="string" use="required"> - <annotation> - <documentation> - a fully qualified identifier of the target extension point - </documentation> - </annotation> - </attribute> - <attribute name="id" type="string"> - <annotation> - <documentation> - an optional identifier of the extension instance - </documentation> - </annotation> - </attribute> - <attribute name="name" type="string"> - <annotation> - <documentation> - an optional name of the extension instance - </documentation> - </annotation> - </attribute> - </complexType> - </element> - - <element name="serverProfiler"> - <annotation> - <appInfo> - <meta.element labelAttribute="name"/> - </appInfo> - </annotation> - <complexType> - <sequence> - </sequence> - <attribute name="id" type="string"> - <annotation> - <documentation> - specifies a unique identifier for this extension point - </documentation> - </annotation> - </attribute> - <attribute name="name" type="string" use="required"> - <annotation> - <documentation> - a translated name - </documentation> - </annotation> - </attribute> - <attribute name="vmArgs" type="string" use="required"> - <annotation> - <documentation> - a VM argument used to launch the profiler - </documentation> - </annotation> - </attribute> - </complexType> - </element> - - <annotation> - <appInfo> - <meta.section type="since"/> - </appInfo> - <documentation> - 1.5 - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="examples"/> - </appInfo> - <documentation> - The following is an example of a server profiler extension point: - -<pre> - <extension point="org.eclipse.jst.server.core.serverProfilers"> - <serverProfiler - id="com.example.myProfiler" - name="My Profiler" - vmArgs="-XpiAgent"/> - </extension> -</pre> - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="apiInfo"/> - </appInfo> - <documentation> - - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="implementation"/> - </appInfo> - <documentation> - - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="copyright"/> - </appInfo> - <documentation> - Copyright (c) 2006 IBM Corporation and others.<br> -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 -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - </documentation> - </annotation> - -</schema> diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/ClasspathRuntimeTargetHandler.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/ClasspathRuntimeTargetHandler.java deleted file mode 100644 index 11a4da216..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/ClasspathRuntimeTargetHandler.java +++ /dev/null @@ -1,134 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/EJBBean.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/EJBBean.java deleted file mode 100644 index f9b14060f..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/EJBBean.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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; -import org.eclipse.wst.server.core.IModuleArtifact; -/** - * 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> - * @plannedfor 2.0 - */ -public class EJBBean implements IModuleArtifact { - private IModule module; - private String jndiName; - private boolean local; - private boolean remote; - - /** - * 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) { - this.module = module; - this.jndiName = jndiName; - this.remote = remote; - this.local = local; - } - - /** - * @see IModuleArtifact#getModule() - */ - public IModule getModule() { - return module; - } - - /** - * 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; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/FacetUtil.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/FacetUtil.java deleted file mode 100644 index 5e21fe8f2..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/FacetUtil.java +++ /dev/null @@ -1,123 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 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.Iterator; -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jst.server.core.internal.JavaServerPlugin; -import org.eclipse.jst.server.core.internal.Messages; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.common.project.facet.core.IFacetedProject; -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.RuntimeManager; -import org.eclipse.wst.server.core.IRuntime; -import org.eclipse.wst.server.core.IServer; -import org.eclipse.wst.server.core.ServerCore; -/** - * Utility class for converting between facet runtimes and server runtimes. - * <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 class FacetUtil { - /** - * 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) { - if (runtime == null) - throw new IllegalArgumentException(); - - String id = runtime.getProperty("id"); - - IRuntime[] runtimes = ServerCore.getRuntimes(); - int size = runtimes.length; - for (int i = 0; i < size; i++) { - if (id.equals(runtimes[i].getId())) - return runtimes[i]; - } - - return null; - } - - /** - * 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) { - if (runtime == null) - throw new IllegalArgumentException(); - - String id = runtime.getId(); - - Set runtimes = RuntimeManager.getRuntimes(); - Iterator iterator = runtimes.iterator(); - while (iterator.hasNext()) { - org.eclipse.wst.common.project.facet.core.runtime.IRuntime runtime2 = (org.eclipse.wst.common.project.facet.core.runtime.IRuntime) iterator.next(); - if (id.equals(runtime2.getProperty("id"))) - return runtime2; - } - return null; - } - - /** - * 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) { - if (server == null) - return new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, Messages.errorNoRuntime, null); - IRuntime runtime = server.getRuntime(); - if (runtime == null) - return new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, Messages.errorNoRuntime, null); - - org.eclipse.wst.common.project.facet.core.runtime.IRuntime runtime2 = getRuntime(runtime); - - if (runtime2 == null) // bug 150194 - what do we do if the facet runtime doesn't exist yet - return Status.OK_STATUS; - - try { - IFacetedProject facetedProject = ProjectFacetsManager.create(project); - Iterator iterator = facetedProject.getProjectFacets().iterator(); - while (iterator.hasNext()) { - IProjectFacetVersion facet = (IProjectFacetVersion) iterator.next(); - if (!runtime2.supports(facet)) - return new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorFacet, facet.getProjectFacet().getLabel(), facet.getVersionString()), null); - } - } catch (CoreException ce) { - return ce.getStatus(); - } - return Status.OK_STATUS; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IApplicationClientModule.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IApplicationClientModule.java deleted file mode 100644 index 1f41d3406..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IApplicationClientModule.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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 2.0 - */ -public interface IApplicationClientModule extends IJ2EEModule { - // intentionally empty -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IConnectorModule.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IConnectorModule.java deleted file mode 100644 index a459c74d7..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IConnectorModule.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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 2.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/sjavacore/org/eclipse/jst/server/core/IEJBModule.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IEJBModule.java deleted file mode 100644 index 9596a0413..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IEJBModule.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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 2.0 - */ -public interface IEJBModule extends IJ2EEModule { - // intentionally empty -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IEnterpriseApplication.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IEnterpriseApplication.java deleted file mode 100644 index 6b9797b37..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IEnterpriseApplication.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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 2.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/sjavacore/org/eclipse/jst/server/core/IJ2EEModule.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IJ2EEModule.java deleted file mode 100644 index c3fc24e87..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IJ2EEModule.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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 2.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/sjavacore/org/eclipse/jst/server/core/IJavaRuntime.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IJavaRuntime.java deleted file mode 100644 index dd7067fcd..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IJavaRuntime.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 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 2.0 - */ -public interface IJavaRuntime { - /** - * Return the VM install (installed JRE) that this runtime is using. - * - * @return the current VM install - */ - public IVMInstall getVMInstall(); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IUtilityModule.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IUtilityModule.java deleted file mode 100644 index 96e4f001e..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IUtilityModule.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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 2.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/sjavacore/org/eclipse/jst/server/core/IWebModule.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IWebModule.java deleted file mode 100644 index 92dffcfb7..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/IWebModule.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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 2.0 - */ -public interface IWebModule extends IJ2EEModule { - /** - * Returns the context root of the module. - * - * @return java.lang.String - */ - public String getContextRoot(); - - /** - * 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/sjavacore/org/eclipse/jst/server/core/JndiLaunchable.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/JndiLaunchable.java deleted file mode 100644 index abc0d8f77..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/JndiLaunchable.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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 2.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/sjavacore/org/eclipse/jst/server/core/JndiObject.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/JndiObject.java deleted file mode 100644 index b7a375147..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/JndiObject.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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; -import org.eclipse.wst.server.core.IModuleArtifact; -/** - * 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 2.0 - */ -public class JndiObject implements IModuleArtifact { - private IModule module; - 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) { - this.module = module; - this.jndiName = jndiName; - } - - /** - * @see IModuleArtifact#getModule() - */ - public IModule getModule() { - return module; - } - - /** - * Return 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/sjavacore/org/eclipse/jst/server/core/PublishUtil.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/PublishUtil.java deleted file mode 100644 index c11087f62..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/PublishUtil.java +++ /dev/null @@ -1,823 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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 java.util.ArrayList; -import java.util.List; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -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.ProgressUtil; -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.IModuleFolder; -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> - * <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> - * @plannedfor 2.0 - */ -public class PublishUtil { - // size of the buffer - private static final int BUFFER = 65536; - - // the buffer - private static byte[] buf = new byte[BUFFER]; - - private static final IStatus[] EMPTY_STATUS = new IStatus[0]; - - private static final File tempDir = JavaServerPlugin.getInstance().getStateLocation().toFile(); - - private static final String TEMPFILE_PREFIX = "tmp"; - - /** - * FileUtil cannot be created. Use static methods. - */ - private PublishUtil() { - super(); - } - - /** - * 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]); - } - - /** - * Copy a file from a to b. Closes the input stream after use. - * - * @param in an input stream - * @param to a path to copy to. the directory must already exist - * @param ts timestamp - * @throws CoreException if anything goes wrong - */ - private static void copyFile(InputStream in, IPath to, long ts, IModuleFile mf) throws CoreException { - OutputStream out = null; - - File tempFile = null; - try { - File file = to.toFile(); - tempFile = File.createTempFile(TEMPFILE_PREFIX, "." + to.getFileExtension(), tempDir); - - out = new FileOutputStream(tempFile); - - int avail = in.read(buf); - while (avail > 0) { - out.write(buf, 0, avail); - avail = in.read(buf); - } - - out.close(); - out = null; - - moveTempFile(tempFile, file); - - if (ts != IResource.NULL_STAMP && ts != 0) - file.setLastModified(ts); - } catch (CoreException e) { - throw e; - } catch (Exception e) { - IPath path = mf.getModuleRelativePath().append(mf.getName()); - Trace.trace(Trace.SEVERE, "Error copying file: " + to.toOSString() + " to " + path.toOSString(), e); - throw new CoreException(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorCopyingFile, path.toOSString(), e.getLocalizedMessage()), null)); - } finally { - if (tempFile != null && tempFile.exists()) - tempFile.deleteOnExit(); - try { - if (in != null) - in.close(); - } catch (Exception ex) { - // ignore - } - try { - if (out != null) - out.close(); - } catch (Exception ex) { - // ignore - } - } - } - - /** - * 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) { - if (!dir.exists() || !dir.isDirectory()) - return new IStatus[] { new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorNotADirectory, dir.getAbsolutePath()), null) }; - - List status = new ArrayList(2); - - try { - File[] files = dir.listFiles(); - int size = files.length; - monitor = ProgressUtil.getMonitorFor(monitor); - monitor.beginTask(NLS.bind(Messages.deletingTask, new String[] { dir.getAbsolutePath() }), size * 10); - - // cycle through files - boolean deleteCurrent = true; - for (int i = 0; i < size; i++) { - File current = files[i]; - if (current.isFile()) { - if (!current.delete()) { - status.add(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorDeleting, files[i].getAbsolutePath()), null)); - deleteCurrent = false; - } - monitor.worked(10); - } else if (current.isDirectory()) { - monitor.subTask(NLS.bind(Messages.deletingTask, new String[] {current.getAbsolutePath()})); - IStatus[] stat = deleteDirectory(current, ProgressUtil.getSubMonitorFor(monitor, 10)); - if (stat != null && stat.length > 0) { - deleteCurrent = false; - addArrayToList(status, stat); - } - } - } - if (deleteCurrent && !dir.delete()) - status.add(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorDeleting, dir.getAbsolutePath()), null)); - monitor.done(); - } catch (Exception e) { - Trace.trace(Trace.SEVERE, "Error deleting directory " + dir.getAbsolutePath(), e); - status.add(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, e.getLocalizedMessage(), null)); - } - - IStatus[] stat = new IStatus[status.size()]; - status.toArray(stat); - return stat; - } - - /** - * 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) { - if (resources == null) - return EMPTY_STATUS; - - monitor = ProgressUtil.getMonitorFor(monitor); - - List status = new ArrayList(2); - File toDir = path.toFile(); - int fromSize = resources.length; - String[] fromFileNames = new String[fromSize]; - for (int i = 0; i < fromSize; i++) - fromFileNames[i] = resources[i].getName(); - - // cache files and file names for performance - File[] toFiles = null; - String[] toFileNames = null; - - boolean foundExistingDir = false; - if (toDir.exists()) { - if (toDir.isDirectory()) { - foundExistingDir = true; - toFiles = toDir.listFiles(); - int toSize = toFiles.length; - toFileNames = new String[toSize]; - - // check if this exact file exists in the new directory - for (int i = 0; i < toSize; i++) { - toFileNames[i] = toFiles[i].getName(); - boolean isDir = toFiles[i].isDirectory(); - boolean found = false; - for (int j = 0; j < fromSize; j++) { - if (toFileNames[i].equals(fromFileNames[j]) && isDir == resources[j] instanceof IModuleFolder) - found = true; - } - - // delete file if it can't be found or isn't the correct type - if (!found) { - if (isDir) { - IStatus[] stat = deleteDirectory(toFiles[i], null); - addArrayToList(status, stat); - } else { - if (!toFiles[i].delete()) - status.add(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorDeleting, toFiles[i].getAbsolutePath()), null)); - } - toFiles[i] = null; - toFileNames[i] = null; - } - } - } else { //if (toDir.isFile()) - if (!toDir.delete()) { - status.add(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorDeleting, toDir.getAbsolutePath()), null)); - IStatus[] stat = new IStatus[status.size()]; - status.toArray(stat); - return stat; - } - } - } - if (!foundExistingDir && !toDir.mkdir()) { - status.add(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorMkdir, toDir.getAbsolutePath()), null)); - IStatus[] stat = new IStatus[status.size()]; - status.toArray(stat); - return stat; - } - - if (monitor.isCanceled()) - return new IStatus[] { Status.CANCEL_STATUS }; - - monitor.worked(50); - - // cycle through files and only copy when it doesn't exist - // or is newer - if (toFiles == null) - toFiles = toDir.listFiles(); - int toSize = 0; - if (toFiles != null) - toSize = toFiles.length; - - int dw = 0; - if (toSize > 0) - dw = 500 / toSize; - - // cache file names and last modified dates for performance - if (toFileNames == null) - toFileNames = new String[toSize]; - long[] toFileMod = new long[toSize]; - for (int i = 0; i < toSize; i++) { - if (toFiles[i] != null) { - if (toFileNames[i] != null) - toFileNames[i] = toFiles[i].getName(); - toFileMod[i] = toFiles[i].lastModified(); - } - } - - for (int i = 0; i < fromSize; i++) { - IModuleResource current = resources[i]; - String name = fromFileNames[i]; - boolean currentIsDir = current instanceof IModuleFolder; - - if (!currentIsDir) { - // check if this is a new or newer file - boolean copy = true; - IModuleFile mf = (IModuleFile) current; - - long mod = -1; - IFile file = (IFile) mf.getAdapter(IFile.class); - if (file != null) { - mod = file.getLocalTimeStamp(); - } else { - File file2 = (File) mf.getAdapter(File.class); - mod = file2.lastModified(); - } - - for (int j = 0; j < toSize; j++) { - if (name.equals(toFileNames[j]) && mod == toFileMod[j]) - copy = false; - } - - if (copy) { - try { - copyFile(mf, path.append(name)); - } catch (CoreException ce) { - status.add(ce.getStatus()); - } - } - monitor.worked(dw); - } else { //if (currentIsDir) { - IModuleFolder folder = (IModuleFolder) current; - IModuleResource[] children = folder.members(); - monitor.subTask(NLS.bind(Messages.copyingTask, new String[] {name, name})); - IStatus[] stat = publishSmart(children, path.append(name), ProgressUtil.getSubMonitorFor(monitor, dw)); - addArrayToList(status, stat); - } - } - if (monitor.isCanceled()) - return new IStatus[] { Status.CANCEL_STATUS }; - - monitor.worked(500 - dw * toSize); - monitor.done(); - - IStatus[] stat = new IStatus[status.size()]; - status.toArray(stat); - return stat; - } - - /** - * 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) { - if (delta == null) - return EMPTY_STATUS; - - monitor = ProgressUtil.getMonitorFor(monitor); - - List status = new ArrayList(2); - int size2 = delta.length; - for (int i = 0; i < size2; i++) { - IStatus[] stat = publishDelta(delta[i], path, monitor); - addArrayToList(status, stat); - } - - IStatus[] stat = new IStatus[status.size()]; - status.toArray(stat); - return stat; - } - - /** - * 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) { - List status = new ArrayList(2); - - IModuleResource resource = delta.getModuleResource(); - int kind2 = delta.getKind(); - - if (resource instanceof IModuleFile) { - IModuleFile file = (IModuleFile) resource; - try { - if (kind2 == IModuleResourceDelta.REMOVED) - deleteFile2(path, file); - else { - IPath path2 = path.append(file.getModuleRelativePath()).append(file.getName()); - File f = path2.toFile().getParentFile(); - if (!f.exists()) - f.mkdirs(); - - copyFile(file, path2); - } - } catch (CoreException ce) { - status.add(ce.getStatus()); - } - IStatus[] stat = new IStatus[status.size()]; - status.toArray(stat); - return stat; - } - - if (kind2 == IModuleResourceDelta.ADDED) { - IPath path2 = path.append(resource.getModuleRelativePath()).append(resource.getName()); - File file = path2.toFile(); - if (!file.exists() && !file.mkdirs()) { - status.add(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorMkdir, path2), null)); - IStatus[] stat = new IStatus[status.size()]; - status.toArray(stat); - return stat; - } - } - - IModuleResourceDelta[] childDeltas = delta.getAffectedChildren(); - int size = childDeltas.length; - for (int i = 0; i < size; i++) { - IStatus[] stat = publishDelta(childDeltas[i], path, monitor); - addArrayToList(status, stat); - } - - if (kind2 == IModuleResourceDelta.REMOVED) { - IPath path2 = path.append(resource.getModuleRelativePath()).append(resource.getName()); - File file = path2.toFile(); - if (file.exists() && !file.delete()) { - status.add(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorDeleting, path2), null)); - } - } - - IStatus[] stat = new IStatus[status.size()]; - status.toArray(stat); - return stat; - } - - private static void deleteFile2(IPath path, IModuleFile file) throws CoreException { - Trace.trace(Trace.PUBLISHING, "Deleting: " + file.getName() + " from " + path.toString()); - IPath path2 = path.append(file.getModuleRelativePath()).append(file.getName()); - if (path2.toFile().exists() && !path2.toFile().delete()) - throw new CoreException(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorDeleting, path2), null)); - } - - private static void copyFile(IModuleFile mf, IPath path) throws CoreException { - Trace.trace(Trace.PUBLISHING, "Copying: " + mf.getName() + " to " + path.toString()); - - IFile file = (IFile) mf.getAdapter(IFile.class); - if (file != null) - copyFile(file.getContents(), path, file.getLocalTimeStamp(), mf); - else { - File file2 = (File) mf.getAdapter(File.class); - InputStream in = null; - try { - in = new FileInputStream(file2); - } catch (IOException e) { - throw new CoreException(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorReading, file2.getAbsolutePath()), e)); - } - copyFile(in, path, file2.lastModified(), mf); - } - } - - /** - * 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) { - if (resources == null) - return EMPTY_STATUS; - - monitor = ProgressUtil.getMonitorFor(monitor); - - List status = new ArrayList(2); - int size = resources.length; - for (int i = 0; i < size; i++) { - IStatus[] stat = copy(resources[i], path, monitor); - addArrayToList(status, stat); - } - - IStatus[] stat = new IStatus[status.size()]; - status.toArray(stat); - return stat; - } - - private static IStatus[] copy(IModuleResource resource, IPath path, IProgressMonitor monitor) { - String name = resource.getName(); - Trace.trace(Trace.PUBLISHING, "Copying: " + name + " to " + path.toString()); - List status = new ArrayList(2); - if (resource instanceof IModuleFolder) { - IModuleFolder folder = (IModuleFolder) resource; - IStatus[] stat = publishFull(folder.members(), path, monitor); - addArrayToList(status, stat); - } else { - IModuleFile mf = (IModuleFile) resource; - path = path.append(mf.getModuleRelativePath()).append(name); - File f = path.toFile().getParentFile(); - if (!f.exists()) - f.mkdirs(); - try { - copyFile(mf, path); - } catch (CoreException ce) { - status.add(ce.getStatus()); - } - } - IStatus[] stat = new IStatus[status.size()]; - status.toArray(stat); - return stat; - } - - /** - * 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) { - if (resources == null || resources.length == 0) { - // should also check if resources consists of all empty directories - File file = path.toFile(); - if (file.exists()) - file.delete(); - return EMPTY_STATUS; - } - - monitor = ProgressUtil.getMonitorFor(monitor); - - File tempFile = null; - try { - File file = path.toFile(); - tempFile = File.createTempFile(TEMPFILE_PREFIX, "." + path.getFileExtension(), tempDir); - - BufferedOutputStream bout = new BufferedOutputStream(new FileOutputStream(tempFile)); - ZipOutputStream zout = new ZipOutputStream(bout); - addZipEntries(zout, resources); - zout.close(); - - moveTempFile(tempFile, file); - } catch (CoreException e) { - return new IStatus[] { e.getStatus() }; - } catch (Exception e) { - Trace.trace(Trace.SEVERE, "Error zipping", e); - return new Status[] { new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorCreatingZipFile, path.lastSegment(), e.getLocalizedMessage()), e) }; - } finally { - if (tempFile != null && tempFile.exists()) - tempFile.deleteOnExit(); - } - return EMPTY_STATUS; - } - - private static void addZipEntries(ZipOutputStream zout, IModuleResource[] resources) throws Exception { - if (resources == null) - return; - - int size = resources.length; - for (int i = 0; i < size; i++) { - if (resources[i] instanceof IModuleFolder) { - IModuleFolder mf = (IModuleFolder) resources[i]; - IModuleResource[] res = mf.members(); - - IPath path = mf.getModuleRelativePath().append(mf.getName()); - String entryPath = path.toPortableString(); - if (!entryPath.endsWith("/")) - entryPath += '/'; - - ZipEntry ze = new ZipEntry(entryPath); - - long ts = 0; - IContainer folder = (IContainer) mf.getAdapter(IContainer.class); - if (folder != null) - ts = folder.getLocalTimeStamp(); - - if (ts != IResource.NULL_STAMP && ts != 0) - ze.setTime(ts); - - zout.putNextEntry(ze); - zout.closeEntry(); - - addZipEntries(zout, res); - continue; - } - - IModuleFile mf = (IModuleFile) resources[i]; - IPath path = mf.getModuleRelativePath().append(mf.getName()); - - ZipEntry ze = new ZipEntry(path.toPortableString()); - - InputStream in = null; - long ts = 0; - IFile file = (IFile) mf.getAdapter(IFile.class); - if (file != null) { - ts = file.getLocalTimeStamp(); - in = file.getContents(); - } else { - File file2 = (File) mf.getAdapter(File.class); - ts = file2.lastModified(); - in = new FileInputStream(file2); - } - - if (ts != IResource.NULL_STAMP && ts != 0) - ze.setTime(ts); - - zout.putNextEntry(ze); - - try { - int n = 0; - while (n > -1) { - n = in.read(buf); - if (n > 0) - zout.write(buf, 0, n); - } - } finally { - in.close(); - } - - zout.closeEntry(); - } - } - - /** - * Utility method to move a temp file into position by deleting the original and - * swapping in a new copy. - * - * @param tempFile - * @param file - * @throws CoreException - */ - private static void moveTempFile(File tempFile, File file) throws CoreException { - if (file.exists()) { - if (!safeDelete(file, 2)) { - // attempt to rewrite an existing file with the tempFile contents if - // the existing file can't be deleted to permit the move - try { - InputStream in = new FileInputStream(tempFile); - IStatus status = copyFile(in, file.getPath()); - if (!status.isOK()) { - MultiStatus status2 = new MultiStatus(JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorDeleting, file.toString()), null); - status2.add(status); - throw new CoreException(status2); - } - return; - } catch (FileNotFoundException e) { - // shouldn't occur - } finally { - tempFile.delete(); - } - /*if (!safeDelete(file, 8)) { - tempFile.delete(); - throw new CoreException(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorDeleting, file.toString()), null)); - }*/ - } - } - if (!safeRename(tempFile, file, 10)) - throw new CoreException(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorRename, tempFile.toString()), null)); - } - - /** - * Safe delete. Tries to delete multiple times before giving up. - * - * @param f - * @return <code>true</code> if it succeeds, <code>false</code> otherwise - */ - private static boolean safeDelete(File f, int retrys) { - int count = 0; - while (count < retrys) { - if (!f.exists()) - return true; - - f.delete(); - - if (!f.exists()) - return true; - - count++; - // delay if we are going to try again - if (count < retrys) { - try { - Thread.sleep(100); - } catch (Exception e) { - // ignore - } - } - } - return false; - } - - /** - * Safe rename. Will try multiple times before giving up. - * - * @param from - * @param to - * @param retrys number of times to retry - * @return <code>true</code> if it succeeds, <code>false</code> otherwise - */ - private static boolean safeRename(File from, File to, int retrys) { - // make sure parent dir exists - File dir = to.getParentFile(); - if (dir != null && !dir.exists()) - dir.mkdirs(); - - int count = 0; - while (count < retrys) { - if (from.renameTo(to)) - return true; - - count++; - // delay if we are going to try again - if (count < retrys) { - try { - Thread.sleep(100); - } catch (Exception e) { - // ignore - } - } - } - return false; - } - - private static void addArrayToList(List list, IStatus[] a) { - if (list == null || a == null || a.length == 0) - return; - - int size = a.length; - for (int i = 0; i < size; i++) - list.add(a[i]); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java deleted file mode 100644 index 474db92e3..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java +++ /dev/null @@ -1,332 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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.Path; -import org.eclipse.jdt.core.IAccessRule; -import org.eclipse.jdt.core.IClasspathAttribute; -import org.eclipse.jdt.core.IClasspathEntry; -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.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 2.0 - */ -public abstract class RuntimeClasspathProviderDelegate { - protected class SourceAttachmentUpdate { - String runtimeId; - IPath entry; - IPath sourceAttachmentPath; - IPath sourceAttachmentRootPath; - IClasspathAttribute[] attributes; - } - - private List sourceAttachments; - - private String extensionId; - - private Map runtimePathMap = new HashMap(); - - 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 = (SourceAttachmentUpdate) 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); - } - } - } - - 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 = (IPath) runtimePathMap.get(runtime.getId()); - return (path != null && !path.equals(runtime.getLocation())); - } catch (Exception e) { - // ignore - } - return false; - } - - private static void addJarFiles(File dir, List list, boolean includeSubdirectories) { - int depth = 0; - if (includeSubdirectories) - depth = 2; - addJarFiles(dir, list, depth); - } - - private static void addJarFiles(File dir, List list, int depth) { - if (dir == null) - throw new IllegalArgumentException(); - - File[] files = dir.listFiles(); - if (files != null) { - int size = files.length; - for (int i = 0; i < size; i++) { - if (files[i].isDirectory() && depth > 0) { - addJarFiles(files[i], list, depth - 1); - } else if (files[i].getAbsolutePath().endsWith(".jar") || files[i].getAbsolutePath().endsWith(".zip")) { - IPath path = new Path(files[i].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 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(); - - int size = entries.length; - for (int i = 0; i < size; i++) { - if (entries[i].getSourceAttachmentPath() != null || entries[i].getExtraAttributes() != null) { - SourceAttachmentUpdate sau = new SourceAttachmentUpdate(); - sau.runtimeId = runtime.getId(); - sau.entry = entries[i].getPath(); - sau.sourceAttachmentPath = entries[i].getSourceAttachmentPath(); - sau.sourceAttachmentRootPath = entries[i].getSourceAttachmentRootPath(); - sau.attributes = entries[i].getExtraAttributes(); - sourceAttachments.add(sau); - } - } - save(); - } - - /** - * Load source attachment info. - */ - private void load() { - sourceAttachments = new ArrayList(); - - String id = extensionId; - String filename = JavaServerPlugin.getInstance().getStateLocation().append(id + ".xml").toOSString(); - - try { - IMemento memento = XMLMemento.loadMemento(filename); - - IMemento[] children = memento.getChildren("source-attachment"); - int size = children.length; - - for (int i = 0; i < size; i++) { - try { - SourceAttachmentUpdate sau = new SourceAttachmentUpdate(); - sau.runtimeId = children[i].getString("runtime-id"); - String temp = children[i].getString("entry"); - if (temp != null) - sau.entry = new Path(temp); - temp = children[i].getString("source-attachment-path"); - if (temp != null) - sau.sourceAttachmentPath = new Path(temp); - temp = children[i].getString("source-attachment-root-path"); - if (temp != null) - sau.sourceAttachmentRootPath = new Path(temp); - IMemento[] attrChildren = children[i].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 monitor: " + e); - } - } - } catch (Exception e) { - Trace.trace(Trace.WARNING, "Could not load source path info: " + e.getMessage()); - } - } - - /** - * 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) { - int size = sau.attributes.length; - for (int i = 0; i < size; i++) { - IClasspathAttribute attr = sau.attributes[i]; - 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/sjavacore/org/eclipse/jst/server/core/Servlet.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/Servlet.java deleted file mode 100644 index f2a78cd5f..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/Servlet.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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; -import org.eclipse.wst.server.core.IModuleArtifact; -/** - * 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 2.0 - */ -public class Servlet implements IModuleArtifact { - private IModule module; - 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) { - this.module = module; - this.className = className; - this.alias = alias; - } - - /** - * @see IModuleArtifact#getModule() - */ - public IModule getModule() { - return module; - } - - /** - * 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 Object#toString() - */ - public String toString() { - return "Servlet [module=" + module + ", class=" + className + ", alias=" + alias + "]"; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/GenericRuntime.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/GenericRuntime.java deleted file mode 100644 index d041b189b..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/GenericRuntime.java +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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(); - int size = vmInstalls.length; - String id = getVMInstallId(); - for (int i = 0; i < size; i++) { - if (id.equals(vmInstalls[i].getId())) - return vmInstalls[i]; - } - } 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); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/GenericRuntimeClasspathProvider.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/GenericRuntimeClasspathProvider.java deleted file mode 100644 index c8f5cf9fa..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/GenericRuntimeClasspathProvider.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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 list = new ArrayList(); - addLibraryEntries(list, installPath.toFile(), false); - return (IClasspathEntry[])list.toArray(new IClasspathEntry[list.size()]); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/GenericRuntimeUtil.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/GenericRuntimeUtil.java deleted file mode 100644 index 82dc4882e..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/GenericRuntimeUtil.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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)); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/IGenericRuntime.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/IGenericRuntime.java deleted file mode 100644 index 1c509c414..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/IGenericRuntime.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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 -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/IGenericRuntimeWorkingCopy.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/IGenericRuntimeWorkingCopy.java deleted file mode 100644 index 0133c5c51..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/IGenericRuntimeWorkingCopy.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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.jdt.launching.IVMInstall; -/** - * - */ -public interface IGenericRuntimeWorkingCopy extends IGenericRuntime { - /** - * 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/sjavacore/org/eclipse/jst/server/core/internal/IMemento.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/IMemento.java deleted file mode 100644 index c170d267a..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/IMemento.java +++ /dev/null @@ -1,194 +0,0 @@ -/********************************************************************** - * Copyright (c) 2003, 2005 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.List; -/** - * 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 { - /** - * Special reserved key used to store the memento id - * (value <code>"org.eclipse.ui.id"</code>). - * - * @see #getId - */ - public static final String TAG_ID = "IMemento.internal.id"; //$NON-NLS-1$ - - /** - * 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); - - /** - * Creates a new child of this memento with the given type and id. - * The id is stored in the child memento (using a special reserved - * key, <code>TAG_ID</code>) and can be retrieved using <code>getId</code>. - * <p> - * The <code>getChild</code> and <code>getChildren</code> methods - * are used to retrieve children of a given type. - * </p> - * - * @param type the type - * @param id the child id - * @return a new child memento with the given type and id - * @see #getId - */ - public IMemento createChild(String type, String id); - - /** - * 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 floating point 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 a floating point number - */ - public Float getFloat(String key); - - /** - * Returns the id for this memento. - * - * @return the memento id, or <code>null</code> if none - * @see #createChild(java.lang.String,java.lang.String) - */ - public String getId(); - - /** - * Returns the name for this memento. - * - * @return the memento name, or <code>null</code> if none - * @see #createChild(java.lang.String,java.lang.String) - */ - public String getName(); - - /** - * Returns the integer 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 Integer getInteger(String key); - - /** - * 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); - - /** - * Returns the boolean 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 a boolean - */ - public Boolean getBoolean(String key); - - /** - * Return the list of names. - * - * @return a possibly empty list of names - */ - public List getNames(); - - /** - * Sets the value of the given key to the given floating point number. - * - * @param key the key - * @param value the value - */ - public void putFloat(String key, float value); - - /** - * Sets the value of the given key to the given integer. - * - * @param key the key - * @param value the value - */ - public void putInteger(String key, int value); - - /** - * Sets the value of the given key to the given boolean value. - * - * @param key the key - * @param value the value - */ - public void putBoolean(String key, boolean value); - - /** - * Copy the attributes and children from <code>memento</code> - * to the receiver. - * - * @param memento the IMemento to be copied. - */ - public void putMemento(IMemento memento); - - /** - * 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/sjavacore/org/eclipse/jst/server/core/internal/J2EELaunchableClient.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/J2EELaunchableClient.java deleted file mode 100644 index 4f1829295..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/J2EELaunchableClient.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 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; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/J2EEUtil.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/J2EEUtil.java deleted file mode 100644 index 25d7de0f5..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/J2EEUtil.java +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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.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"; - - /** - * 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) { - List list = new ArrayList(); - IModule[] modules = ServerUtil.getModules(EAR_MODULE); - if (modules != null) { - int size = modules.length; - for (int i = 0; i < size; i++) { - IModule module2 = modules[i]; - IEnterpriseApplication ear = (IEnterpriseApplication) module2.loadAdapter(IEnterpriseApplication.class, monitor); - if (ear != null) { - IModule[] modules2 = ear.getModules(); - if (modules2 != null) { - int size2 = modules2.length; - for (int j = 0; j < size2; j++) { - if (module.equals(modules2[j].loadAdapter(IJ2EEModule.class, monitor))) - list.add(module2); - } - } - } - } - } - - IModule[] ears = new IModule[list.size()]; - list.toArray(ears); - return ears; - } - - /** - * 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) { - List list = new ArrayList(); - IModule[] modules = ServerUtil.getModules(EAR_MODULE); - if (modules != null) { - int size = modules.length; - for (int i = 0; i < size; i++) { - IModule module2 = modules[i]; - IEnterpriseApplication ear = (IEnterpriseApplication) module2.loadAdapter(IEnterpriseApplication.class, monitor); - if (ear != null) { - IModule[] modules2 = ear.getModules(); - if (modules2 != null) { - int size2 = modules2.length; - for (int j = 0; j < size2; j++) { - if (module.equals(modules2[j])) - list.add(module2); - } - } - } - } - } - - IModule[] ears = new IModule[list.size()]; - list.toArray(ears); - return ears; - } - - /** - * 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) { - List list = new ArrayList(); - IModule[] modules = ServerUtil.getModules(WEB_MODULE); - if (modules != null) { - int size = modules.length; - for (int i = 0; i < size; i++) { - IModule module2 = modules[i]; - IWebModule web = (IWebModule) module2.loadAdapter(IWebModule.class, monitor); - if (web != null) { - IModule[] modules2 = web.getModules(); - if (modules2 != null) { - int size2 = modules2.length; - for (int j = 0; j < size2; j++) { - if (module.equals(modules2[j])) - list.add(module2); - } - } - } - } - } - - IModule[] webs = new IModule[list.size()]; - list.toArray(webs); - return webs; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/JavaServerPlugin.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/JavaServerPlugin.java deleted file mode 100644 index 22b76d68e..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/JavaServerPlugin.java +++ /dev/null @@ -1,468 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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.jdt.core.IClasspathContainer; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -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.internal.ServerPlugin; -import org.osgi.framework.Bundle; -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 runtimeClasspathProviders; - - // cached copy of all runtime component providers - private static List runtimeComponentProviders; - - // cached copy of all runtime facet mappings - private static List runtimeFacetMappings; - - // cached copy of all server profilers - private static List serverProfilers; - - // runtime listener - private static IRuntimeLifecycleListener runtimeListener; - - // cached bundle context - private BundleContext context; - - /** - * 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 context2) throws Exception { - super.start(context2); - this.context = context2; - - 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 - * @deprecated should not be called directly, will be removed - */ - protected void handleRuntimeChange(IRuntime runtime) { - handleRuntimeChange(runtime, 1); - } - - /** - * 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); - - 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 ServerPlugin.PLUGIN_ID.equals(family); - } - - public IStatus run(IProgressMonitor monitor) { - IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); - if (projects != null) { - int size = projects.length; - for (int i = 0; i < size; i++) { - if (projects[i].isAccessible()) { - try { - if (!projects[i].isNatureEnabled(JavaCore.NATURE_ID)) - continue; - - IJavaProject javaProject = JavaCore.create(projects[i]); // TODO is java project? - - boolean found = false; - IClasspathEntry[] ce = javaProject.getRawClasspath(); - for (int j = 0; j < ce.length; j++) { - if (ce[j].getEntryKind() == IClasspathEntry.CPE_CONTAINER) { - if (serverContainerPath.isPrefixOf(ce[j].getPath())) - found = true; - } - } - - Trace.trace(Trace.FINEST, "Classpath change on: " + projects[i] + " " + found); - - if (found) { - IRuntime runtime2 = runtime; - if (act == 2) - runtime2 = null; - RuntimeClasspathContainer container = new RuntimeClasspathContainer(projects[i], - 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 logError(String msg) { - log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null)); - }*/ - - 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 with 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 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"); - - int size = cf.length; - List list = new ArrayList(size); - for (int i = 0; i < size; i++) { - try { - list.add(new RuntimeClasspathProviderWrapper(cf[i])); - Trace.trace(Trace.CONFIG, " Loaded runtimeClasspathProviders: " + cf[i].getAttribute("id")); - } catch (Throwable t) { - Trace.trace(Trace.SEVERE, " Could not load runtimeClasspathProviders: " + cf[i].getAttribute("id"), t); - } - } - runtimeClasspathProviders = list; - - Trace.trace(Trace.CONFIG, "-<- Done loading .runtimeClasspathProviders extension point -<-"); - } - - /** - * 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 RuntimeFacetMapping[] getRuntimeFacetMapping() { - if (runtimeFacetMappings == null) - loadRuntimeFacetMapping(); - - RuntimeFacetMapping[] rfm = new RuntimeFacetMapping[runtimeFacetMappings.size()]; - runtimeFacetMappings.toArray(rfm); - return rfm; - } - - /** - * Returns the runtime component provider that supports the given runtime type, or <code>null</code> - * if none. This convenience method searches the list of known runtime - * component providers for the one with a matching runtime type. - * The runtimeType may not be null. - * - * @param runtimeType a runtime type - * @return the runtime component provider instance, or <code>null</code> if - * there is no runtime component provider with the given id - */ - public static RuntimeComponentProviderWrapper findRuntimeComponentProvider(IRuntimeType runtimeType) { - if (runtimeType == null) - throw new IllegalArgumentException(); - - if (runtimeComponentProviders == null) - loadRuntimeComponentProviders(); - - Iterator iterator = runtimeComponentProviders.iterator(); - while (iterator.hasNext()) { - RuntimeComponentProviderWrapper runtimeComponentProvider = (RuntimeComponentProviderWrapper) iterator.next(); - if (runtimeComponentProvider.supportsRuntimeType(runtimeType)) - return runtimeComponentProvider; - } - return null; - } - - /** - * Load the runtime component providers. - */ - private static synchronized void loadRuntimeComponentProviders() { - if (runtimeComponentProviders != null) - return; - Trace.trace(Trace.CONFIG, "->- Loading .runtimeComponentProviders extension point ->-"); - IExtensionRegistry registry = Platform.getExtensionRegistry(); - IConfigurationElement[] cf = registry.getConfigurationElementsFor(JavaServerPlugin.PLUGIN_ID, "internalRuntimeComponentProviders"); - - int size = cf.length; - List list = new ArrayList(size); - for (int i = 0; i < size; i++) { - try { - list.add(new RuntimeComponentProviderWrapper(cf[i])); - Trace.trace(Trace.CONFIG, " Loaded runtimeComponentProviders: " + cf[i].getAttribute("id")); - } catch (Throwable t) { - Trace.trace(Trace.SEVERE, " Could not load runtimeComponentProvider: " + cf[i].getAttribute("id"), t); - } - } - runtimeComponentProviders = list; - - Trace.trace(Trace.CONFIG, "-<- Done loading .runtimeComponentProviders extension point -<-"); - } - - /** - * Load the runtime facet mappings. - */ - private static synchronized void loadRuntimeFacetMapping() { - if (runtimeFacetMappings != null) - return; - Trace.trace(Trace.CONFIG, "->- Loading .runtimeFacetMapping extension point ->-"); - IExtensionRegistry registry = Platform.getExtensionRegistry(); - IConfigurationElement[] cf = registry.getConfigurationElementsFor(JavaServerPlugin.PLUGIN_ID, "runtimeFacetMappings"); - - int size = cf.length; - List list = new ArrayList(size); - for (int i = 0; i < size; i++) { - try { - list.add(new RuntimeFacetMapping(cf[i])); - Trace.trace(Trace.CONFIG, " Loaded runtimeFacetMapping: " + cf[i].getAttribute("runtimeTypeId")); - } catch (Throwable t) { - Trace.trace(Trace.SEVERE, " Could not load runtimeFacetMapping: " + cf[i].getAttribute("id"), t); - } - } - runtimeFacetMappings = list; - - Trace.trace(Trace.CONFIG, "-<- Done loading .runtimeFacetMapping 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"); - - int size = cf.length; - List list = new ArrayList(size); - for (int i = 0; i < size; i++) { - try { - list.add(new ServerProfiler(cf[i])); - Trace.trace(Trace.CONFIG, " Loaded serverProfiler: " + cf[i].getAttribute("id")); - } catch (Throwable t) { - Trace.trace(Trace.SEVERE, " Could not load serverProfiler: " + cf[i].getAttribute("id"), t); - } - } - serverProfilers = list; - - Trace.trace(Trace.CONFIG, "-<- Done loading .serverProfilers extension point -<-"); - } - - protected void startContributor(IContributor contributor) { - if (contributor == null) - return; - - String name = contributor.getName(); - if (name == null) - return; - - try { - Bundle[] bundles = context.getBundles(); - int size = bundles.length; - for (int i = 0; i < size; i++) { - if (name.equals(bundles[i].getSymbolicName())) { - // try to lazy start the bundle - bundles[i].loadClass("does.not.exist.Test"); - return; - } - } - } catch (Throwable t) { - // ignore - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/LaunchConfigurationUtil.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/LaunchConfigurationUtil.java deleted file mode 100644 index 6b94bbef2..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/LaunchConfigurationUtil.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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(); - }*/ -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/Messages.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/Messages.java deleted file mode 100644 index ad24995b1..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/Messages.java +++ /dev/null @@ -1,41 +0,0 @@ -/********************************************************************** - * Copyright (c) 2005 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; - - 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/sjavacore/org/eclipse/jst/server/core/internal/Messages.properties b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/Messages.properties deleted file mode 100644 index 97f0fe599..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/Messages.properties +++ /dev/null @@ -1,32 +0,0 @@ -############################################################################### -# Copyright (c) 2004, 2005 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}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/ProgressUtil.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/ProgressUtil.java deleted file mode 100644 index 55bbe1c03..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/ProgressUtil.java +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeBridge.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeBridge.java deleted file mode 100644 index 0dd1491da..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeBridge.java +++ /dev/null @@ -1,239 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005 BEA Systems, Inc. - * Copyright (c) 2006 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: - * Konstantin Komissarchik - initial API and implementation - * IBM Corporation - Support for all server types - ******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.launching.IVMInstall; -import org.eclipse.jdt.launching.IVMInstall2; -import org.eclipse.jdt.launching.JavaRuntime; -import org.eclipse.jst.server.core.IJavaRuntime; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeBridge; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponentVersion; -import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager; -import org.eclipse.wst.server.core.IRuntime; -import org.eclipse.wst.server.core.IRuntimeType; -import org.eclipse.wst.server.core.ServerCore; -import org.eclipse.wst.server.core.internal.Runtime; -/** - * - */ -public class RuntimeBridge implements IRuntimeBridge { - protected static final String CLASSPATH = "classpath"; - - protected static Map mappings = new HashMap(); - - static { - initialize(); - } - - private static void addMapping(String id, String id2, String version) { - ArrayList list = null; - try { - list = (ArrayList) mappings.get(id); - } catch (Exception e) { - // ignore - } - - if (list == null) - list = new ArrayList(2); - - try { - list.add(RuntimeManager.getRuntimeComponentType(id2).getVersion(version)); - mappings.put(id, list); - } catch (Exception e) { - // ignore - } - } - - private static void initialize() { - RuntimeFacetMapping[] rfms = JavaServerPlugin.getRuntimeFacetMapping(); - int size = rfms.length; - for (int i = 0; i < size; i++) - addMapping(rfms[i].getRuntimeTypeId(), rfms[i].getRuntimeComponent(), rfms[i].getVersion()); - - // generic runtimes - addMapping("org.eclipse.jst.server.generic.runtime.weblogic81", "org.eclipse.jst.server.generic.runtime.weblogic", "8.1"); - - addMapping("org.eclipse.jst.server.generic.runtime.weblogic90", "org.eclipse.jst.server.generic.runtime.weblogic", "9.0"); - - addMapping("org.eclipse.jst.server.generic.runtime.jboss323", "org.eclipse.jst.server.generic.runtime.jboss", "3.2.3"); - - addMapping("org.eclipse.jst.server.generic.runtime.jonas4", "org.eclipse.jst.server.generic.runtime.jonas", "4.0"); - - addMapping("org.eclipse.jst.server.generic.runtime.oracle1013", "org.eclipse.jst.server.generic.runtime.oracle", "10.1.3"); - - addMapping("org.eclipse.jst.server.generic.runtime.websphere.6", "org.eclipse.jst.server.generic.runtime.websphere", "6.0"); - } - - public Set getExportedRuntimeNames() throws CoreException { - IRuntime[] runtimes = ServerCore.getRuntimes(); - Set result = new HashSet(runtimes.length); - - for (int i = 0; i < runtimes.length; i++) { - IRuntime runtime = runtimes[i]; - IRuntimeType runtimeType = runtime.getRuntimeType(); - if (runtimeType != null && mappings.containsKey(runtimeType.getId())) { - result.add(runtime.getName()); - } - } - - return result; - } - - public IStub bridge(String name) throws CoreException { - if (name == null) - throw new IllegalArgumentException(); - - IRuntime[] runtimes = ServerCore.getRuntimes(); - int size = runtimes.length; - for (int i = 0; i < size; i++) { - if (runtimes[i].getName().equals(name)) - return new Stub(runtimes[i]); - } - return null; - } - - private static class Stub implements IStub { - private IRuntime runtime; - protected int timestamp = -1; - protected IVMInstall vmInstall; - protected String jvmver; - - public Stub(IRuntime runtime) { - this.runtime = runtime; - } - - public List getRuntimeComponents() { - List components = new ArrayList(2); - if (runtime == null) - return components; - - // define server runtime component - Map properties = new HashMap(5); - if (runtime.getLocation() != null) - properties.put("location", runtime.getLocation().toPortableString()); - else - properties.put("location", ""); - properties.put("name", runtime.getName()); - properties.put("type", runtime.getRuntimeType().getName()); - properties.put("id", runtime.getId()); - - RuntimeClasspathProviderWrapper rcpw = JavaServerPlugin.findRuntimeClasspathProvider(runtime.getRuntimeType()); - if (rcpw != null) { - IPath path = new Path(RuntimeClasspathContainer.SERVER_CONTAINER); - path = path.append(rcpw.getId()).append(runtime.getId()); - properties.put(CLASSPATH, path.toPortableString()); - } - - String typeId = runtime.getRuntimeType().getId(); - if (mappings.containsKey(typeId)) { - ArrayList list = (ArrayList) mappings.get(typeId); - int size = list.size(); - for (int i = 0; i < size; i++) { - IRuntimeComponentVersion mapped = (IRuntimeComponentVersion) list.get(i); - components.add(RuntimeManager.createRuntimeComponent(mapped, properties)); - } - } - - // define JRE component - IJavaRuntime javaRuntime = (IJavaRuntime) runtime.loadAdapter(IJavaRuntime.class, null); - if (javaRuntime != null) { - if (timestamp != ((Runtime) runtime).getTimestamp()) { - vmInstall = null; - jvmver = null; - timestamp = ((Runtime) runtime).getTimestamp(); - } - if (vmInstall == null) - vmInstall = javaRuntime.getVMInstall(); - if (jvmver == null) { - IVMInstall2 vmInstall2 = (IVMInstall2) vmInstall; - if (vmInstall2 != null) - jvmver = vmInstall2.getJavaVersion(); - } - IRuntimeComponentVersion rcv; - - String vmInstallName; - if (vmInstall != null) - vmInstallName = vmInstall.getName(); - else - vmInstallName = "Unknown"; - - if (jvmver == null) { - JavaServerPlugin.logWarning("Could not determine VM version for: " + vmInstallName); - rcv = RuntimeManager.getRuntimeComponentType("standard.jre").getVersion("6.0"); - } else if (jvmver.startsWith("1.3")) - rcv = RuntimeManager.getRuntimeComponentType("standard.jre").getVersion("1.3"); - else if (jvmver.startsWith("1.4")) - rcv = RuntimeManager.getRuntimeComponentType("standard.jre").getVersion("1.4"); - else if (jvmver.startsWith("1.5") || jvmver.startsWith("5.0")) - rcv = RuntimeManager.getRuntimeComponentType("standard.jre").getVersion("5.0"); - else if (jvmver.startsWith("1.6") || jvmver.startsWith("6.0")) - rcv = RuntimeManager.getRuntimeComponentType("standard.jre").getVersion("6.0"); - else { - JavaServerPlugin.logWarning("Invalid Java version: " + vmInstallName + ", " + jvmver); - rcv = RuntimeManager.getRuntimeComponentType("standard.jre").getVersion("6.0"); - } - - properties = new HashMap(3); - if (vmInstallName != null) - properties.put("name", vmInstallName); - else - properties.put("name", "-"); - - if (vmInstall == null || isUsingDefaultJRE(javaRuntime)) - properties.put(CLASSPATH, new Path(JavaRuntime.JRE_CONTAINER).toPortableString()); - else - properties.put(CLASSPATH, JavaRuntime.newJREContainerPath(vmInstall).toPortableString()); - components.add(RuntimeManager.createRuntimeComponent(rcv, properties)); - } - - RuntimeComponentProviderWrapper componentProvider = JavaServerPlugin.findRuntimeComponentProvider(runtime.getRuntimeType()); - if (componentProvider != null) { - List list = componentProvider.getComponents(runtime); - if (list != null) - components.addAll(list); - } - - return components; - } - - public Map getProperties() { - if (runtime == null) - return new HashMap(0); - return Collections.singletonMap("id", runtime.getId()); - } - } - - protected static boolean isUsingDefaultJRE(IJavaRuntime javaRuntime) { - try { - Method m = javaRuntime.getClass().getMethod("isUsingDefaultJRE", null); - Object o = m.invoke(javaRuntime, null); - Boolean b = (Boolean) o; - return b.booleanValue(); - } catch (Throwable t) { - // ignore - method not found - } - return false; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java deleted file mode 100644 index d7b18f4ab..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java +++ /dev/null @@ -1,137 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 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) { - 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; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeClasspathContainerInitializer.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeClasspathContainerInitializer.java deleted file mode 100644 index 9eb946ec5..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeClasspathContainerInitializer.java +++ /dev/null @@ -1,161 +0,0 @@ -/********************************************************************** - * Copyright (c) 2003, 2006 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.internal.ServerPlugin; -/** - * - */ -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); - } - } - } - } - - private 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 ServerPlugin.PLUGIN_ID.equals(family); - } - - public IStatus run(IProgressMonitor monitor) { - IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); - List list = new ArrayList(); - if (projects != null) { - int size = projects.length; - for (int i = 0; i < size; i++) { - if (projects[i].isAccessible()) { - try { - if (!projects[i].isNatureEnabled(JavaCore.NATURE_ID)) - continue; - - IJavaProject javaProject = JavaCore.create(projects[i]); // TODO is java project? - - boolean found = false; - IClasspathEntry[] ce = javaProject.getRawClasspath(); - for (int j = 0; j < ce.length; j++) { - if (ce[j].getEntryKind() == IClasspathEntry.CPE_CONTAINER) { - if (containerPath.isPrefixOf(ce[j].getPath())) - found = true; - } - } - - Trace.trace(Trace.FINEST, "Classpath change on: " + projects[i] + " " + 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/sjavacore/org/eclipse/jst/server/core/internal/RuntimeClasspathProvider.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeClasspathProvider.java deleted file mode 100644 index e978e3d13..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeClasspathProvider.java +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005, 2006 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.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(final IRuntimeComponent rc) { - this.rc = rc; - } - - public List getClasspathEntries(final 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 s = rc.getProperty(RuntimeBridge.CLASSPATH); - if (s == null || s.length() == 0) - return null; - - IClasspathEntry cpentry = JavaCore.newContainerEntry(new Path(s)); - return Collections.singletonList(cpentry); - } - - return null; - } - - public static final class Factory implements IAdapterFactory { - private static final Class[] ADAPTER_TYPES = { IClasspathProvider.class }; - - public Object getAdapter(final Object adaptable, final 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/sjavacore/org/eclipse/jst/server/core/internal/RuntimeClasspathProviderWrapper.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeClasspathProviderWrapper.java deleted file mode 100644 index d607002c7..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeClasspathProviderWrapper.java +++ /dev/null @@ -1,172 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 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.*; -/** - * - */ -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 list = new ArrayList(); - 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; - - int size = s.length; - for (int i = 0; i < size; i++) { - if (s[i].endsWith("*")) { - if (id.length() >= s[i].length() && id.startsWith(s[i].substring(0, s[i].length() - 1))) - return true; - } else if (id.equals(s[i])) - 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) { - Trace.trace(Trace.SEVERE, "Could not create delegate " + toString() + ": " + t.getMessage()); - } - } - 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) { - Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage()); - } - return null; - } - - /* - * @see RuntimeClasspathProviderDelegate#requestClasspathContainerUpdate(IRuntime, IClasspathEntry[]) - */ - public void requestClasspathContainerUpdate(IRuntime runtime, IClasspathEntry[] entries) { - if (runtime == null) - return; - try { - getDelegate().requestClasspathContainerUpdate(runtime, entries); - } catch (Exception e) { - Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage()); - } - } - - /* - * @see RuntimeClasspathProviderDelegate#hasRuntimeClasspathChanged(IRuntime) - */ - public boolean hasRuntimeClasspathChanged(IRuntime runtime) { - if (runtime == null) - return false; - try { - return getDelegate().hasRuntimeClasspathChanged(runtime); - } catch (Exception e) { - Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage()); - } - return false; - } - - public String toString() { - return "RuntimeClasspathProviderWrapper[" + getId() + "]"; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeComponentProviderDelegate.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeComponentProviderDelegate.java deleted file mode 100644 index e5185f5c3..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeComponentProviderDelegate.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 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.List; - -import org.eclipse.wst.server.core.IRuntime; -/** - * 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 { - public RuntimeComponentProviderDelegate() { - // default constructor - } - - /** - * Add runtime components to the given runtime. Components should be created by calling - * RuntimeManager.createRuntimeComponent(IRuntimeComponentVersion, Map) - * - * @param runtime a server runtime - * @return a list of runtimes, or an empty list or null if there are no additional components - */ - public abstract List getRuntimeComponents(IRuntime runtime); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeComponentProviderWrapper.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeComponentProviderWrapper.java deleted file mode 100644 index fd74dcc00..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeComponentProviderWrapper.java +++ /dev/null @@ -1,128 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 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.server.core.IRuntime; -import org.eclipse.wst.server.core.IRuntimeType; -/** - * - */ -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 list = new ArrayList(); - 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; - - int size = s.length; - for (int i = 0; i < size; i++) { - if (s[i].endsWith("*")) { - if (id.length() >= s[i].length() && id.startsWith(s[i].substring(0, s[i].length() - 1))) - return true; - } else if (id.equals(s[i])) - return true; - } - return false; - } - - /* - * Loads the delegate class. - */ - protected RuntimeComponentProviderDelegate getDelegate() { - if (delegate == null) { - try { - delegate = (RuntimeComponentProviderDelegate) element.createExecutableExtension("class"); - } catch (Throwable t) { - Trace.trace(Trace.SEVERE, "Could not create delegate " + toString() + ": " + t.getMessage()); - } - } - return delegate; - } - - /* - * @see RuntimeComponentProviderDelegate#getRuntimeComponents(IRuntime) - */ - public List getComponents(IRuntime runtime) { - if (runtime == null) - return null; - try { - return getDelegate().getRuntimeComponents(runtime); - } catch (Exception e) { - Trace.trace(Trace.SEVERE, "Error calling delegate " + toString() + ": " + e.getMessage()); - } - return null; - } - - public String toString() { - return "RuntimeComponentProviderWrapper[" + getId() + "]"; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeFacetMapping.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeFacetMapping.java deleted file mode 100644 index ea829a8a7..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeFacetMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 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() + "]"; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/ServerProfiler.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/ServerProfiler.java deleted file mode 100644 index eeae19a8e..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/ServerProfiler.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 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 ServerProfiler { - private IConfigurationElement element; - - /** - * 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"); - } - - /** - * - * @return the VM args - */ - public String getVMArgs() { - // about to launch with profiling. make sure that the profiling plugin is started - JavaServerPlugin.getInstance().startContributor(element.getContributor()); - - return element.getAttribute("vmArgs"); - } - - public String toString() { - return "ServerProfiler[" + getId() + "]"; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/StandardJreClasspathProvider.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/StandardJreClasspathProvider.java deleted file mode 100644 index 943fe1b48..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/StandardJreClasspathProvider.java +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005 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 - Cleanup - ******************************************************************************/ -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.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 final class StandardJreClasspathProvider implements IClasspathProvider { - private static final IProjectFacet JAVA_FACET = ProjectFacetsManager.getProjectFacet("jst.java"); - - private IRuntimeComponent rc; - - public StandardJreClasspathProvider(final IRuntimeComponent rc) { - this.rc = rc; - } - - public List getClasspathEntries(final IProjectFacetVersion fv) { - if (fv.getProjectFacet() == JAVA_FACET) { - IClasspathEntry cpentry = JavaCore.newContainerEntry(new Path(rc.getProperty(RuntimeBridge.CLASSPATH))); - return Collections.singletonList(cpentry); - } - - return null; - } - - public static final class Factory implements IAdapterFactory { - private static final Class[] ADAPTER_TYPES = { IClasspathProvider.class }; - - public Object getAdapter(final Object adaptable, final Class adapterType) { - IRuntimeComponent rc = (IRuntimeComponent) adaptable; - return new StandardJreClasspathProvider(rc); - } - - public Class[] getAdapterList() { - return ADAPTER_TYPES; - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/Trace.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/Trace.java deleted file mode 100644 index 4454853a9..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/Trace.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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; -/** - * Helper class to route trace output. - */ -public class Trace { - /** - * Config tracing - */ - public static byte CONFIG = 0; - /** - * Warning tracing - */ - public static byte WARNING = 1; - /** - * Severe tracing - */ - public static byte SEVERE = 2; - /** - * Finest tracing - */ - public static byte FINEST = 3; - - public static byte PUBLISHING = 4; - - /** - * 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 (!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/sjavacore/org/eclipse/jst/server/core/internal/XMLMemento.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/XMLMemento.java deleted file mode 100644 index 01b81c9d7..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/XMLMemento.java +++ /dev/null @@ -1,388 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 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); - } - - /** - * @see IMemento#createChild(String, String) - */ - public IMemento createChild(String type, String id) { - Element child = factory.createElement(type); - child.setAttribute(TAG_ID, id); - element.appendChild(child); - return new XMLMemento(factory, child); - } - - /** - * Create a Document from a Reader and answer a root memento for reading - * a document. - */ - protected 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. - ArrayList list = new ArrayList(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, (Element)list.get(x)); - } - return results; - } - - /** - * Return the contents of this memento as a byte array. - * - * @return byte[] - * @throws IOException if anything goes wrong - */ - public byte[] getContents() throws IOException { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - save(out); - return out.toByteArray(); - } - - /** - * Returns an input stream for writing to the disk with a local locale. - * - * @return java.io.InputStream - * @throws IOException if anything goes wrong - */ - public InputStream getInputStream() throws IOException { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - save(out); - return new ByteArrayInputStream(out.toByteArray()); - } - - /* - * @see IMemento - */ - public Float getFloat(String key) { - Attr attr = element.getAttributeNode(key); - if (attr == null) - return null; - String strValue = attr.getValue(); - try { - return new Float(strValue); - } catch (NumberFormatException e) { - return null; - } - } - - /* - * @see IMemento - */ - public String getId() { - return element.getAttribute(TAG_ID); - } - - /* - * @see IMemento - */ - public String getName() { - return element.getNodeName(); - } - - /* - * @see IMemento - */ - public Integer getInteger(String key) { - Attr attr = element.getAttributeNode(key); - if (attr == null) - return null; - String strValue = attr.getValue(); - try { - return new Integer(strValue); - } catch (NumberFormatException e) { - return null; - } - } - - /* - * @see IMemento - */ - public String getString(String key) { - Attr attr = element.getAttributeNode(key); - if (attr == null) - return null; - return attr.getValue(); - } - - public List getNames() { - NamedNodeMap map = element.getAttributes(); - int size = map.getLength(); - List list = new ArrayList(); - for (int i = 0; i < size; i++) { - Node node = map.item(i); - String name = node.getNodeName(); - list.add(name); - } - return list; - } - - /** - * Loads a memento from the given filename. - * - * @param filename java.lang.String - * @return org.eclipse.ui.IMemento - * @exception java.io.IOException - */ - public static IMemento loadMemento(String filename) throws IOException { - return XMLMemento.createReadRoot(new FileInputStream(filename)); - } - - /* - * @see IMemento - */ - private void putElement(Element element2) { - NamedNodeMap nodeMap = element2.getAttributes(); - int size = nodeMap.getLength(); - for (int i = 0; i < size; i++){ - Attr attr = (Attr)nodeMap.item(i); - putString(attr.getName(),attr.getValue()); - } - - NodeList nodes = element2.getChildNodes(); - size = nodes.getLength(); - for (int i = 0; i < size; i ++) { - Node node = nodes.item(i); - if (node instanceof Element) { - XMLMemento child = (XMLMemento)createChild(node.getNodeName()); - child.putElement((Element)node); - } - } - } - - /* - * @see IMemento - */ - public void putFloat(String key, float f) { - element.setAttribute(key, String.valueOf(f)); - } - - /* - * @see IMemento - */ - public void putInteger(String key, int n) { - element.setAttribute(key, String.valueOf(n)); - } - - /* - * @see IMemento - */ - public void putMemento(IMemento memento) { - XMLMemento xmlMemento = (XMLMemento) memento; - putElement(xmlMemento.element); - } - - /* - * @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 - */ - public 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 - } - } - } - } - - /* - * @see IMemento#getBoolean(String) - */ - public Boolean getBoolean(String key) { - Attr attr = element.getAttributeNode(key); - if (attr == null) - return null; - String strValue = attr.getValue(); - if ("true".equalsIgnoreCase(strValue)) - return new Boolean(true); - return new Boolean(false); - } - - /* - * @see IMemento#putBoolean(String, boolean) - */ - public void putBoolean(String key, boolean value) { - element.setAttribute(key, value ? "true" : "false"); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/cactus/CactusLaunchable.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/cactus/CactusLaunchable.java deleted file mode 100644 index de2f44725..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/cactus/CactusLaunchable.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. 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: - * Daniel R. Somerfield - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal.cactus; - -import java.net.URL; -/** - * - */ -public class CactusLaunchable { - private String fProjectname; - private String fClassName; - private String fTestName; - private URL fCactusURL; - - public CactusLaunchable(String projectName, String className, String testName, URL cactusURL) { - fProjectname = projectName; - fClassName = className; - fTestName = testName; - fCactusURL = cactusURL; - } - - public String getTestClassName() { - return fClassName; - } - - public String getTestName() { - return fTestName; - } - - public String getProjectName() { - return fProjectname; - } - - public URL getCactusURL() { - return fCactusURL; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/cactus/CactusLaunchableAdapterDelegate.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/cactus/CactusLaunchableAdapterDelegate.java deleted file mode 100644 index 028f6fc20..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/cactus/CactusLaunchableAdapterDelegate.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. 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: - * Daniel R. Somerfield - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal.cactus; - -import java.net.MalformedURLException; -import java.net.URL; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jst.server.core.internal.Trace; -import org.eclipse.wst.server.core.IModuleArtifact; -import org.eclipse.wst.server.core.IServer; -import org.eclipse.wst.server.core.model.IURLProvider; -import org.eclipse.wst.server.core.model.LaunchableAdapterDelegate; -/** - * - */ -public class CactusLaunchableAdapterDelegate extends LaunchableAdapterDelegate { - public Object getLaunchable(IServer server, IModuleArtifact moduleArtifact) throws CoreException { - if (moduleArtifact instanceof WebTestableResource) { - WebTestableResource resource = (WebTestableResource) moduleArtifact; - URL url = ((IURLProvider) server.getAdapter(IURLProvider.class)) - .getModuleRootURL(resource.getModule()); - - String urlString = url.toString(); - if (urlString.endsWith("/")) { - try { - url = new URL(urlString.substring(0, urlString.length() - 1)); - } catch (MalformedURLException e) { - Trace.trace(Trace.SEVERE, "Error getting launchable", e); - return null; - } - } - return new CactusLaunchable(resource.getProjectName(), - resource.getClassName(), resource.getTestName(), url); - } - return null; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/cactus/CactusModuleArtifactAdapterDelegate.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/cactus/CactusModuleArtifactAdapterDelegate.java deleted file mode 100644 index 7e8196f16..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/cactus/CactusModuleArtifactAdapterDelegate.java +++ /dev/null @@ -1,195 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. 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: - * Daniel R. Somerfield - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal.cactus; - -import java.util.Arrays; -import java.util.Iterator; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IMethod; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.ITypeHierarchy; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.Signature; -import org.eclipse.jst.server.core.internal.Trace; -import org.eclipse.wst.server.core.IModule; -import org.eclipse.wst.server.core.IModuleArtifact; -import org.eclipse.wst.server.core.ServerUtil; -import org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate; -/** - * - */ -public class CactusModuleArtifactAdapterDelegate extends ModuleArtifactAdapterDelegate { - private static final String SERVLET_TEST_CASE_TYPE = "org.apache.cactus.ServletTestCase"; - - private static final String SUITE_METHOD = "suite"; - - private static final String TEST_CLASS_NAME = "junit.framework.Test"; - - public IModuleArtifact getModuleArtifact(Object obj) { - String methodName = ""; - if (obj instanceof IMethod) { - IMethod method = (IMethod) obj; - methodName = method.getElementName(); - obj = method.getCompilationUnit(); - } - if (obj instanceof IAdaptable) { - IResource resource = (IResource) ((IAdaptable) obj).getAdapter(IResource.class); - String testClassName = getClassNameForType(resource, SERVLET_TEST_CASE_TYPE); - String projectName = resource.getProject().getName(); - if (testClassName != null) { - return new WebTestableResource(getModule(resource.getProject()), false, - projectName, testClassName, methodName); - } - } - return null; - } - - public static String getClassNameForType(IResource resource, String superType) { - if (resource == null) - return null; - try { - IProject project = resource.getProject(); - IPath path = resource.getFullPath(); - if (!project.hasNature(JavaCore.NATURE_ID) || path == null) - return null; - - IJavaProject javaProject = (IJavaProject) project.getNature(JavaCore.NATURE_ID); - if (!javaProject.isOpen()) - javaProject.open(new NullProgressMonitor()); - - // output location may not be on classpath - IPath outputPath = javaProject.getOutputLocation(); - if (outputPath != null - && "class".equals(path.getFileExtension()) && outputPath.isPrefixOf(path)) { //$NON-NLS-1$ - int count = outputPath.segmentCount(); - path = path.removeFirstSegments(count); - } - - // remove initial part of classpath - IClasspathEntry[] classPathEntry = javaProject.getResolvedClasspath(true); - if (classPathEntry != null) { - int size = classPathEntry.length; - for (int i = 0; i < size; i++) { - IPath classPath = classPathEntry[i].getPath(); - if (classPath.isPrefixOf(path)) { - int count = classPath.segmentCount(); - path = path.removeFirstSegments(count); - i += size; - } - } - } - - // get java element - IJavaElement javaElement = javaProject.findElement(path); - IType[] types = getTypes(javaElement); - if (types != null) { - int size2 = types.length; - for (int i = 0; i < size2; i++) { - if (hasSuperclass(types[i], superType) || hasSuiteMethod(types[i])) - return types[i].getFullyQualifiedName(); - } - } - return null; - } catch (Exception e) { - Trace.trace(Trace.WARNING, "Unexpected exception: " + e); - return null; - } - } - - private static boolean hasSuiteMethod(IType type) throws JavaModelException { - IMethod[] methods = type.getMethods(); - int size = methods.length; - for (int i = 0; i < size; i++) { - IMethod method = methods[i]; - if (method.getParameterNames().length == 0 && method.getElementName().equals(SUITE_METHOD)) { - String returnType = getFullyQualifiedTypeForMangledType(method.getReturnType(), type); - if (TEST_CLASS_NAME.equals(returnType)) { - return true; - } - } - } - return false; - } - - private static IType[] getTypes(IJavaElement element) { - try { - if (element.getElementType() != IJavaElement.COMPILATION_UNIT) - return null; - return ((ICompilationUnit) element).getAllTypes(); - } catch (Exception e) { - return null; - } - } - - public static boolean hasSuperclass(IType type, String superClassName) { - try { - ITypeHierarchy hierarchy = type.newSupertypeHierarchy(null); - IType[] superClasses = hierarchy.getAllSuperclasses(type); - int size = superClasses.length; - for (int i = 0; i < size; i++) { - if (superClassName.equals(superClasses[i].getFullyQualifiedName())) //$NON-NLS-1$ - return true; - } - return false; - } catch (Exception e) { - return false; - } - } - - protected static IModule getModule(IProject project) { - IModule deployable = null; - Iterator iterator = Arrays.asList(ServerUtil.getModules("jst.web")).iterator(); - while (iterator.hasNext()) { - Object next = iterator.next(); - if (next instanceof IModule) { - deployable = (IModule) next; - if (deployable.getProject().equals(project)) - return deployable; - } - } - return null; - } - - private static String getFullyQualifiedTypeForMangledType(String type, - IType declaringType) throws JavaModelException { - type = Signature.toString(type); - return getFullyQualifiedTypeForType(type, declaringType); - } - - private static String getFullyQualifiedTypeForType(String type, IType declaringType) - throws JavaModelException { - String[][] resolvedTypes = declaringType.resolveType(type); - //TODO: Are there legit cases where this would not be the case? We might need to check - //for this and bomb out if the type cannot be unambigiously resolved - if (resolvedTypes.length != 1) - Trace.trace(Trace.WARNING, "The type cannot be unambigiously resolved. Need to handle this case"); - String[] resolvedType = resolvedTypes[0]; - StringBuffer buffer = new StringBuffer(); - for (int i = 0; i < resolvedType.length - 1; i++) { - buffer.append(resolvedType[i]); - buffer.append('.'); - } - - buffer.append(resolvedType[resolvedType.length - 1]); - - return buffer.toString(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/cactus/ServletTestCasePropertyTester.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/cactus/ServletTestCasePropertyTester.java deleted file mode 100644 index 0d6f5c3bc..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/cactus/ServletTestCasePropertyTester.java +++ /dev/null @@ -1,95 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. 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: - * Daniel R. Somerfield - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal.cactus; - -import org.eclipse.core.expressions.PropertyTester; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jdt.core.IClassFile; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IMember; -import org.eclipse.jdt.core.IPackageFragment; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.Signature; -import org.eclipse.jst.server.core.internal.Trace; -/** - * - */ -public class ServletTestCasePropertyTester extends PropertyTester { - public static final String PROPERTY_IS_SERVLET_TEST_CASE = "isServletTestCase"; - private static final String TEST_SUPERCLASS_NAME = "org.apache.cactus.ServletTestCase"; - - public boolean test(Object receiver, String method, Object[] args, Object expectedValue) { - IJavaElement javaElement = null; - if (receiver instanceof IAdaptable) { - javaElement = (IJavaElement) ((IAdaptable) receiver).getAdapter(IJavaElement.class); - } - if (javaElement != null) { - if (!javaElement.exists()) { - return false; - } - } - if (javaElement instanceof IJavaProject - || javaElement instanceof IPackageFragmentRoot - || javaElement instanceof IPackageFragment) { - return true; - } - if (javaElement != null) { - if (PROPERTY_IS_SERVLET_TEST_CASE.equals(method)) { //$NON-NLS-1$ - return isServletTestCase(javaElement); - } - } - return false; - } - - private boolean isServletTestCase(IJavaElement element) { - IType testType = null; - - try { - if (element instanceof ICompilationUnit) { - ICompilationUnit cu = (ICompilationUnit) element; - testType = cu.getType(Signature.getQualifier(cu.getElementName())); - } else if (element instanceof IClassFile) { - testType = ((IClassFile) element).getType(); - } else if (element instanceof IType) { - testType = (IType) element; - } else if (element instanceof IMember) { - testType = ((IMember) element).getDeclaringType(); - } - - if (testType != null && testType.exists() && isTestOrSuite(testType)) { - return true; - } - } catch (JavaModelException e) { - // TODO: what do we do here? - Trace.trace(Trace.SEVERE, "Error checking isServlet", e); - } - return false; - } - - /** - * - * @param testType - * @return true if the type is a test, false otherwise - */ - private boolean isTestOrSuite(IType testType) throws JavaModelException { - IType[] types = testType.newSupertypeHierarchy(null).getAllSuperclasses(testType); - for (int i = 0; i < types.length; i++) { - if (types[i].getFullyQualifiedName().equals(TEST_SUPERCLASS_NAME)) { - return true; - } - } - return false; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/cactus/WebTestableResource.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/cactus/WebTestableResource.java deleted file mode 100644 index c760ce84a..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/cactus/WebTestableResource.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 BEA Systems, Inc. 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: - * Daniel R. Somerfield - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.server.core.internal.cactus; - -import org.eclipse.wst.server.core.IModule; -import org.eclipse.wst.server.core.IModuleArtifact; - -public class WebTestableResource implements IModuleArtifact { - private IModule fModule; - private boolean fServletIsConfigured; - private String fClassName; - private String fTestName; - private String fProjectName; - - public WebTestableResource(IModule module, boolean servletIsConfigured, - String projectName, String className, String testName) { - fModule = module; - fServletIsConfigured = servletIsConfigured; - fClassName = className; - fTestName = testName; - fProjectName = projectName; - } - - public String getProjectName() { - return fProjectName; - } - - public boolean isServletConfigured() { - return fServletIsConfigured; - } - - public IModule getModule() { - return fModule; - } - - public String getClassName() { - return fClassName; - } - - public String getTestName() { - return fTestName; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/package.html b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/package.html deleted file mode 100644 index 0dfa3c3ae..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/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/sjavacore/org/eclipse/jst/server/core/package.xml b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/package.xml deleted file mode 100644 index b4c05295a..000000000 --- a/plugins/org.eclipse.jst.server.core/sjavacore/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 |