diff options
Diffstat (limited to 'plugins/org.eclipse.jst.server.core')
64 files changed, 0 insertions, 5303 deletions
diff --git a/plugins/org.eclipse.jst.server.core/.classpath b/plugins/org.eclipse.jst.server.core/.classpath deleted file mode 100644 index 304e86186..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="src"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> - <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 5f5055404..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 -src.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 6def0c29e..000000000 --- a/plugins/org.eclipse.jst.server.core/.project +++ /dev/null @@ -1,34 +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> - <buildCommand> - <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature> - </natures> -</projectDescription> diff --git a/plugins/org.eclipse.jst.server.core/.settings/.api_filters b/plugins/org.eclipse.jst.server.core/.settings/.api_filters deleted file mode 100644 index 557b50509..000000000 --- a/plugins/org.eclipse.jst.server.core/.settings/.api_filters +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<component id="org.eclipse.jst.server.core" version="2"> - <resource path="src/org/eclipse/jst/server/core/IWebModule.java" type="org.eclipse.jst.server.core.IWebModule"> - <filter id="403804204"> - <message_arguments> - <message_argument value="org.eclipse.jst.server.core.IWebModule"/> - <message_argument value="getContextRoot(IModule)"/> - </message_arguments> - </filter> - </resource> -</component> diff --git a/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index c8be4323e..000000000 --- a/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Fri Nov 10 17:11:35 HST 2006 -eclipse.preferences.version=1 -encoding/<project>=ISO-8859-1 diff --git a/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 2920850ac..000000000 --- a/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,77 +0,0 @@ -#Thu Sep 13 15:25:06 EDT 2007 -eclipse.preferences.version=1 -instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true -org.eclipse.jdt.core.builder.cleanOutputFolder=clean -org.eclipse.jdt.core.builder.duplicateResourceTask=error -org.eclipse.jdt.core.builder.invalidClasspath=ignore -org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore -org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch,*.testsuite,*.deploy,*.location,*.execution,*.datapool,*.artifact,*.html,*.svg -org.eclipse.jdt.core.circularClasspath=error -org.eclipse.jdt.core.classpath.exclusionPatterns=disabled -org.eclipse.jdt.core.classpath.multipleOutputLocations=disabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000 -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=error -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error -org.eclipse.jdt.core.compiler.problem.localVariableHiding=error -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error -org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning -org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=error -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=error -org.eclipse.jdt.core.compiler.problem.unusedLabel=error -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.incompatibleJDKLevel=warning -org.eclipse.jdt.core.incompleteClasspath=error diff --git a/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index c39847efc..000000000 --- a/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Fri Feb 23 21:15:38 EST 2007 -eclipse.preferences.version=1 -org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?>\n<templates/> diff --git a/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.pde.prefs b/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.pde.prefs deleted file mode 100644 index 08a60e5fc..000000000 --- a/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,14 +0,0 @@ -#Sat Apr 22 18:36:14 EDT 2006 -compilers.incompatible-environment=0 -compilers.p.build=0 -compilers.p.deprecated=1 -compilers.p.no-required-att=0 -compilers.p.not-externalized-att=2 -compilers.p.unknown-attribute=0 -compilers.p.unknown-class=0 -compilers.p.unknown-element=0 -compilers.p.unknown-resource=0 -compilers.p.unresolved-ex-points=0 -compilers.p.unresolved-import=0 -compilers.use-project=true -eclipse.preferences.version=1 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 b1721ca7a..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.2.101.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" -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.304,2.0.0)", - org.eclipse.wst.common.project.facet.core;bundle-version="[1.1.0,2.0.0)", - org.eclipse.jst.common.project.facet.core;bundle-version="[1.1.0,2.0.0)" -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: J2SE-1.5 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 2199df3f0..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>June, 2008</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 40ca4c911..000000000 --- a/plugins/org.eclipse.jst.server.core/build.properties +++ /dev/null @@ -1,20 +0,0 @@ -############################################################################### -# Copyright (c) 2004, 2007 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -bin.includes = plugin.xml,\ - plugin.properties,\ - .,\ - META-INF/,\ - about.html -bin.excludes = bin/**,\ - @dot/**,\ - temp.folder/** -src.includes = schema/ -source.. = src/ 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 bf40b7131..000000000 --- a/plugins/org.eclipse.jst.server.core/plugin.properties +++ /dev/null @@ -1,29 +0,0 @@ -############################################################################### -# Copyright (c) 2004, 2008 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -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. 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 164304e97..000000000 --- a/plugins/org.eclipse.jst.server.core/plugin.xml +++ /dev/null @@ -1,123 +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" - facetRuntimeComponent="org.eclipse.jst.server.core.runtimeType" - facetRuntimeVersion="1.0" - 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.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="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,2.5"/> - <facet - id="jst.ejb" - version="1.1,2.0,2.1,3.0"/> - <facet - id="jst.ear" - version="1.2,1.3,1.4,5.0"/> - <facet - id="jst.connector" - version="1.0,1.5"/> - <facet - id="jst.appclient" - version="1.2,1.3,1.4,5.0"/> - <facet - id="jst.utility" - version="1.0"/> - </supported> - </extension> - - <extension point="org.eclipse.wst.common.project.facet.core.defaultFacets"> - <default-facets> - <runtime-component id="org.eclipse.jst.server.core.runtimeType"/> - <facet id="wst.jsdt.web" version="1.0"/> - </default-facets> - </extension> - - <extension point="org.eclipse.wst.server.core.runtimeFacetComponentProviders"> - <runtimeComponentProvider - id="org.eclipse.jst.server.core.JRERuntimeComponentProvider" - runtimeTypeIds="*" - class="org.eclipse.jst.server.core.internal.JRERuntimeComponentProvider"/> - </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 cf481bd0a..000000000 --- a/plugins/org.eclipse.jst.server.core/schema/internalRuntimeComponentProviders.exsd +++ /dev/null @@ -1,136 +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> - <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 90de0c122..000000000 --- a/plugins/org.eclipse.jst.server.core/schema/runtimeClasspathProviders.exsd +++ /dev/null @@ -1,135 +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="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="runtimeClasspathProvider"> - <annotation> - <appInfo> - <meta.element labelAttribute="name"/> - </appInfo> - </annotation> - <complexType> - <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 94d332e82..000000000 --- a/plugins/org.eclipse.jst.server.core/schema/runtimeFacetMappings.exsd +++ /dev/null @@ -1,139 +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="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="runtimeFacetMapping"> - <annotation> - <appInfo> - <meta.element labelAttribute="name"/> - </appInfo> - </annotation> - <complexType> - <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> - a facet runtime component id - </documentation> - </annotation> - </attribute> - <attribute name="version" type="string" use="required"> - <annotation> - <documentation> - a facet runtime component version - </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 4d0b48580..000000000 --- a/plugins/org.eclipse.jst.server.core/schema/serverProfilers.exsd +++ /dev/null @@ -1,134 +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="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="serverProfiler"> - <annotation> - <appInfo> - <meta.element labelAttribute="name"/> - </appInfo> - </annotation> - <complexType> - <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="class" type="string" use="required"> - <annotation> - <documentation> - a class that extends org.eclipse.jst.server.core.ServerProfilerDelegate - </documentation> - <appInfo> - <meta.attribute kind="java" basedOn="org.eclipse.jst.server.core.ServerProfilerDelegate"/> - </appInfo> - </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/src/org/eclipse/jst/server/core/ClasspathRuntimeTargetHandler.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ClasspathRuntimeTargetHandler.java deleted file mode 100644 index e6bb0155c..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ClasspathRuntimeTargetHandler.java +++ /dev/null @@ -1,134 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core; - -import java.io.File; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.*; -import org.eclipse.jdt.core.*; -import org.eclipse.wst.server.core.IRuntime; -import org.eclipse.wst.server.core.model.RuntimeTargetHandlerDelegate; -/** - * A runtime target handler that supports changing the classpath of the - * project by adding one or more classpath containers. Runtime providers - * can extend this class and implement the abstract methods to provide - * the correct build path for their runtime type. - * - * @deprecated Should use org.eclipse.jst.server.core.runtimeClasspathProviders - * extension point instead - */ -public abstract class ClasspathRuntimeTargetHandler extends RuntimeTargetHandlerDelegate { - /** (non-Javadoc) - * @see RuntimeTargetHandlerDelegate#setRuntimeTarget(IProject, IRuntime, IProgressMonitor) - */ - public void setRuntimeTarget(IProject project, IRuntime runtime, IProgressMonitor monitor) throws CoreException { - throw new RuntimeException("Attempt to use deprecated code"); - } - - /** (non-Javadoc) - * @see RuntimeTargetHandlerDelegate#removeRuntimeTarget(IProject, IRuntime, IProgressMonitor) - */ - public void removeRuntimeTarget(IProject project, IRuntime runtime, IProgressMonitor monitor) { - throw new RuntimeException("Attempt to use deprecated code"); - } - - /** - * Add library entries to the given list for every jar file found in the - * given directory. Optionally search subdirectories as well. - * - * @param list a list - * @param dir a directory - * @param includeSubdirectories <code>true</code> to include subdirectories, and - * <code>false</code> otherwise - */ - protected static void addLibraryEntries(List list, File dir, boolean includeSubdirectories) { - throw new RuntimeException("Attempt to use deprecated code"); - } - - /** - * Returns the classpath entries that correspond to the given runtime. - * - * @param runtime a runtime - * @param monitor a progress monitor, or <code>null</code> if progress - * reporting and cancellation are not desired - * @return an array of classpath entries - */ - public IClasspathEntry[] getDelegateClasspathEntries(IRuntime runtime, IProgressMonitor monitor) { - throw new RuntimeException("Attempt to use deprecated code"); - } - - /** - * Returns the classpath entry ids for this runtime target handler. These - * ids will be added to the classpath container id to create a new fully - * qualified classpath container id. - * <p> - * By default, there is a single classpath entry for the runtime, with no - * extra id (<code>new String[1]</code>). To create multiple ids, just - * return a string array containing the ids. For instance, to have two - * classpath containers with ids "id1" and "id2", use - * <code>new String[] { "id1", "id2" }</code> - * </p> - * - * @return an array of classpath entry ids - */ - public String[] getClasspathEntryIds() { - throw new RuntimeException("Attempt to use deprecated code"); - } - - /** - * Request that the classpath container for the given runtime and id be updated - * with the given classpath container entries. - * - * @param runtime a runtime - * @param id an id - * @param entries an array of classpath entries - */ - public void requestClasspathContainerUpdate(IRuntime runtime, String id, IClasspathEntry[] entries) { - throw new RuntimeException("Attempt to use deprecated code"); - } - - /** - * Returns the classpath container label for the given runtime and the given - * classpath container id (returned from getClasspathEntryIds()). This method - * must not return null. - * - * @param runtime the runtime to resolve the container label for - * @param id the classpath entry id - * @return a classpath container label - */ - public abstract String getClasspathContainerLabel(IRuntime runtime, String id); - - /** - * Resolve the classpath container. - * - * @param runtime a runtime - * @param id a container id - * @return a possibly empty array of classpath entries - */ - public IClasspathEntry[] resolveClasspathContainerImpl(IRuntime runtime, String id) { - throw new RuntimeException("Attempt to use deprecated code"); - } - - /** - * Resolves (creates the classpath entries for) the classpath container with - * the given runtime and the given classpath container id (returned from - * getClasspathEntryIds()). If the classpath container cannot be resolved - * (for instance, if the runtime does not exist), return null. - * - * @param runtime the runtime to resolve the container for - * @param id the classpath entry id - * @return an array of classpath entries for the container, or null if the - * container could not be resolved - */ - public abstract IClasspathEntry[] resolveClasspathContainer(IRuntime runtime, String id); -} diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/EJBBean.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/EJBBean.java deleted file mode 100644 index 29167324c..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/EJBBean.java +++ /dev/null @@ -1,217 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core; - -import org.eclipse.jst.server.core.internal.Messages; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.server.core.IModule; -import org.eclipse.wst.server.core.model.ModuleArtifactDelegate; -/** - * An EJB bean. - * <p> - * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to - * change significantly before reaching stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken - * (repeatedly) as the API evolves. - * </p> - * @since 1.1 - */ -public class EJBBean extends ModuleArtifactDelegate { - /** - * @since 1.1 - */ - public final static String EJB_11 = "1.1"; - /** - * @since 1.1 - */ - public final static String EJB_20 = "2.0"; - /** - * @since 1.1 - */ - public final static String EJB_21 = "2.1"; - /** - * @since 1.1 - */ - public final static String EJB_30 = "3.0"; - - private String jndiName; - private String interfaceName; - private boolean local; - private boolean remote; - private String version; - - /** - * Create a new EJBBean. - * - * @param module the module that the EJB is contained in - * @param jndiName the JNDI name of the EJB - * @param remote <code>true</code> if the EJB has a remote interface, and - * <code>false</code> otherwise - * @param local <code>true</code> if the EJB has a local interface, and - * <code>false</code> otherwise - */ - public EJBBean(IModule module, String jndiName, boolean remote, boolean local) { - super(module); - this.jndiName = jndiName; - this.remote = remote; - this.local = local; - this.version = "2.1"; - } - - /** - * Create a new EJBBean with a specific version - * - * @param module the module that the EJB is contained in - * @param jndiName the JNDI name of the EJB - * @param remote <code>true</code> if the EJB has a remote interface, and - * <code>false</code> otherwise - * @param local <code>true</code> if the EJB has a local interface, and - * <code>false</code> otherwise - * @param version the level of the EJB specification that this EJB uses. Use one of the <code>EJB_xx</code> constants declared on {@link EJBBean} - * @since 1.1 - */ - public EJBBean(IModule module, String jndiName, boolean remote, boolean local, String version) { - super(module); - this.jndiName = jndiName; - this.remote = remote; - this.local = local; - this.version = version; - } - - /** - * Create a new EJBBean with its interface name. This API is intended to be use by EJB 3.0. - * - * @param module the module that the EJB is contained in - * @param jndiName the JNDI name of the EJB - * @param remote <code>true</code> if the EJB has a remote interface, and - * <code>false</code> otherwise - * @param local <code>true</code> if the EJB has a local interface, and - * <code>false</code> otherwise - * @param version the level of the EJB specification that this EJB uses. Use one of the <code>EJB_xx</code> constants declared on {@link EJBBean} - * @param interfaceName the interface name of the EJB - * @since 1.1 - */ - - public EJBBean(IModule module, String jndiName, boolean remote, boolean local, String version, String interfaceName) { - super(module); - this.jndiName = jndiName; - this.remote = remote; - this.local = local; - this.version = version; - this.interfaceName = interfaceName; - } - - /** - * Create a new empty EJBBean. - */ - public EJBBean() { - super(); - } - - /** - * Returns the JNDI name of the EJB. - * - * @return the JNDI name of the EJB - */ - public String getJndiName() { - return jndiName; - } - - /** - * Returns whether the EJB has a remote interface. - * - * @return <code>true</code> if the EJB has a remote interface, and - * <code>false</code> otherwise - */ - public boolean hasRemoteInterface() { - return remote; - } - - /** - * Returns whether the EJB has a local interface. - * - * @return <code>true</code> if the EJB has a local interface, and - * <code>false</code> otherwise - */ - public boolean hasLocalInterface() { - return local; - } - - /** - * Returns the level of the specification of the EJB - * - * @return the level of the specification of the EJB - * @since 1.1 - */ - public String getVersion() { - return version; - } - - /* - * @see ModuleArtifactDelegate#getName() - */ - public String getName() { - String ejbName; - // EJB 2.0 don't have an inteface name, but they set the jndi name - if (interfaceName != null && !(interfaceName.length()<=0)){ - ejbName = interfaceName; - } - else{ - ejbName = jndiName; - } - return NLS.bind(Messages.artifactEJB, ejbName); - } - - /* - * @see ModuleArtifactDelegate#deserialize(String) - */ - public void deserialize(String s) { - int ind = s.indexOf("//"); - super.deserialize(s.substring(0, ind)); - if ('T' == s.charAt(ind+2)) - local = true; - else - local = false; - if ('T' == s.charAt(ind+3)) - remote = true; - else - remote = false; - jndiName = s.substring(ind+4); - } - - /* - * @see ModuleArtifactDelegate#serialize() - */ - public String serialize() { - StringBuffer sb = new StringBuffer(super.serialize()); - sb.append("//"); - if (local) - sb.append("T"); - else - sb.append("F"); - if (remote) - sb.append("T"); - else - sb.append("F"); - sb.append(jndiName); - return sb.toString(); - } - - /** - * Gets the name of interface represented by this object - * - * @return the interface name - * @since 1.1 - */ - public String getInterfaceName() { - return interfaceName; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/FacetUtil.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/FacetUtil.java deleted file mode 100644 index 201dc78c9..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/FacetUtil.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.wst.server.core.IRuntime; -import org.eclipse.wst.server.core.IServer; -/** - * Utility class for converting between facet runtimes and server runtimes. - * <p> - * This class provides all its functionality through static members. - * It is not intended to be subclassed or instantiated. - * </p> - * <p> - * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to - * change significantly before reaching stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken - * (repeatedly) as the API evolves. - * </p> - */ -public final class FacetUtil { - /** - * Static utility class - cannot create an instance. - */ - private FacetUtil() { - // can't create - } - - /** - * Returns the server runtime that corresponds to a facet runtime, or null - * if none could be found. - * - * @param runtime a facet runtime - * @return the server runtime that corresponds to the facet runtime, or - * <code>null</code> if none could be found. - */ - public static IRuntime getRuntime(org.eclipse.wst.common.project.facet.core.runtime.IRuntime runtime) { - return org.eclipse.wst.server.core.internal.facets.FacetUtil.getRuntime(runtime); - } - - /** - * Returns the facet runtime that corresponds to a server runtime, or null - * if none could be found. - * - * @param runtime a server runtime - * @return the facet runtime that corresponds to the server runtime, or - * <code>null</code> if none could be found. - */ - public static org.eclipse.wst.common.project.facet.core.runtime.IRuntime getRuntime(IRuntime runtime) { - return org.eclipse.wst.server.core.internal.facets.FacetUtil.getRuntime(runtime); - } - - /** - * Tests whether the facets on a project are supported by a given server. Returns - * an OK status if the server's runtime supports the project's facets, and an - * ERROR status (with message) if it doesn't. - * - * @param project a project - * @param server a server - * @return OK status if the server's runtime supports the project's facets, and an - * ERROR status (with message) if it doesn't - */ - public static final IStatus verifyFacets(IProject project, IServer server) { - return org.eclipse.wst.server.core.internal.facets.FacetUtil.verifyFacets(project, server); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IApplicationClientModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IApplicationClientModule.java deleted file mode 100644 index 03570e1d2..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IApplicationClientModule.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core; -/** - * A J2EE application client module. - * <p> - * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to - * change significantly before reaching stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken - * (repeatedly) as the API evolves. - * </p> - * @plannedfor 3.0 - */ -public interface IApplicationClientModule extends IJ2EEModule { - // intentionally empty -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IConnectorModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IConnectorModule.java deleted file mode 100644 index d8367257a..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IConnectorModule.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core; - -import org.eclipse.core.runtime.IPath; -/** - * A J2EE connector module. - * <p> - * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to - * change significantly before reaching stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken - * (repeatedly) as the API evolves. - * </p> - * @plannedfor 3.0 - */ -public interface IConnectorModule extends IJ2EEModule { - /** - * Returns the classpath as an array of absolute IPaths. - * - * @return an array of classpath entries - */ - public IPath[] getClasspath(); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEJBModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEJBModule.java deleted file mode 100644 index f6106565c..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEJBModule.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core; -/** - * A representation of a J2EE EJB module. - * <p> - * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to - * change significantly before reaching stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken - * (repeatedly) as the API evolves. - * </p> - * @plannedfor 3.0 - */ -public interface IEJBModule extends IJ2EEModule { - // intentionally empty -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEnterpriseApplication.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEnterpriseApplication.java deleted file mode 100644 index 7ea1d77a3..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEnterpriseApplication.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.wst.server.core.IModule; -/** - * A representation of a J2EE enterprise application (EAR file). - * <p> - * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to - * change significantly before reaching stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken - * (repeatedly) as the API evolves. - * </p> - * @plannedfor 3.0 - */ -public interface IEnterpriseApplication { - /** - * Returns the modules contained within this EAR. The returned modules will - * either be J2EE modules (which will be adaptable to IJ2EEModule) or - * utility jars contained in the EAR. - * - * @return a possibly empty array of modules contained within this application - */ - public IModule[] getModules(); - - /** - * Returns the URI of the given module within this enterprise application. - * - * @param module a module within this application - * @return the URI of the given module, or <code>null</code> if the URI could - * not be found - */ - public String getURI(IModule module); - - /** - * Returns the root folders for the resources in this module. - * - * @return a possibly-empty array of resource folders - */ - public IContainer[] getResourceFolders(); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJ2EEModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJ2EEModule.java deleted file mode 100644 index b4d974b26..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJ2EEModule.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core; - -import org.eclipse.core.resources.IContainer; -/** - * A J2EE module that can be deployed to a server. - * - * <p> - * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to - * change significantly before reaching stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken - * (repeatedly) as the API evolves. - * </p> - * @plannedfor 3.0 - */ -public interface IJ2EEModule { - /** - * Returns the root folders for the resources in this module. Returns an empty - * array if this is a binary module. - * - * @return a possibly-empty array of resource folders - */ - public IContainer[] getResourceFolders(); - - /** - * Returns the root folders containing Java output in this module. Returns an - * empty array if this is a binary module. - * - * @return a possibly-empty array of Java output folders - */ - public IContainer[] getJavaOutputFolders(); - - /** - * Returns true if this is a binary (zipped) module, and - * false if it is expanded. - * - * <p>If true, members() should return only a single element - - * the binary (jar or zip file) that contains the contents of - * this module. (a single IModuleResource, e.g. - * myejb.jar) Also, getLocation() should return the full path - * up to and including the binary itself. (e.g. - * c:\temp\myejb.jar)</p> - * - * <p>If false, members() should return the entire contents - * of the module, starting at the root. There should be no - * preceeding directory structure. (an array of - * IModuleResources, e.g. index.html, WEB-INF/web.xml, - * ...) In this case, getLocation() should return the path to - * the root folder containing these resources.</p> - * - * @return boolean - */ - public boolean isBinary(); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntime.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntime.java deleted file mode 100644 index 6a5169309..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntime.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core; - -import org.eclipse.jdt.launching.IVMInstall; -/** - * An interface for a server that contains a Java runtime. - * <p> - * <b>Note:</b> This class/interface is part of an interim API that is still under development and expected to - * change significantly before reaching stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken - * (repeatedly) as the API evolves. - * </p> - * @since 3.0 - */ -public interface IJavaRuntime { - /** - * Return the VM install (installed JRE) that this runtime is using. - * - * @return the current VM install - */ - public IVMInstall getVMInstall(); - - /** - * Returns <code>true</code> if the runtime is using the default JRE. - * - * @return <code>true</code> if the runtime is using the default JRE, - * and <code>false</code> otherwise - * @since 2.0 - */ - public boolean isUsingDefaultJRE(); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntimeWorkingCopy.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntimeWorkingCopy.java deleted file mode 100644 index 3fe507502..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntimeWorkingCopy.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core; - -import org.eclipse.jdt.launching.IVMInstall; -/** - * An interface for a server that contains a Java runtime. - * <p> - * <b>Note:</b> This class/interface is part of an interim API that is still under development and expected to - * change significantly before reaching stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken - * (repeatedly) as the API evolves. - * </p> - * @since 1.1 - */ -public interface IJavaRuntimeWorkingCopy extends IJavaRuntime { - /** - * Set the VM install (installed JRE) that this runtime is using. - * Use <code>null</code> to use the Eclipse default JRE. - * - * @param vmInstall the VM install to use - */ - public void setVMInstall(IVMInstall vmInstall); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IUtilityModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IUtilityModule.java deleted file mode 100644 index f013f696c..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IUtilityModule.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core; - -import org.eclipse.core.resources.IContainer; -/** - * A J2EE utility module that can be deployed to a server. - * - * <p> - * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to - * change significantly before reaching stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken - * (repeatedly) as the API evolves. - * </p> - * @plannedfor 3.0 - */ -public interface IUtilityModule { - /** - * Returns the root folders for the resources in this module. - * - * @return a possibly-empty array of resource folders - */ - public IContainer[] getResourceFolders(); - - /** - * Returns the root folders containing Java output in this module. - * - * @return a possibly-empty array of Java output folders - */ - public IContainer[] getJavaOutputFolders(); - - /** - * Returns true if this is a binary (zipped) module, and - * false if it is expanded. - * - * <p>If true, members() should return only a single element - - * the binary (jar or zip file) that contains the contents of - * this module. (a single IModuleResource, e.g. - * myejb.jar) Also, getLocation() should return the full path - * up to and including the binary itself. (e.g. - * c:\temp\myejb.jar)</p> - * - * <p>If false, members() should return the entire contents - * of the module, starting at the root. There should be no - * preceeding directory structure. (an array of - * IModuleResources, e.g. index.html, WEB-INF/web.xml, - * ...) In this case, getLocation() should return the path to - * the root folder containing these resources.</p> - * - * @return boolean - */ - public boolean isBinary(); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IWebFragmentModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IWebFragmentModule.java deleted file mode 100644 index 074e33b40..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IWebFragmentModule.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core; - -/** - * A J2EE web fragment module. - * <p> - * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to - * change significantly before reaching stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken - * (repeatedly) as the API evolves. - * </p> - * - * @plannedfor 3.0 - */ -public interface IWebFragmentModule extends IJ2EEModule { - // intentionally empty -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IWebModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IWebModule.java deleted file mode 100644 index 959ef2f66..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IWebModule.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core; - -import org.eclipse.wst.server.core.IModule; -/** - * A J2EE web module. - * <p> - * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to - * change significantly before reaching stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken - * (repeatedly) as the API evolves. - * </p> - * - * @plannedfor 3.0 - */ -public interface IWebModule extends IJ2EEModule { - /** - * Returns the context root of the module. - * - * @return the context root - */ - public String getContextRoot(); - - /** - * Returns the context root of the module. If the the webModule belongs to an earModule, the context root with higher - * precedence will be returned. - * - * @param earModule The EARModule if exist, if not null - * @return the context root - * @since 1.1 - */ - public String getContextRoot(IModule earModule); - - /** - * Returns the utility modules contained within this WAR. - * - * @return a possibly empty array of modules contained within this application - */ - public IModule[] getModules(); - - /** - * Returns the URI of the given contained module. - * - * @param module a module - * @return the URI of the given module, or <code>null</code> if the URI could - * not be found - */ - public String getURI(IModule module); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiLaunchable.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiLaunchable.java deleted file mode 100644 index db5304c3d..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiLaunchable.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core; - -import java.util.Properties; -/** - * A representation of an object in JNDI that can be tested on a server. - * <p> - * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to - * change significantly before reaching stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken - * (repeatedly) as the API evolves. - * </p> - * @plannedfor 3.0 - */ -public class JndiLaunchable { - private Properties props; - private String jndiName; - - /** - * Create a reference to an object that is launchable via JNDI. - * - * @param props the JNDI properties required to connect to the object - * @param jndiName the JNDI name of the object - */ - public JndiLaunchable(Properties props, String jndiName) { - this.jndiName = jndiName; - this.props = props; - } - - /** - * Returns the JNDI properties required to connect to the object. - * - * @return the JNDI properties required to connect to the object - */ - public Properties getProperties() { - return props; - } - - /** - * Returns the JNDI name of the object. - * - * @return the JNDI name of the object - */ - public String getJNDIName() { - return jndiName; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiObject.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiObject.java deleted file mode 100644 index f02e92224..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiObject.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core; - -import org.eclipse.jst.server.core.internal.Messages; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.server.core.IModule; -import org.eclipse.wst.server.core.model.ModuleArtifactDelegate; -/** - * A representation of an object in JNDI that can be tested on a server. - * <p> - * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to - * change significantly before reaching stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken - * (repeatedly) as the API evolves. - * </p> - * @plannedfor 3.0 - */ -public class JndiObject extends ModuleArtifactDelegate { - private String jndiName; - - /** - * Create a reference to an object in JNDI. - * - * @param module the module that the object is contained in - * @param jndiName the JNDI name of the object - */ - public JndiObject(IModule module, String jndiName) { - super(module); - this.jndiName = jndiName; - } - - /** - * Create an empty reference to an object in JNDI. - */ - public JndiObject() { - super(); - } - - /** - * Return the JNDI name of the object. - * - * @return the JNDI name of the object - */ - public String getJndiName() { - return jndiName; - } - - /* - * @see ModuleArtifactDelegate#getName() - */ - public String getName() { - return NLS.bind(Messages.artifactJNDI, jndiName); - } - - /* - * @see ModuleArtifactDelegate#deserialize(String) - */ - public void deserialize(String s) { - int ind = s.indexOf("//"); - super.deserialize(s.substring(0, ind)); - jndiName = s.substring(ind+2); - } - - /* - * @see ModuleArtifactDelegate#serialize() - */ - public String serialize() { - StringBuffer sb = new StringBuffer(super.serialize()); - sb.append("//"); - sb.append(jndiName); - return sb.toString(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/PublishUtil.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/PublishUtil.java deleted file mode 100644 index 794a15bc3..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/PublishUtil.java +++ /dev/null @@ -1,235 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core; - -import java.io.*; - -import org.eclipse.core.runtime.*; -import org.eclipse.jst.server.core.internal.JavaServerPlugin; -import org.eclipse.jst.server.core.internal.Messages; -import org.eclipse.jst.server.core.internal.Trace; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.server.core.model.IModuleFile; -import org.eclipse.wst.server.core.model.IModuleResource; -import org.eclipse.wst.server.core.model.IModuleResourceDelta; -/** - * Utility class with an assortment of useful file methods. - * <p> - * This class provides all its functionality through static members. - * It is not intended to be subclassed or instantiated. - * </p> - * <p> - * <b>Note:</b> Adopters should use the equivalent class in - * org.eclipse.wst.server.core.util instead. This class will eventually - * be deprecated. - * </p> - */ -public final class PublishUtil { - // size of the buffer - private static final int BUFFER = 65536; - - // the buffer - private static byte[] buf = new byte[BUFFER]; - - /** - * PublishUtil cannot be created. Use static methods. - */ - private PublishUtil() { - // can't create - } - - /** - * Copy a file from a to b. Closes the input stream after use. - * - * @param in java.io.InputStream - * @param to java.lang.String - * @deprecated Unused - will be removed. - * @return a status - */ - public static IStatus copyFile(InputStream in, String to) { - OutputStream out = null; - - try { - out = new FileOutputStream(to); - - int avail = in.read(buf); - while (avail > 0) { - out.write(buf, 0, avail); - avail = in.read(buf); - } - return Status.OK_STATUS; - } catch (Exception e) { - Trace.trace(Trace.SEVERE, "Error copying file", e); - return new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorCopyingFile, new String[] {to, e.getLocalizedMessage()}), e); - } finally { - try { - if (in != null) - in.close(); - } catch (Exception ex) { - // ignore - } - try { - if (out != null) - out.close(); - } catch (Exception ex) { - // ignore - } - } - } - - /** - * Smart copy the given module resources to the given path. - * - * @param resources - * @param path - * @param monitor a progress monitor, or <code>null</code> if progress - * reporting and cancellation are not desired - * @throws CoreException - * @deprecated This method only returns a single error in the case of failure. Use publishSmart() instead. - */ - public static void smartCopy(IModuleResource[] resources, IPath path, IProgressMonitor monitor) throws CoreException { - IStatus[] status = PublishUtil.publishSmart(resources, path, monitor); - if (status != null && status.length > 0) - throw new CoreException(status[0]); - } - - /** - * Handle a delta publish. - * - * @param kind - * @param path - * @param delta - * @throws CoreException - * @deprecated This method only returns a single error in the case of failure. Use publishDelta() instead. - */ - public static void handleDelta(int kind, IPath path, IModuleResourceDelta delta) throws CoreException { - IStatus[] status = PublishUtil.publishDelta(delta, path, null); - if (status != null && status.length > 0) - throw new CoreException(status[0]); - } - - /** - * - * @param path - * @param file - * @deprecated does not fail or return status if delete doesn't work - */ - protected static void deleteFile(IPath path, IModuleFile file) { - Trace.trace(Trace.PUBLISHING, "Deleting: " + file.getName() + " from " + path.toString()); - IPath path2 = path.append(file.getModuleRelativePath()).append(file.getName()); - path2.toFile().delete(); - } - - /** - * - * @param resources - * @param path - * @throws CoreException - * @deprecated This method only returns a single error in the case of failure. Use publishFull() instead - */ - public static void copy(IModuleResource[] resources, IPath path) throws CoreException { - IStatus[] status = PublishUtil.publishFull(resources, path, null); - if (status != null && status.length > 0) - throw new CoreException(status[0]); - } - - /** - * Creates a new zip file containing the given module resources. Deletes the existing file - * (and doesn't create a new one) if resources is null or empty. - * - * @param resources - * @param zipPath - * @throws CoreException - */ - public static void createZipFile(IModuleResource[] resources, IPath zipPath) throws CoreException { - IStatus[] status = PublishUtil.publishZip(resources, zipPath, null); - if (status != null && status.length > 0) - throw new CoreException(status[0]); - } - - /** - * Utility method to recursively delete a directory. - * - * @param dir a directory - * @param monitor a progress monitor, or <code>null</code> if progress - * reporting and cancellation are not desired - * @return a possibly-empty array of error and warning status - */ - public static IStatus[] deleteDirectory(File dir, IProgressMonitor monitor) { - return org.eclipse.wst.server.core.util.PublishUtil.deleteDirectory(dir, monitor); - } - - /** - * Smart copy the given module resources to the given path. - * - * @param resources an array of module resources - * @param path an external path to copy to - * @param monitor a progress monitor, or <code>null</code> if progress - * reporting and cancellation are not desired - * @return a possibly-empty array of error and warning status - */ - public static IStatus[] publishSmart(IModuleResource[] resources, IPath path, IProgressMonitor monitor) { - return org.eclipse.wst.server.core.util.PublishUtil.publishSmart(resources, path, monitor); - } - - /** - * Handle a delta publish. - * - * @param delta a module resource delta - * @param path the path to publish to - * @param monitor a progress monitor, or <code>null</code> if progress - * reporting and cancellation are not desired - * @return a possibly-empty array of error and warning status - */ - public static IStatus[] publishDelta(IModuleResourceDelta[] delta, IPath path, IProgressMonitor monitor) { - return org.eclipse.wst.server.core.util.PublishUtil.publishDelta(delta, path, monitor); - } - - /** - * Handle a delta publish. - * - * @param delta a module resource delta - * @param path the path to publish to - * @param monitor a progress monitor, or <code>null</code> if progress - * reporting and cancellation are not desired - * @return a possibly-empty array of error and warning status - */ - public static IStatus[] publishDelta(IModuleResourceDelta delta, IPath path, IProgressMonitor monitor) { - return org.eclipse.wst.server.core.util.PublishUtil.publishDelta(delta, path, monitor); - } - - /** - * Publish the given module resources to the given path. - * - * @param resources an array of module resources - * @param path a path to publish to - * @param monitor a progress monitor, or <code>null</code> if progress - * reporting and cancellation are not desired - * @return a possibly-empty array of error and warning status - */ - public static IStatus[] publishFull(IModuleResource[] resources, IPath path, IProgressMonitor monitor) { - return org.eclipse.wst.server.core.util.PublishUtil.publishFull(resources, path, monitor); - } - - /** - * Creates a new zip file containing the given module resources. Deletes the existing file - * (and doesn't create a new one) if resources is null or empty. - * - * @param resources an array of module resources - * @param path the path where the zip file should be created - * @param monitor a progress monitor, or <code>null</code> if progress - * reporting and cancellation are not desired - * @return a possibly-empty array of error and warning status - */ - public static IStatus[] publishZip(IModuleResource[] resources, IPath path, IProgressMonitor monitor) { - return org.eclipse.wst.server.core.util.PublishUtil.publishZip(resources, path, monitor); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java deleted file mode 100644 index 4b19407a8..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java +++ /dev/null @@ -1,380 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * 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.*; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.IClasspathAttribute; -import org.eclipse.jdt.core.IClasspathContainer; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jst.server.core.internal.IMemento; -import org.eclipse.jst.server.core.internal.JavaServerPlugin; -import org.eclipse.jst.server.core.internal.RuntimeClasspathContainer; -import org.eclipse.jst.server.core.internal.Trace; -import org.eclipse.jst.server.core.internal.XMLMemento; -import org.eclipse.wst.server.core.IRuntime; -/** - * A runtime classpath provider provides the classpath for a Java server runtime. - * This provider is scoped by runtime type and may provide the classpath for multiple - * runtime instances. - * <p> - * This abstract class is intended to be extended only by clients - * to extend the <code>runtimeClasspathProviders</code> extension point. - * </p> - * <p> - * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to - * change significantly before reaching stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken - * (repeatedly) as the API evolves. - * </p> - * - * @plannedfor 3.0 - */ -public abstract class RuntimeClasspathProviderDelegate { - protected class SourceAttachmentUpdate { - String runtimeId; - IPath entry; - IPath sourceAttachmentPath; - IPath sourceAttachmentRootPath; - IClasspathAttribute[] attributes; - } - - private volatile List<SourceAttachmentUpdate> sourceAttachments; - - private String extensionId; - - private Map<String, IPath> runtimePathMap = Collections.synchronizedMap(new HashMap<String, IPath>()); - - private Map<String, Integer> previousClasspath = Collections.synchronizedMap(new HashMap<String, Integer>()); - - public RuntimeClasspathProviderDelegate() { - // default constructor - } - - /** - * Initializes this classpath provider with its life-long id. - * <p> - * This method is called by the framework. - * Clients should never call this method. - * </p> - * @param id the extension id - */ - public final void initialize(String id) { - extensionId = id; - } - - /** - * Resolves (creates the classpath entries for) the classpath container with - * the given runtime and the given classpath container id (returned from - * getClasspathEntryIds()). If the classpath container cannot be resolved - * (for instance, if the runtime does not exist), return null. - * - * @param runtime the runtime to resolve the container for - * @return an array of classpath entries for the container, or null if the - * container could not be resolved - * @deprecated use resolveClasspathContainer(IProject, IRuntime) instead - */ - public IClasspathEntry[] resolveClasspathContainer(IRuntime runtime) { - return null; - } - - /** - * Resolves (creates the classpath entries for) the classpath container with - * the given runtime and the given classpath container id (returned from - * getClasspathEntryIds()). If the classpath container cannot be resolved - * (for instance, if the runtime does not exist), return null. - * - * @param project the project to resolve - * @param runtime the runtime to resolve the container for - * @return an array of classpath entries for the container, or null if the - * container could not be resolved - */ - public IClasspathEntry[] resolveClasspathContainer(IProject project, IRuntime runtime) { - return null; - } - - /** - * Resolve the classpath container. - * - * @param runtime a runtime - * @return a possibly empty array of classpath entries - * @deprecated should use resolveClasspathContainerImpl(IProject, IRuntime) instead - */ - public IClasspathEntry[] resolveClasspathContainerImpl(IRuntime runtime) { - return resolveClasspathContainerImpl(null, runtime); - } - - /** - * Resolve the classpath container. - * - * @param project a project - * @param runtime a runtime - * @return a possibly empty array of classpath entries - */ - public IClasspathEntry[] resolveClasspathContainerImpl(IProject project, IRuntime runtime) { - if (runtime == null) - return new IClasspathEntry[0]; - runtimePathMap.put(runtime.getId(), runtime.getLocation()); - IClasspathEntry[] entries = resolveClasspathContainer(project, runtime); - if (entries == null) - entries = resolveClasspathContainer(runtime); - - if (entries == null) - entries = new IClasspathEntry[0]; - - synchronized (this) { - if (sourceAttachments == null) - load(); - } - List<SourceAttachmentUpdate> srcAttachments = sourceAttachments; - - if (srcAttachments != null) { - int size = entries.length; - int size2 = srcAttachments.size(); - for (int i = 0; i < size; i++) { - for (int j = 0; j < size2; j++) { - SourceAttachmentUpdate sau = srcAttachments.get(j); - if (sau.runtimeId.equals(runtime.getId()) && sau.entry.equals(entries[i].getPath())) { - IClasspathAttribute[] consolidatedClasspathAttributes = consolidateClasspathAttributes(sau.attributes, entries[i].getExtraAttributes()); - entries[i] = JavaCore.newLibraryEntry(entries[i].getPath(), sau.sourceAttachmentPath, sau.sourceAttachmentRootPath, entries[i].getAccessRules(), consolidatedClasspathAttributes, false); - break; - } - } - } - } - - String key = project.getName() + "/" + runtime.getId(); - if (!previousClasspath.containsKey(key)) - previousClasspath.put(key, new Integer(entries.length)); - else { - Integer previousEntries = previousClasspath.get(key); - - if ((previousEntries == null) || (previousEntries.intValue() != entries.length)) { - Trace.trace(Trace.FINEST, "Classpath update: " + key + " " + entries); - previousClasspath.put(key, new Integer(entries.length)); - - IPath path = new Path(RuntimeClasspathContainer.SERVER_CONTAINER); - path = path.append(extensionId).append(runtime.getId()); - try { - IJavaProject javaProject = JavaCore.create(project); - JavaCore.setClasspathContainer(path, new IJavaProject[] { javaProject }, - new IClasspathContainer[] { null }, new NullProgressMonitor()); - } catch (Exception e) { - Trace.trace(Trace.WARNING, "Error updating classpath", e); - } - } - } - - return entries; - } - - /* - * Returns true if there are any changes in the runtime since the last time that the - * classpath was resolved which may affect the classpath, and false otherwise. This - * method is used to check projects when a runtime changes and automatically rebuild - * them if necessary. - * - * @param runtime a runtime - * @return <code>true</code> if the classpath may change due to a change in the runtime, - * and <code>false</code> if there are no changes - */ - public boolean hasRuntimeClasspathChanged(IRuntime runtime) { - try { - IPath path = runtimePathMap.get(runtime.getId()); - return (path != null && !path.equals(runtime.getLocation())); - } catch (Exception e) { - // ignore - } - return false; - } - - private static void addJarFiles(File dir, List<IClasspathEntry> list, boolean includeSubdirectories) { - int depth = 0; - if (includeSubdirectories) - depth = 2; - addJarFiles(dir, list, depth); - } - - private static void addJarFiles(File dir, List<IClasspathEntry> list, int depth) { - if (dir == null) - throw new IllegalArgumentException(); - - File[] files = dir.listFiles(); - if (files != null) { - for (File file : files) { - if (file.isDirectory() && depth > 0) { - addJarFiles(file, list, depth - 1); - } else if (file.getAbsolutePath().endsWith(".jar") || file.getAbsolutePath().endsWith(".zip")) { - IPath path = new Path(file.getAbsolutePath()); - list.add(JavaCore.newLibraryEntry(path, null, null)); - } - } - } - } - - /** - * Add library entries to the given list for every jar file found in the - * given directory. Optionally search subdirectories as well. - * - * @param list a list - * @param dir a directory - * @param includeSubdirectories <code>true</code> to include subdirectories, and - * <code>false</code> otherwise - */ - protected static void addLibraryEntries(List<IClasspathEntry> list, File dir, boolean includeSubdirectories) { - if (dir == null) - throw new IllegalArgumentException(); - addJarFiles(dir, list, includeSubdirectories); - } - - /** - * Request that the classpath container for the given runtime and id be updated - * with the given classpath container entries. - * - * @param runtime a runtime - * @param entries an array of classpath entries - */ - public void requestClasspathContainerUpdate(IRuntime runtime, IClasspathEntry[] entries) { - // default behaviour is to save the source path entries - if (runtime == null || entries == null) - return; - - // find the source attachments - List<SourceAttachmentUpdate> srcAttachments = new ArrayList<SourceAttachmentUpdate>(); - - for (IClasspathEntry entry : entries) { - if (entry.getSourceAttachmentPath() != null || (entry.getExtraAttributes() != null && entry.getExtraAttributes().length > 0)) { - SourceAttachmentUpdate sau = new SourceAttachmentUpdate(); - sau.runtimeId = runtime.getId(); - sau.entry = entry.getPath(); - sau.sourceAttachmentPath = entry.getSourceAttachmentPath(); - sau.sourceAttachmentRootPath = entry.getSourceAttachmentRootPath(); - sau.attributes = entry.getExtraAttributes(); - srcAttachments.add(sau); - } - } - sourceAttachments = srcAttachments; - save(); - } - - /** - * Load source attachment info. - */ - private void load() { - List<SourceAttachmentUpdate> srcAttachments = new ArrayList<SourceAttachmentUpdate>(); - - String id = extensionId; - String filename = JavaServerPlugin.getInstance().getStateLocation().append(id + ".xml").toOSString(); - if (!(new File(filename)).exists()) - return; - - try { - IMemento memento = XMLMemento.loadMemento(filename); - - IMemento[] children = memento.getChildren("source-attachment"); - for (IMemento child : children) { - try { - SourceAttachmentUpdate sau = new SourceAttachmentUpdate(); - sau.runtimeId = child.getString("runtime-id"); - String temp = child.getString("entry"); - if (temp != null) - sau.entry = new Path(temp); - temp = child.getString("source-attachment-path"); - if (temp != null) - sau.sourceAttachmentPath = new Path(temp); - temp = child.getString("source-attachment-root-path"); - if (temp != null) - sau.sourceAttachmentRootPath = new Path(temp); - IMemento[] attrChildren = child.getChildren("attribute"); - if (attrChildren != null) { - int size2 = attrChildren.length; - sau.attributes = new IClasspathAttribute[size2]; - for (int j = 0; j < size2; j++) { - String name = attrChildren[j].getString("name"); - String value = attrChildren[j].getString("value"); - sau.attributes[j] = JavaCore.newClasspathAttribute(name, value); - } - } - srcAttachments.add(sau); - } catch (Exception e) { - Trace.trace(Trace.WARNING, "Could not load source attachment: " + e); - } - } - } catch (Exception e) { - Trace.trace(Trace.WARNING, "Could not load source path info", e); - } - sourceAttachments = srcAttachments; - } - - /** - * Save source attachment info. - */ - private synchronized void save() { - List<SourceAttachmentUpdate> srcAttachments = sourceAttachments; - if (srcAttachments == null) - return; - String id = extensionId; - String filename = JavaServerPlugin.getInstance().getStateLocation().append(id + ".xml").toOSString(); - try { - XMLMemento memento = XMLMemento.createWriteRoot("classpath"); - - Iterator iterator = srcAttachments.iterator(); - while (iterator.hasNext()) { - SourceAttachmentUpdate sau = (SourceAttachmentUpdate) iterator.next(); - IMemento child = memento.createChild("source-attachment"); - child.putString("runtime-id", sau.runtimeId); - if (sau.entry != null) - child.putString("entry", sau.entry.toPortableString()); - if (sau.sourceAttachmentPath != null) - child.putString("source-attachment-path", sau.sourceAttachmentPath.toPortableString()); - if (sau.sourceAttachmentRootPath != null) - child.putString("source-attachment-root-path", sau.sourceAttachmentRootPath.toPortableString()); - if (sau.attributes != null) { - for (IClasspathAttribute attr : sau.attributes) { - IMemento attrChild = child.createChild("attribute"); - attrChild.putString("name", attr.getName()); - attrChild.putString("value", attr.getValue()); - } - } - } - - memento.saveToFile(filename); - } catch (Exception e) { - Trace.trace(Trace.SEVERE, "Error saving source path info", e); - } - } - - public IClasspathAttribute[] consolidateClasspathAttributes(IClasspathAttribute[] sourceAttachmentAttributes, IClasspathAttribute[] classpathEntryAttributes) { - List classpathAttributeList = new ArrayList(); - classpathAttributeList.addAll(Arrays.asList(sourceAttachmentAttributes)); - for (int i = 0; i < classpathEntryAttributes.length; i++) { - boolean attributeCollision = false; - for (int j = 0; j < sourceAttachmentAttributes.length; j++) { - String name = classpathEntryAttributes[i].getName(); - if(name != null && name.equals(sourceAttachmentAttributes[j].getName())) { - attributeCollision = true; - break; - } - } - if(!attributeCollision) { - classpathAttributeList.add(classpathEntryAttributes[i]); - } - } - return (IClasspathAttribute[]) classpathAttributeList.toArray(new IClasspathAttribute[classpathAttributeList.size()]); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ServerProfilerDelegate.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ServerProfilerDelegate.java deleted file mode 100644 index 86f0dc8dd..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ServerProfilerDelegate.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.jdt.launching.IVMInstall; -import org.eclipse.jdt.launching.VMRunnerConfiguration; -import org.eclipse.jst.server.core.internal.JavaServerPlugin; -/** - * A server profiler delegate. - * <p> - * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to - * change significantly before reaching stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken - * (repeatedly) as the API evolves. - * </p> - */ -public abstract class ServerProfilerDelegate { - /** - * Create a new server profiler delegate. This class must have a public default constructor. - */ - public ServerProfilerDelegate() { - // ignore - } - - /** - * Processes the Java launch configuration about to be run to support profiling. - * VM args or environment variables can be set to allow profiling. - * - * @param launch the launch - * @param vmInstall the vm install being run against - * @param vmConfig the configuration to process - * @param monitor a progress monitor - * @throws CoreException if there is a problem during configuration - */ - public abstract void process(ILaunch launch, IVMInstall vmInstall, VMRunnerConfiguration vmConfig, IProgressMonitor monitor) throws CoreException; - - /** - * Processes the Java launch configuration about to be run to support profiling. - * VM args or environment variables can be set to allow profiling. - * - * @param launch the launch - * @param vmInstall the vm install being run against - * @param vmConfig the configuration to process - * @param monitor a progress monitor - * @throws CoreException if there are no profilers configured or there is a problem - * configuring the launch - */ - public static void configureProfiling(ILaunch launch, IVMInstall vmInstall, VMRunnerConfiguration vmConfig, IProgressMonitor monitor) throws CoreException { - JavaServerPlugin.configureProfiling(launch, vmInstall, vmConfig, monitor); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/Servlet.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/Servlet.java deleted file mode 100644 index b3cc4dcae..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/Servlet.java +++ /dev/null @@ -1,106 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core; - -import org.eclipse.jst.server.core.internal.Messages; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.server.core.IModule; -import org.eclipse.wst.server.core.model.ModuleArtifactDelegate; -/** - * A J2EE Servlet. - * <p> - * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to - * change significantly before reaching stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken - * (repeatedly) as the API evolves. - * </p> - * @plannedfor 3.0 - */ -public class Servlet extends ModuleArtifactDelegate { - private String className; - private String alias; - - /** - * Create a reference to a servlet. - * - * @param module the module that the servlet is contained in - * @param className the class name of the servlet - * @param alias the servlet's alias - */ - public Servlet(IModule module, String className, String alias) { - super(module); - this.className = className; - this.alias = alias; - } - - /** - * Create a new empty servlet. - */ - public Servlet() { - super(); - } - - /** - * Return the class name of the servlet. - * - * @return the class name of the servlet - */ - public String getServletClassName() { - return className; - } - - /** - * Return the servlet's alias. - * - * @return the servlet's alias - */ - public String getAlias() { - return alias; - } - - /* - * @see ModuleArtifactDelegate#getName() - */ - public String getName() { - return NLS.bind(Messages.artifactServlet, className); - } - - /* - * @see ModuleArtifactDelegate#deserialize(String) - */ - public void deserialize(String s) { - int ind = s.indexOf("//"); - super.deserialize(s.substring(0, ind)); - s = s.substring(ind+2); - ind = s.indexOf("//"); - className = s.substring(0, ind); - alias = s.substring(ind+2); - } - - /* - * @see ModuleArtifactDelegate#serialize() - */ - public String serialize() { - StringBuffer sb = new StringBuffer(super.serialize()); - sb.append("//"); - sb.append(className); - sb.append("//"); - sb.append(alias); - return sb.toString(); - } - - /** - * @see Object#toString() - */ - public String toString() { - return "Servlet [module=" + getModule() + ", class=" + className + ", alias=" + alias + "]"; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntime.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntime.java deleted file mode 100644 index 264fcaa1d..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntime.java +++ /dev/null @@ -1,111 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import org.eclipse.core.runtime.*; -import org.eclipse.jdt.launching.IVMInstall; -import org.eclipse.jdt.launching.IVMInstallType; -import org.eclipse.jdt.launching.JavaRuntime; -import org.eclipse.wst.server.core.IRuntime; -import org.eclipse.wst.server.core.model.RuntimeDelegate; -/** - * - */ -public class GenericRuntime extends RuntimeDelegate implements IGenericRuntime, IGenericRuntimeWorkingCopy { - protected static final String PROP_VM_INSTALL_TYPE_ID = "vm-install-type-id"; - protected static final String PROP_VM_INSTALL_ID = "vm-install-id"; - - /** - * Create a new generic runtime. - */ - public GenericRuntime() { - // do nothing - } - - protected String getVMInstallTypeId() { - return getAttribute(PROP_VM_INSTALL_TYPE_ID, (String)null); - } - - protected String getVMInstallId() { - return getAttribute(PROP_VM_INSTALL_ID, (String)null); - } - - /** - * Returns <code>true</code> if the runtime is using the default JRE. - * - * @return <code>true</code> if the runtime is using the default JRE, - * and <code>false</code> otherwise - */ - public boolean isUsingDefaultJRE() { - return getVMInstallTypeId() == null; - } - - /** - * @see IGenericRuntime#getVMInstall() - */ - public IVMInstall getVMInstall() { - if (getVMInstallTypeId() == null) - return JavaRuntime.getDefaultVMInstall(); - try { - IVMInstallType vmInstallType = JavaRuntime.getVMInstallType(getVMInstallTypeId()); - IVMInstall[] vmInstalls = vmInstallType.getVMInstalls(); - String id = getVMInstallId(); - for (IVMInstall vmInst : vmInstalls) { - if (id.equals(vmInst.getId())) - return vmInst; - } - } catch (Exception e) { - // ignore - } - return null; - } - - /** - * @see RuntimeDelegate#validate() - */ - public IStatus validate() { - IStatus status = super.validate(); - if (!status.isOK()) - return status; - - IRuntime runtime = getRuntime(); - - IPath path = runtime.getLocation(); - if (!path.toFile().exists()) - return new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, Messages.errorLocation, null); - else if (getVMInstall() == null) - return new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, Messages.errorJRE, null); - else - return Status.OK_STATUS; - } - - /** - * @see IGenericRuntimeWorkingCopy#setVMInstall(IVMInstall) - */ - public void setVMInstall(IVMInstall vmInstall) { - if (vmInstall == null) { - setVMInstall(null, null); - } else - setVMInstall(vmInstall.getVMInstallType().getId(), vmInstall.getId()); - } - - protected void setVMInstall(String typeId, String id) { - if (typeId == null) - setAttribute(PROP_VM_INSTALL_TYPE_ID, (String)null); - else - setAttribute(PROP_VM_INSTALL_TYPE_ID, typeId); - - if (id == null) - setAttribute(PROP_VM_INSTALL_ID, (String)null); - else - setAttribute(PROP_VM_INSTALL_ID, id); - } -} diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeClasspathProvider.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeClasspathProvider.java deleted file mode 100644 index 862bb642e..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeClasspathProvider.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate; - -import org.eclipse.wst.server.core.IRuntime; -/** - * - */ -public class GenericRuntimeClasspathProvider extends RuntimeClasspathProviderDelegate { - /** (non-Javadoc) - * @see RuntimeClasspathProviderDelegate#resolveClasspathContainer(IProject, IRuntime) - */ - public IClasspathEntry[] resolveClasspathContainer(IProject project, IRuntime runtime) { - IPath installPath = runtime.getLocation(); - - if (installPath == null) - return new IClasspathEntry[0]; - - List<IClasspathEntry> list = new ArrayList<IClasspathEntry>(); - addLibraryEntries(list, installPath.toFile(), false); - return list.toArray(new IClasspathEntry[list.size()]); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeUtil.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeUtil.java deleted file mode 100644 index d5fbb11ea..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeUtil.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import org.eclipse.wst.server.core.IRuntime; -/** - * Utility methods for the generic J2EE runtime. - */ -public class GenericRuntimeUtil { - protected static final String RUNTIME_TYPE_ID = "org.eclipse.jst.server.core.runtimeType"; - - /** - * Cannot create GenericRuntimeUtil - use static methods. - */ - private GenericRuntimeUtil() { - // can't create - } - - /** - * Returns <code>true</code> if the given runtime is a generic J2EE runtime, and - * <code>false</code> otherwise. The runtime may not be null. - * - * @param runtime - * @return <code>true</code> if - */ - public static boolean isGenericJ2EERuntime(IRuntime runtime) { - if (runtime == null) - throw new IllegalArgumentException(); - - return (runtime.getRuntimeType() != null && - runtime.getRuntimeType().getId().startsWith(RUNTIME_TYPE_ID)); - } -} diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntime.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntime.java deleted file mode 100644 index 9a4bd3156..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntime.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import org.eclipse.jst.server.core.IJavaRuntime; -/** - * - */ -public interface IGenericRuntime extends IJavaRuntime { - // no additional methods -} diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntimeWorkingCopy.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntimeWorkingCopy.java deleted file mode 100644 index 36c19659a..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntimeWorkingCopy.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import org.eclipse.jst.server.core.IJavaRuntimeWorkingCopy; -/** - * - */ -public interface IGenericRuntimeWorkingCopy extends IGenericRuntime, IJavaRuntimeWorkingCopy { - // no new methods -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IMemento.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IMemento.java deleted file mode 100644 index 8c0d1f1d3..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IMemento.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; -/** - * Interface to a memento used for saving the important state of an object - * in a form that can be persisted in the file system. - * <p> - * Mementos were designed with the following requirements in mind: - * <ol> - * <li>Certain objects need to be saved and restored across platform sessions. - * </li> - * <li>When an object is restored, an appropriate class for an object might not - * be available. It must be possible to skip an object in this case.</li> - * <li>When an object is restored, the appropriate class for the object may be - * different from the one when the object was originally saved. If so, the - * new class should still be able to read the old form of the data.</li> - * </ol> - * </p> - * <p> - * Mementos meet these requirements by providing support for storing a - * mapping of arbitrary string keys to primitive values, and by allowing - * mementos to have other mementos as children (arranged into a tree). - * A robust external storage format based on XML is used. - * </p><p> - * The key for an attribute may be any alpha numeric value. However, the - * value of <code>TAG_ID</code> is reserved for internal use. - * </p><p> - * This interface is not intended to be implemented by clients. - * </p> - */ -public interface IMemento { - /** - * Creates a new child of this memento with the given type. - * <p> - * The <code>getChild</code> and <code>getChildren</code> methods - * are used to retrieve children of a given type. - * </p> - * - * @param type the type - * @return a new child memento - * @see #getChild - * @see #getChildren - */ - public IMemento createChild(String type); - - /** - * Returns the first child with the given type id. - * - * @param type the type id - * @return the first child with the given type - */ - public IMemento getChild(String type); - - /** - * Returns all children with the given type id. - * - * @param type the type id - * @return the list of children with the given type - */ - public IMemento[] getChildren(String type); - - /** - * Returns the string value of the given key. - * - * @param key the key - * @return the value, or <code>null</code> if the key was not found or was found - * but was not an integer - */ - public String getString(String key); - - /** - * Sets the value of the given key to the given string. - * - * @param key the key - * @param value the value - */ - public void putString(String key, String value); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EELaunchableClient.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EELaunchableClient.java deleted file mode 100644 index a3fa50b62..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EELaunchableClient.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.jst.server.core.JndiLaunchable; -import org.eclipse.wst.server.core.IServer; -import org.eclipse.wst.server.core.model.ClientDelegate; -/** - * - */ -public class J2EELaunchableClient extends ClientDelegate { - /* - * @see ClientDelegate#supports(ILaunchable) - */ - public boolean supports(IServer server, Object launchable, String launchMode) { - return (launchable instanceof JndiLaunchable); - } - - /* - * @see ClientDelegate#launch(ILaunchable) - */ - public IStatus launch(IServer server, Object launchable, String launchMode, ILaunch launch) { - Trace.trace(Trace.FINEST, "JNDI client launched"); - return null; - } -} diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EEUtil.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EEUtil.java deleted file mode 100644 index 2bbf8e975..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EEUtil.java +++ /dev/null @@ -1,214 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jst.server.core.IEnterpriseApplication; -import org.eclipse.jst.server.core.IJ2EEModule; -import org.eclipse.jst.server.core.IWebModule; -import org.eclipse.wst.server.core.IModule; -import org.eclipse.wst.server.core.ServerUtil; -/** - * Utility class for dealing with J2EE modules. - */ -public class J2EEUtil { - private static final String EAR_MODULE = "jst.ear"; - private static final String WEB_MODULE = "jst.web"; - - private static final IModule[] EMPTY_LIST = new IModule[0]; - private static Map<IModule, List<IModule>> earCache; - private static Map<IJ2EEModule, List<IModule>> earCache2; - private static Map<IModule, List<IModule>> webCache; - protected static String cache; - - /** - * Returns the enterprise applications that the module is contained within. - * - * @param module a J2EE module - * @param monitor a progress monitor, or <code>null</code> if progress - * reporting and cancellation are not desired - * @return a possibly empty array of enterprise applications - */ - public static IModule[] getEnterpriseApplications(IJ2EEModule module, IProgressMonitor monitor) { - if (shouldUseCache()) { - List<IModule> list = earCache2.get(module); - if (list == null) - return EMPTY_LIST; - return list.toArray(new IModule[list.size()]); - } - - List<IModule> list = new ArrayList<IModule>(); - IModule[] modules = ServerUtil.getModules(EAR_MODULE); - if (modules != null) { - for (IModule module2 : modules) { - IEnterpriseApplication ear = (IEnterpriseApplication) module2.loadAdapter(IEnterpriseApplication.class, monitor); - if (ear != null) { - IModule[] modules2 = ear.getModules(); - if (modules2 != null) { - for (IModule m : modules2) { - if (module.equals(m.loadAdapter(IJ2EEModule.class, monitor))) - list.add(module2); - } - } - } - } - } - - return list.toArray(new IModule[list.size()]); - } - - /** - * Returns the enterprise applications that the module is contained within. - * - * @param module a J2EE module or utility module - * @param monitor a progress monitor, or <code>null</code> if progress - * reporting and cancellation are not desired - * @return a possibly empty array of enterprise applications - */ - public static IModule[] getEnterpriseApplications(IModule module, IProgressMonitor monitor) { - if (shouldUseCache()) { - List<IModule> list = earCache.get(module); - if (list == null) - return EMPTY_LIST; - return list.toArray(new IModule[list.size()]); - } - - List<IModule> list = new ArrayList<IModule>(); - IModule[] modules = ServerUtil.getModules(EAR_MODULE); - if (modules != null) { - for (IModule module2 : modules) { - IEnterpriseApplication ear = (IEnterpriseApplication) module2.loadAdapter(IEnterpriseApplication.class, monitor); - if (ear != null) { - IModule[] modules2 = ear.getModules(); - if (modules2 != null) { - for (IModule m : modules2) { - if (module.equals(m)) - list.add(module2); - } - } - } - } - } - - return list.toArray(new IModule[list.size()]); - } - - /** - * Returns the web modules that the utility module is contained within. - * - * @param module a utility module - * @param monitor a progress monitor, or <code>null</code> if progress - * reporting and cancellation are not desired - * @return a possibly empty array of web modules - */ - public static IModule[] getWebModules(IModule module, IProgressMonitor monitor) { - if (shouldUseCache()) { - List<IModule> list = webCache.get(module); - if (list == null) - return EMPTY_LIST; - return list.toArray(new IModule[list.size()]); - } - - List<IModule> list = new ArrayList<IModule>(); - IModule[] modules = ServerUtil.getModules(WEB_MODULE); - if (modules != null) { - for (IModule module2 : modules) { - IWebModule web = (IWebModule) module2.loadAdapter(IWebModule.class, monitor); - if (web != null) { - IModule[] modules2 = web.getModules(); - if (modules2 != null) { - for (IModule m : modules2) { - if (module.equals(m)) - list.add(module2); - } - } - } - } - } - - return list.toArray(new IModule[list.size()]); - } - - private static void fillCache(IProgressMonitor monitor) { - earCache = new HashMap<IModule, List<IModule>>(); - earCache2 = new HashMap<IJ2EEModule, List<IModule>>(); - webCache = new HashMap<IModule, List<IModule>>(); - - IModule[] modules = ServerUtil.getModules(EAR_MODULE); - if (modules != null) { - for (IModule module2 : modules) { - IEnterpriseApplication ear = (IEnterpriseApplication) module2.loadAdapter(IEnterpriseApplication.class, monitor); - if (ear != null) { - IModule[] modules2 = ear.getModules(); - if (modules2 != null) { - for (IModule mm : modules2) { - List<IModule> m = earCache.get(mm); - if (m == null) { - m = new ArrayList<IModule>(2); - earCache.put(mm, m); - } - m.add(module2); - - IJ2EEModule mod = (IJ2EEModule) mm.loadAdapter(IJ2EEModule.class, monitor); - if (mod != null) { - m = earCache2.get(mod); - if (m == null) { - m = new ArrayList<IModule>(2); - earCache2.put(mod, m); - } - m.add(module2); - } - } - } - } - } - } - - modules = ServerUtil.getModules(WEB_MODULE); - if (modules != null) { - for (IModule module2 : modules) { - IWebModule web = (IWebModule) module2.loadAdapter(IWebModule.class, monitor); - if (web != null) { - IModule[] modules2 = web.getModules(); - if (modules2 != null) { - for (IModule mm : modules2) { - List<IModule> m = webCache.get(mm); - if (m == null) { - m = new ArrayList<IModule>(2); - webCache.put(mm, m); - } - m.add(module2); - } - } - } - } - } - } - - private static boolean shouldUseCache() { - String s = System.getProperty("J2EEcache"); - if (s == null || "".equals(s) || "false".equals(s)) { - webCache = null; - earCache = null; - return false; - } - if (cache == null || !cache.equals(s)) { - cache = s; - fillCache(null); - } - return true; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JRERuntimeComponentProvider.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JRERuntimeComponentProvider.java deleted file mode 100644 index 89afad8e7..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JRERuntimeComponentProvider.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007,2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import java.util.Collections; -import java.util.List; - -import org.eclipse.jdt.launching.IVMInstall; -import org.eclipse.jst.common.project.facet.core.StandardJreRuntimeComponent; -import org.eclipse.jst.server.core.IJavaRuntime; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent; -import org.eclipse.wst.server.core.IRuntime; - -public class JRERuntimeComponentProvider extends RuntimeComponentProviderDelegate { - - public List<IRuntimeComponent> getRuntimeComponents(IRuntime runtime) { - // define JRE component - IJavaRuntime javaRuntime = (IJavaRuntime) runtime.loadAdapter(IJavaRuntime.class, null); - if (javaRuntime != null) { - final IVMInstall vmInstall = javaRuntime.getVMInstall(); - final IRuntimeComponent rc = StandardJreRuntimeComponent.create( vmInstall ); - return Collections.singletonList( rc ); - } - return null; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JavaServerPlugin.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JavaServerPlugin.java deleted file mode 100644 index b170ebb0f..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JavaServerPlugin.java +++ /dev/null @@ -1,385 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2009 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.*; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.jdt.core.IClasspathContainer; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.launching.IVMInstall; -import org.eclipse.jdt.launching.VMRunnerConfiguration; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.server.core.IRuntime; -import org.eclipse.wst.server.core.IRuntimeLifecycleListener; -import org.eclipse.wst.server.core.IRuntimeType; -import org.eclipse.wst.server.core.ServerCore; -import org.eclipse.wst.server.core.ServerUtil; -import org.osgi.framework.BundleContext; -/** - * The main server tooling plugin class. - */ -public class JavaServerPlugin extends Plugin { - /** - * Java server plugin id - */ - public static final String PLUGIN_ID = "org.eclipse.jst.server.core"; - - // singleton instance of this class - private static JavaServerPlugin singleton; - - // cached copy of all runtime classpath providers - private static List<RuntimeClasspathProviderWrapper> runtimeClasspathProviders; - - // cached copy of all server profilers - private static List<ServerProfiler> serverProfilers; - - // runtime listener - private static IRuntimeLifecycleListener runtimeListener; - - /** - * Create the JavaServerPlugin. - */ - public JavaServerPlugin() { - super(); - singleton = this; - } - - /** - * Returns the singleton instance of this plugin. - * - * @return a singleton instance - */ - public static JavaServerPlugin getInstance() { - return singleton; - } - - /** - * @see Plugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - - runtimeListener = new IRuntimeLifecycleListener() { - public void runtimeAdded(IRuntime runtime) { - handleRuntimeChange(runtime, 0); - } - - public void runtimeChanged(IRuntime runtime) { - handleRuntimeChange(runtime, 1); - } - - public void runtimeRemoved(IRuntime runtime) { - handleRuntimeChange(runtime, 2); - } - }; - - ServerCore.addRuntimeLifecycleListener(runtimeListener); - } - - /** - * @see Plugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context2) throws Exception { - ServerCore.removeRuntimeLifecycleListener(runtimeListener); - super.stop(context2); - } - - /** - * Handle a runtime change by potentially updating the classpath container. - * - * @param runtime a runtime - */ - protected void handleRuntimeChange(final IRuntime runtime, final int act) { - if (runtime == null) - throw new IllegalArgumentException(); - - Trace.trace(Trace.FINEST, "Possible runtime change: " + runtime); - - if (runtime.getRuntimeType() == null) - return; - - final RuntimeClasspathProviderWrapper rcpw = findRuntimeClasspathProvider(runtime.getRuntimeType()); - if (rcpw != null && (rcpw.hasRuntimeClasspathChanged(runtime) || act != 1)) { - final IPath serverContainerPath = new Path(RuntimeClasspathContainer.SERVER_CONTAINER) - .append(rcpw.getId()).append(runtime.getId()); - - class RebuildRuntimeReferencesJob extends Job { - public RebuildRuntimeReferencesJob() { - super(NLS.bind(Messages.updateClasspathContainers, runtime.getName())); - } - - public boolean belongsTo(Object family) { - return ServerUtil.SERVER_JOB_FAMILY.equals(family); - } - - public IStatus run(IProgressMonitor monitor) { - IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); - if (projects != null) { - for (IProject project : projects) { - if (project.isAccessible()) { - try { - if (!project.isNatureEnabled(JavaCore.NATURE_ID)) - continue; - - IJavaProject javaProject = JavaCore.create(project); - - boolean found = false; - IClasspathEntry[] ce = javaProject.getRawClasspath(); - for (IClasspathEntry cp : ce) { - if (cp.getEntryKind() == IClasspathEntry.CPE_CONTAINER) { - if (serverContainerPath.isPrefixOf(cp.getPath())) - found = true; - } - } - - Trace.trace(Trace.FINEST, "Classpath change on: " + project + " " + found); - - if (found) { - IRuntime runtime2 = runtime; - if (act == 2) - runtime2 = null; - RuntimeClasspathContainer container = new RuntimeClasspathContainer(project, - serverContainerPath, rcpw, runtime2, runtime.getId()); - JavaCore.setClasspathContainer(serverContainerPath, new IJavaProject[] { javaProject }, - new IClasspathContainer[] {container}, null); - } - } catch (Exception e) { - Trace.trace(Trace.SEVERE, "Could not update classpath container", e); - } - } - } - } - - return Status.OK_STATUS; - } - } - RebuildRuntimeReferencesJob job = new RebuildRuntimeReferencesJob(); - job.schedule(); - } - } - - /** - * Convenience method for logging. - * - * @param status a status - */ - private static void log(IStatus status) { - getInstance().getLog().log(status); - } - - public static void logWarning(String msg) { - log(new Status(IStatus.WARNING, PLUGIN_ID, IStatus.OK, msg, null)); - } - - /** - * Returns an array of all known runtime classpath provider instances. - * <p> - * A new array is returned on each call, so clients may store or modify the - * result. - * </p> - * - * @return a possibly-empty array of runtime classpath provider instances - * {@link RuntimeClasspathProviderWrapper} - */ - public static RuntimeClasspathProviderWrapper[] getRuntimeClasspathProviders() { - if (runtimeClasspathProviders == null) - loadRuntimeClasspathProviders(); - - RuntimeClasspathProviderWrapper[] rth = new RuntimeClasspathProviderWrapper[runtimeClasspathProviders.size()]; - runtimeClasspathProviders.toArray(rth); - return rth; - } - - /** - * Returns the runtime classpath provider that supports the given runtime type, or <code>null</code> - * if none. This convenience method searches the list of known runtime - * classpath providers ({@link #getRuntimeClasspathProviders()}) for the one with - * a matching runtime type. - * The runtimeType may not be null. - * - * @param runtimeType a runtime type - * @return the runtime classpath provider instance, or <code>null</code> if - * there is no runtime classpath provider that supports the given id - */ - public static RuntimeClasspathProviderWrapper findRuntimeClasspathProvider(IRuntimeType runtimeType) { - if (runtimeType == null) - throw new IllegalArgumentException(); - - if (runtimeClasspathProviders == null) - loadRuntimeClasspathProviders(); - - Iterator iterator = runtimeClasspathProviders.iterator(); - while (iterator.hasNext()) { - RuntimeClasspathProviderWrapper runtimeClasspathProvider = (RuntimeClasspathProviderWrapper) iterator.next(); - if (runtimeClasspathProvider.supportsRuntimeType(runtimeType)) - return runtimeClasspathProvider; - } - return null; - } - - /** - * Returns the runtime classpath provider that supports the given runtime type id, - * or <code>null</code> if none. This convenience method searches the list of known - * runtime classpath providers ({@link #getRuntimeClasspathProviders()}) for the one - * with a matching runtime type id. The id may not be null. - * - * @param id a runtime type id - * @return the runtime classpath provider instance, or <code>null</code> if - * there is no runtime classpath provider that supports the given id - */ - public static RuntimeClasspathProviderWrapper findRuntimeClasspathProviderBySupport(String id) { - if (id == null) - throw new IllegalArgumentException(); - - if (runtimeClasspathProviders == null) - loadRuntimeClasspathProviders(); - - Iterator iterator = runtimeClasspathProviders.iterator(); - while (iterator.hasNext()) { - RuntimeClasspathProviderWrapper runtimeClasspathProvider = (RuntimeClasspathProviderWrapper) iterator.next(); - if (runtimeClasspathProvider.supportsRuntimeType(id)) - return runtimeClasspathProvider; - } - return null; - } - - /** - * Returns the runtime classpath provider with the given id, or <code>null</code> - * if none. This convenience method searches the list of known runtime - * classpath providers ({@link #getRuntimeClasspathProviders()}) for the one with - * a matching runtime classpath provider id ({@link RuntimeClasspathProviderWrapper#getId()}). - * The id may not be null. - * - * @param id the runtime classpath provider id - * @return the runtime classpath provider instance, or <code>null</code> if - * there is no runtime classpath provider with the given id - */ - public static RuntimeClasspathProviderWrapper findRuntimeClasspathProvider(String id) { - if (id == null) - throw new IllegalArgumentException(); - - if (runtimeClasspathProviders == null) - loadRuntimeClasspathProviders(); - - Iterator iterator = runtimeClasspathProviders.iterator(); - while (iterator.hasNext()) { - RuntimeClasspathProviderWrapper runtimeClasspathProvider = (RuntimeClasspathProviderWrapper) iterator.next(); - if (id.equals(runtimeClasspathProvider.getId())) - return runtimeClasspathProvider; - } - return null; - } - - /** - * Load the runtime classpath providers. - */ - private static synchronized void loadRuntimeClasspathProviders() { - if (runtimeClasspathProviders != null) - return; - Trace.trace(Trace.CONFIG, "->- Loading .runtimeClasspathProviders extension point ->-"); - IExtensionRegistry registry = Platform.getExtensionRegistry(); - IConfigurationElement[] cf = registry.getConfigurationElementsFor(JavaServerPlugin.PLUGIN_ID, "runtimeClasspathProviders"); - - List<RuntimeClasspathProviderWrapper> list = new ArrayList<RuntimeClasspathProviderWrapper>(cf.length); - for (IConfigurationElement ce : cf) { - try { - list.add(new RuntimeClasspathProviderWrapper(ce)); - Trace.trace(Trace.CONFIG, " Loaded runtimeClasspathProviders: " + ce.getAttribute("id")); - } catch (Throwable t) { - Trace.trace(Trace.SEVERE, " Could not load runtimeClasspathProviders: " + ce.getAttribute("id"), t); - } - } - runtimeClasspathProviders = list; - - Trace.trace(Trace.CONFIG, "-<- Done loading .runtimeClasspathProviders extension point -<-"); - } - - /** - * Returns an array of all known server profiler instances. - * <p> - * A new array is returned on each call, so clients may store or modify the result. - * </p> - * - * @return a possibly-empty array of server profiler instances - * {@link ServerProfiler} - */ - public static ServerProfiler[] getServerProfilers() { - if (serverProfilers == null) - loadServerProfilers(); - - ServerProfiler[] sp = new ServerProfiler[serverProfilers.size()]; - serverProfilers.toArray(sp); - return sp; - } - - /** - * Load the server profilers. - */ - private static synchronized void loadServerProfilers() { - if (serverProfilers != null) - return; - Trace.trace(Trace.CONFIG, "->- Loading .serverProfilers extension point ->-"); - IExtensionRegistry registry = Platform.getExtensionRegistry(); - IConfigurationElement[] cf = registry.getConfigurationElementsFor(JavaServerPlugin.PLUGIN_ID, "serverProfilers"); - - List<ServerProfiler> list = new ArrayList<ServerProfiler>(cf.length); - for (IConfigurationElement ce : cf) { - try { - list.add(new ServerProfiler(ce)); - Trace.trace(Trace.CONFIG, " Loaded serverProfiler: " + ce.getAttribute("id")); - } catch (Throwable t) { - Trace.trace(Trace.SEVERE, " Could not load serverProfiler: " + ce.getAttribute("id"), t); - } - } - serverProfilers = list; - - Trace.trace(Trace.CONFIG, "-<- Done loading .serverProfilers extension point -<-"); - } - - public static void configureProfiling(ILaunch launch, IVMInstall vmInstall, VMRunnerConfiguration vmConfig, IProgressMonitor monitor) throws CoreException { - ServerProfiler[] sp = JavaServerPlugin.getServerProfilers(); - if (sp == null || sp.length == 0) - throw new CoreException(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, Messages.errorNoProfiler, null)); - - String id = ProfilerPreferences.getInstance().getServerProfilerId(); - if ( id != null ) { - for ( int i = 0; i < sp.length; i++ ) { - if ( sp[i].getId().equals(id) ) { - sp[i].process(launch, vmInstall, vmConfig, monitor); - return; - } - } - } else { - if ( sp.length == 1 ) { - /* The user has not selected a profiler preference, but there is only one - * registered so we can just call that - */ - sp[0].process(launch, vmInstall, vmConfig, monitor); - } else { - /* We have more than one profiler registered, but the user has not yet - * configured their preference so we don't know which one to call. Throw - * an exception and notify the user must configure the profiler - * before continuing. */ - throw new CoreException(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, - Messages.noProfilersSelected, null)); - } - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/LaunchConfigurationUtil.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/LaunchConfigurationUtil.java deleted file mode 100644 index 2ffe1686a..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/LaunchConfigurationUtil.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; -/** - * - */ -public class LaunchConfigurationUtil { - /** - * Gets the classpath from the launch configuration of the given server. - * If create is false, it will return null if there is no launch configuration - * (i.e. the server has not been run before) If create is true, it will create - * a launch configuration if one does not exist. - * - * @param server - * @param create - * @param monitor a progress monitor - * @return an array containing runtime classpath entries - * @throws CoreException - */ - /*public static IRuntimeClasspathEntry[] getClasspath(IServer server, boolean create, IProgressMonitor monitor) throws CoreException { - ILaunchConfiguration config = server.getLaunchConfiguration(create, monitor); - if (config == null) - return null; - - return JavaRuntime.computeUnresolvedRuntimeClasspath(config); - }*/ - - /** - * Sets the classpath on the given server's launch configuration. - * - * @param server - * @param classpath - * @throws CoreException - */ - /*public static void setClasspath(IServer server, IRuntimeClasspathEntry[] classpath, IProgressMonitor monitor) throws CoreException { - ILaunchConfiguration config = server.getLaunchConfiguration(true, monitor); - ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy(); - wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false); - - List mementos = new ArrayList(classpath.length); - for (int i = 0; i < classpath.length; i++) { - IRuntimeClasspathEntry entry = classpath[i]; - mementos.add(entry.getMemento()); - } - wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, mementos); - wc.doSave(); - }*/ -} diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.java deleted file mode 100644 index 2230290e2..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import org.eclipse.osgi.util.NLS; -/** - * Translated messages. - */ -public class Messages extends NLS { - public static String errorLocation; - public static String errorJRE; - public static String classpathContainerDescription; - public static String classpathContainer; - public static String classpathContainerUnbound; - - public static String copyingTask; - public static String deletingTask; - public static String errorCopyingFile; - public static String errorCreatingZipFile; - public static String errorDelete; - public static String errorRename; - public static String errorReading; - public static String updateClasspathContainers; - public static String errorNoRuntime; - public static String errorFacet; - public static String errorDeleting; - public static String errorNotADirectory; - public static String errorMkdir; - - public static String artifactServlet; - public static String artifactEJB; - public static String artifactJNDI; - - public static String canModifyModules; - public static String errorNoProfiler; - public static String errorPublish; - public static String httpPort; - public static String errorPortInUse; - - public static String noProfilersSelected; - - static { - NLS.initializeMessages(JavaServerPlugin.PLUGIN_ID + ".internal.Messages", Messages.class); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.properties b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.properties deleted file mode 100644 index b6169140b..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.properties +++ /dev/null @@ -1,45 +0,0 @@ -############################################################################### -# Copyright (c) 2004, 2009 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### - -classpathContainerDescription=Server Library -classpathContainer={0} [{1}] -classpathContainerUnbound={0} [{1}] (unbound) - -errorLocation=Invalid location. -errorJRE=Invalid JRE. - -copyingTask=Copying from {0} to {1} -deletingTask=Deleting {0} -errorCopyingFile=Error copying file {0}: {1} -errorCreatingZipFile=Error creating zip file {0}: {1} -errorDelete=Could not delete previous copy, which may be locked by another process. -errorRename=Could not replace with temp file {0}. -errorReading=Error reading file {0} -errorNoRuntime=Cannot verify facets because there is no runtime associated with the server. -errorFacet=Project facet {0} version {1} is not supported. -errorDeleting=Could not delete {0}. May be locked by another process. -errorNotADirectory=Could not delete {0} since it is not a directory. -errorMkdir=Could not create directory {0}. - -updateClasspathContainers=Updating classpath container for {0} - -artifactServlet=Servlet {0} -artifactEJB=EJB {0} -artifactJNDI=JNDI {0} - -noProfilersSelected=A Server Profiler is not selected. Please select a profiler on the Server -> Profilers page in the workbench preferences. - -canModifyModules=Web module can be added to the server. -errorNoProfiler=Could not launch in profiling mode because no profilers are configured. -errorPublish=An error occurred during publishing. -httpPort=HTTP Port -errorPortInUse=Port {0} required by {1} is already in use. The server may already be running in another process, or a system process may be using the port. \ - To start this server you will need to stop the other process or change the port number(s).
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ProfilerPreferences.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ProfilerPreferences.java deleted file mode 100644 index 32ee2fe42..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ProfilerPreferences.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.preferences.IPreferencesService; -import org.eclipse.core.runtime.preferences.InstanceScope; -import org.osgi.service.prefs.BackingStoreException; -import org.osgi.service.prefs.Preferences; - -/** - * Helper class which wraps around the preference store so that options related to - * server profilers can be persisted. - */ -public class ProfilerPreferences { - - private static ProfilerPreferences prefs = null; - private IPreferencesService prefService; - - /* The qualifier (scope) in the preference store */ - private static final String PREF_PROFILER_QUALIFIER = "org.eclipse.jst.server.core.internal.profilers"; - /* The key used to store the selected profiler preference */ - private static final String PREF_SELECTED_PROFILER = "selected-profiler"; - - - /** - * Private Constructor - This should be a singleton class - */ - private ProfilerPreferences() { - prefService = Platform.getPreferencesService(); - } - - /** - * Returns an instance of this class - * @return - */ - public static ProfilerPreferences getInstance() { - if ( prefs == null ) - prefs = new ProfilerPreferences(); - return prefs; - } - - /** - * Sets the profiler to use when profiling on server - * @param profilerId the id of the server profiler - */ - public void setServerProfilerId( String profilerId ) { - Preferences node = new InstanceScope().getNode( PREF_PROFILER_QUALIFIER ); - node.put( PREF_SELECTED_PROFILER, profilerId ); - try { - node.flush(); - } catch (BackingStoreException e) { - Trace.trace(Trace.SEVERE, "Could not save server profiler preference", e); - } - } - - /** - * Reutns the id of the current server profiler - * @return the id of the current server profiler - */ - public String getServerProfilerId() { - return prefService.getString( PREF_PROFILER_QUALIFIER, PREF_SELECTED_PROFILER, null, null ); - } - -} diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ProgressUtil.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ProgressUtil.java deleted file mode 100644 index 61d99d626..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ProgressUtil.java +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import org.eclipse.core.runtime.*; -/** - * Progress Monitor utility. - */ -public class ProgressUtil { - /** - * ProgressUtil constructor comment. - */ - private ProgressUtil() { - super(); - } - - /** - * Return a valid progress monitor. - * - * @param monitor org.eclipse.core.runtime.IProgressMonitor - * @return org.eclipse.core.runtime.IProgressMonitor - */ - public static IProgressMonitor getMonitorFor(IProgressMonitor monitor) { - if (monitor == null) - return new NullProgressMonitor(); - return monitor; - } - - /** - * Return a sub-progress monitor with the given amount on the - * current progress monitor. - * - * @param monitor org.eclipse.core.runtime.IProgressMonitor - * @param ticks int - * @return org.eclipse.core.runtime.IProgressMonitor - */ - public static IProgressMonitor getSubMonitorFor(IProgressMonitor monitor, int ticks) { - if (monitor == null) - return new NullProgressMonitor(); - if (monitor instanceof NullProgressMonitor) - return monitor; - return new SubProgressMonitor(monitor, ticks); - } - - /** - * Return a sub-progress monitor with the given amount on the - * current progress monitor. - * - * @param monitor org.eclipse.core.runtime.IProgressMonitor - * @param ticks a number of ticks - * @param style a style - * @return org.eclipse.core.runtime.IProgressMonitor - */ - public static IProgressMonitor getSubMonitorFor(IProgressMonitor monitor, int ticks, int style) { - if (monitor == null) - return new NullProgressMonitor(); - if (monitor instanceof NullProgressMonitor) - return monitor; - return new SubProgressMonitor(monitor, ticks, style); - } -} diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java deleted file mode 100644 index e76f68771..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java +++ /dev/null @@ -1,149 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2009 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import 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; -import org.eclipse.wst.server.core.ServerCore; -/** - * - */ -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; - - IRuntime curRuntime = getRuntime(); - - if (delegate != null && curRuntime != null) - entries = delegate.resolveClasspathContainerImpl(project, curRuntime); - - if (entries == null) - return new IClasspathEntry[0]; - - return entries; - } - - private IRuntime getRuntime(){ - if (runtime == null && runtimeId != null) { - // Make sure the runtime object is initialized. - runtime = ServerCore.findRuntime(runtimeId); - } - return runtime; - } - - /** (non-Javadoc) - * @see org.eclipse.jdt.core.IClasspathContainer#getDescription() - */ - public String getDescription() { - IRuntime curRuntime = getRuntime(); - - if (curRuntime != null) { - IRuntimeType runtimeType = curRuntime.getRuntimeType(); - if (runtimeType != null) - return NLS.bind(Messages.classpathContainer, runtimeType.getName(), curRuntime.getName()); - } - return NLS.bind(Messages.classpathContainerUnbound, Messages.classpathContainerDescription, runtimeId); - } - - /** (non-Javadoc) - * @see org.eclipse.jdt.core.IClasspathContainer#getKind() - */ - public int getKind() { - return IClasspathContainer.K_APPLICATION; - } - - /** (non-Javadoc) - * @see org.eclipse.jdt.core.IClasspathContainer#getPath() - */ - public IPath getPath() { - return path; - } - - public boolean equals(Object obj) { - if (!(obj instanceof RuntimeClasspathContainer)) - return false; - - RuntimeClasspathContainer rcc = (RuntimeClasspathContainer) obj; - if (delegate != null && !delegate.equals(rcc.delegate)) - return false; - - if (runtime == null && rcc.runtime != null) - return false; - - if (runtime != null && !runtime.equals(rcc.runtime)) - return false; - - if (runtimeId != null && !runtimeId.equals(rcc.runtimeId)) - return false; - - if (project == null && rcc.project != null) - return false; - - if (project != null && !project.equals(rcc.project)) - return false; - - if (path != null && !path.equals(rcc.path)) - return false; - - return true; - } -} diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainerInitializer.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainerInitializer.java deleted file mode 100644 index 4d17ce5b3..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainerInitializer.java +++ /dev/null @@ -1,160 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.*; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jdt.core.*; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.server.core.IRuntime; -import org.eclipse.wst.server.core.ServerCore; -import org.eclipse.wst.server.core.ServerUtil; -/** - * - */ -public class RuntimeClasspathContainerInitializer extends ClasspathContainerInitializer { - /** (non-Javadoc) - * @see org.eclipse.jdt.core.ClasspathContainerInitializer#initialize(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject) - */ - public void initialize(IPath containerPath, IJavaProject project) throws CoreException { - if (containerPath.segmentCount() > 0) { - if (containerPath.segment(0).equals(RuntimeClasspathContainer.SERVER_CONTAINER)) { - RuntimeClasspathProviderWrapper delegate = null; - IRuntime runtime = null; - String runtimeId = null; - if (containerPath.segmentCount() > 2) { - delegate = JavaServerPlugin.findRuntimeClasspathProvider(containerPath.segment(1)); - - runtimeId = containerPath.segment(2); - if (runtimeId != null) - runtime = ServerCore.findRuntime(runtimeId); - } - RuntimeClasspathContainer container = new RuntimeClasspathContainer(project.getProject(), containerPath, delegate, runtime, runtimeId); - JavaCore.setClasspathContainer(containerPath, new IJavaProject[] {project}, new IClasspathContainer[] {container}, null); - } - } - } - - /** (non-Javadoc) - * @see org.eclipse.jdt.core.ClasspathContainerInitializer#getDescription(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject) - */ - public String getDescription(IPath containerPath, IJavaProject project) { - return Messages.classpathContainerDescription; - } - - /** (non-Javadoc) - * @see org.eclipse.jdt.core.ClasspathContainerInitializer#canUpdateClasspathContainer(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject) - */ - public boolean canUpdateClasspathContainer(IPath containerPath, IJavaProject project) { - return true; - } - - /** (non-Javadoc) - * @see org.eclipse.jdt.core.ClasspathContainerInitializer#requestClasspathContainerUpdate(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject, org.eclipse.jdt.core.IClasspathContainer) - */ - public void requestClasspathContainerUpdate(IPath containerPath, IJavaProject project, IClasspathContainer containerSuggestion) throws CoreException { - if (containerPath.segmentCount() > 0) { - if (containerPath.segment(0).equals(RuntimeClasspathContainer.SERVER_CONTAINER)) { - RuntimeClasspathProviderWrapper delegate = null; - IRuntime runtime = null; - if (containerPath.segmentCount() > 2) { - delegate = JavaServerPlugin.findRuntimeClasspathProvider(containerPath.segment(1)); - String runtimeId = containerPath.segment(2); - if (runtimeId != null) - runtime = ServerCore.findRuntime(runtimeId); - delegate.requestClasspathContainerUpdate(runtime, containerSuggestion.getClasspathEntries()); - //JavaCore.setClasspathContainer(containerPath, new IJavaProject[] { project }, - // new IClasspathContainer[] { containerSuggestion }, new NullProgressMonitor()); - updateClasspath(runtime, containerPath, containerSuggestion); - } - } - } - } - - public static void updateClasspath(final IRuntime runtime, final IPath containerPath, final IClasspathContainer containerSuggestion) { - class UpdateClasspathJob extends Job { - public UpdateClasspathJob() { - super(NLS.bind(Messages.updateClasspathContainers, runtime.getName())); - } - - public boolean belongsTo(Object family) { - return ServerUtil.SERVER_JOB_FAMILY.equals(family); - } - - public IStatus run(IProgressMonitor monitor) { - IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); - List<IJavaProject> list = new ArrayList<IJavaProject>(); - if (projects != null) { - for (IProject project : projects) { - if (project.isAccessible()) { - try { - if (!project.isNatureEnabled(JavaCore.NATURE_ID)) - continue; - - IJavaProject javaProject = JavaCore.create(project); - - boolean found = false; - IClasspathEntry[] ce = javaProject.getRawClasspath(); - for (IClasspathEntry cp : ce) { - if (cp.getEntryKind() == IClasspathEntry.CPE_CONTAINER) { - if (containerPath.isPrefixOf(cp.getPath())) - found = true; - } - } - - Trace.trace(Trace.FINEST, "Classpath change on: " + project + " " + found); - - if (found) - list.add(javaProject); - } catch (Exception e) { - Trace.trace(Trace.SEVERE, "Could not update classpath container", e); - } - } - } - } - - int size = list.size(); - if (size > 0) { - IJavaProject[] javaProjects = new IJavaProject[size]; - list.toArray(javaProjects); - IClasspathContainer[] containers = new IClasspathContainer[size]; - for (int i = 0; i < size; i++) - containers[i] = containerSuggestion; - - try { - JavaCore.setClasspathContainer(containerPath, javaProjects, containers, monitor); - } catch (JavaModelException jme) { - return jme.getStatus(); - } - } - - return Status.OK_STATUS; - } - } - UpdateClasspathJob job = new UpdateClasspathJob(); - job.schedule(); - } - - /** (non-Javadoc) - * @see org.eclipse.jdt.core.ClasspathContainerInitializer#getComparisonID(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject) - */ - public Object getComparisonID(IPath containerPath, IJavaProject project) { - if (containerPath == null) - return null; - - return containerPath.toPortableString(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProvider.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProvider.java deleted file mode 100644 index f4c67bed8..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProvider.java +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005, 2007 BEA Systems, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Konstantin Komissarchik - initial API and implementation - * IBM Corporation - Support for all server types - ******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jst.common.project.facet.core.IClasspathProvider; -import org.eclipse.wst.common.project.facet.core.IProjectFacet; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; -import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent; -/** - * - */ -public class RuntimeClasspathProvider implements IClasspathProvider { - private static final IProjectFacet WEB_FACET = ProjectFacetsManager.getProjectFacet("jst.web"); - private static final IProjectFacet EJB_FACET = ProjectFacetsManager.getProjectFacet("jst.ejb"); - private static final IProjectFacet EAR_FACET = ProjectFacetsManager.getProjectFacet("jst.ear"); - private static final IProjectFacet UTILITY_FACET = ProjectFacetsManager.getProjectFacet("jst.utility"); - private static final IProjectFacet CONNECTOR_FACET = ProjectFacetsManager.getProjectFacet("jst.connector"); - private static final IProjectFacet APP_CLIENT_FACET = ProjectFacetsManager.getProjectFacet("jst.appclient"); - private static final IProjectFacet WEBFRAGMENT_FACET = ProjectFacetsManager.getProjectFacet("jst.webfragment"); - - private IRuntimeComponent rc; - - public RuntimeClasspathProvider(IRuntimeComponent rc) { - this.rc = rc; - } - - public List getClasspathEntries(IProjectFacetVersion fv) { - IProjectFacet pf = fv.getProjectFacet(); - if (pf == null) - return null; - - if (pf.equals(WEB_FACET) || pf.equals(EJB_FACET) || pf.equals(EAR_FACET) || - pf.equals(UTILITY_FACET) || pf.equals(CONNECTOR_FACET) || pf.equals(APP_CLIENT_FACET) || - pf.equals(WEBFRAGMENT_FACET)) { - String runtimeTypeId = rc.getProperty("type-id"); - String runtimeId = rc.getProperty("id"); - if (runtimeTypeId == null || runtimeId == null) - return null; - RuntimeClasspathProviderWrapper rcpw = JavaServerPlugin.findRuntimeClasspathProviderBySupport(runtimeTypeId); - if (rcpw != null) { - IPath path = new Path(RuntimeClasspathContainer.SERVER_CONTAINER); - path = path.append(rcpw.getId()).append(runtimeId); - IClasspathEntry cpentry = JavaCore.newContainerEntry(path); - return Collections.singletonList(cpentry); - } - } - - return null; - } - - public static final class Factory implements IAdapterFactory { - private static final Class[] ADAPTER_TYPES = { IClasspathProvider.class }; - - public Object getAdapter(Object adaptable, Class adapterType) { - IRuntimeComponent rc = (IRuntimeComponent) adaptable; - return new RuntimeClasspathProvider(rc); - } - - public Class[] getAdapterList() { - return ADAPTER_TYPES; - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProviderWrapper.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProviderWrapper.java deleted file mode 100644 index 5256ffb08..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProviderWrapper.java +++ /dev/null @@ -1,187 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate; -import org.eclipse.wst.server.core.*; -import org.eclipse.wst.server.core.internal.ServerPlugin; -/** - * - */ -public class RuntimeClasspathProviderWrapper { - private IConfigurationElement element; - private volatile RuntimeClasspathProviderDelegate delegate; - - /** - * Create a new runtime target handler. - * - * @param element a configuration element - */ - public RuntimeClasspathProviderWrapper(IConfigurationElement element) { - super(); - this.element = element; - } - - protected IConfigurationElement getElement() { - return element; - } - - /** - * - * @return the id - */ - public String getId() { - return element.getAttribute("id"); - } - - /** - * Returns the order. - * - * @return the order - */ - public int getOrder() { - try { - String o = element.getAttribute("order"); - return Integer.parseInt(o); - } catch (NumberFormatException e) { - return -1; - } - } - - public String[] getRuntimeTypeIds() { - try { - List<String> list = new ArrayList<String>(); - StringTokenizer st = new StringTokenizer(element.getAttribute("runtimeTypeIds"), ","); - while (st.hasMoreTokens()) { - String str = st.nextToken(); - if (str != null && str.length() > 0) - list.add(str.trim()); - } - String[] s = new String[list.size()]; - list.toArray(s); - return s; - } catch (Exception e) { - Trace.trace(Trace.SEVERE, "Could not parse runtime type ids: " + element); - return null; - } - } - - /** - * Returns true if the given server resource type (given by the - * id) can be opened with this editor. This result is based on - * the result of the getServerResources() method. - * - * @param runtimeType a runtime type - * @return boolean - */ - public boolean supportsRuntimeType(IRuntimeType runtimeType) { - if (runtimeType == null) - return false; - return supportsRuntimeType(runtimeType.getId()); - } - - /** - * Returns true if the given server resource type (given by the - * id) can be opened with this editor. This result is based on - * the result of the getServerResources() method. - * - * @param id a runtime type id - * @return boolean - */ - public boolean supportsRuntimeType(String id) { - if (id == null || id.length() == 0) - return false; - - String[] s = getRuntimeTypeIds(); - if (s == null) - return false; - - for (String ss : s) { - if (ss.endsWith("*")) { - if (id.length() >= ss.length() && id.startsWith(ss.substring(0, ss.length() - 1))) - return true; - } else if (id.equals(ss)) - return true; - } - return false; - } - - /* - * Loads the delegate class. - */ - public RuntimeClasspathProviderDelegate getDelegate() { - if (delegate == null) { - try { - // Create delegate unsynchronized to avoid possible deadlocks - RuntimeClasspathProviderDelegate tempDelegate = (RuntimeClasspathProviderDelegate) element.createExecutableExtension("class"); - tempDelegate.initialize(getId()); - // If delegate is not already set, use this delegate - synchronized (this) { - if (delegate == null) { - delegate = tempDelegate; - } - } - } catch (Throwable t) { - ServerPlugin.logExtensionFailure(toString(), t); - } - } - return delegate; - } - - /* - * @see RuntimeClasspathProviderDelegate#resolveClasspathContainerImpl(IProject, IRuntime) - */ - public IClasspathEntry[] resolveClasspathContainerImpl(IProject project, IRuntime runtime) { - if (runtime == null) - return null; - try { - return getDelegate().resolveClasspathContainerImpl(project, runtime); - } catch (Exception e) { - ServerPlugin.logExtensionFailure(toString(), e); - } - return null; - } - - public void requestClasspathContainerUpdate(IRuntime runtime, IClasspathEntry[] entries) { - if (runtime == null) - return; - try { - getDelegate().requestClasspathContainerUpdate(runtime, entries); - } catch (Exception e) { - ServerPlugin.logExtensionFailure(toString(), e); - } - } - - /* - * @see RuntimeClasspathProviderDelegate#hasRuntimeClasspathChanged(IRuntime) - */ - public boolean hasRuntimeClasspathChanged(IRuntime runtime) { - if (runtime == null) - return false; - try { - return getDelegate().hasRuntimeClasspathChanged(runtime); - } catch (Exception e) { - ServerPlugin.logExtensionFailure(toString(), e); - } - return false; - } - - public String toString() { - return "RuntimeClasspathProviderWrapper[" + getId() + "]"; - } -} diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderDelegate.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderDelegate.java deleted file mode 100644 index 968e4dd46..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderDelegate.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import org.eclipse.wst.server.core.internal.facets.RuntimeFacetComponentProviderDelegate; -/** - * A runtime component provider can provide additional runtime components for a facet runtime. - * This provider is scoped by runtime type and may provide components for multiple - * runtime instances. - * <p> - * This abstract class is intended to be extended only by clients - * to extend the <code>internalRuntimeComponentProviders</code> extension point. - * </p> - * <p> - * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to - * change significantly before reaching stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken - * (repeatedly) as the API evolves. - * </p> - * - * @plannedfor 2.0 - */ -public abstract class RuntimeComponentProviderDelegate extends RuntimeFacetComponentProviderDelegate { - // nothing added -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderWrapper.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderWrapper.java deleted file mode 100644 index 522eafb20..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderWrapper.java +++ /dev/null @@ -1,129 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent; -import org.eclipse.wst.server.core.IRuntime; -import org.eclipse.wst.server.core.IRuntimeType; -import org.eclipse.wst.server.core.internal.ServerPlugin; -/** - * - */ -public class RuntimeComponentProviderWrapper { - private IConfigurationElement element; - private RuntimeComponentProviderDelegate delegate; - - /** - * Create a new runtime component handler. - * - * @param element a configuration element - */ - public RuntimeComponentProviderWrapper(IConfigurationElement element) { - super(); - this.element = element; - } - - protected IConfigurationElement getElement() { - return element; - } - - /** - * - * @return the id - */ - public String getId() { - return element.getAttribute("id"); - } - - public String[] getRuntimeTypeIds() { - try { - List<String> list = new ArrayList<String>(); - StringTokenizer st = new StringTokenizer(element.getAttribute("runtimeTypeIds"), ","); - while (st.hasMoreTokens()) { - String str = st.nextToken(); - if (str != null && str.length() > 0) - list.add(str.trim()); - } - String[] s = new String[list.size()]; - list.toArray(s); - return s; - } catch (Exception e) { - Trace.trace(Trace.SEVERE, "Could not parse runtime type ids: " + element); - return null; - } - } - - /** - * Returns true if the given server resource type (given by the - * id) can be opened with this editor. This result is based on - * the result of the getServerResources() method. - * - * @param runtimeType a runtime type - * @return boolean - */ - public boolean supportsRuntimeType(IRuntimeType runtimeType) { - if (runtimeType == null) - return false; - String id = runtimeType.getId(); - if (id == null || id.length() == 0) - return false; - - String[] s = getRuntimeTypeIds(); - if (s == null) - return false; - - for (String ss : s) { - if (ss.endsWith("*")) { - if (id.length() >= ss.length() && id.startsWith(ss.substring(0, ss.length() - 1))) - return true; - } else if (id.equals(ss)) - return true; - } - return false; - } - - /* - * Loads the delegate class. - */ - protected RuntimeComponentProviderDelegate getDelegate() { - if (delegate == null) { - try { - delegate = (RuntimeComponentProviderDelegate) element.createExecutableExtension("class"); - } catch (Throwable t) { - ServerPlugin.logExtensionFailure(toString(), t); - } - } - return delegate; - } - - /* - * @see RuntimeFacetComponentProviderDelegate#getRuntimeComponents(IRuntime) - */ - public List<IRuntimeComponent> getComponents(IRuntime runtime) { - if (runtime == null) - return null; - try { - return getDelegate().getRuntimeComponents(runtime); - } catch (Exception e) { - ServerPlugin.logExtensionFailure(toString(), e); - } - return null; - } - - public String toString() { - return "RuntimeComponentProviderWrapper[" + getId() + "]"; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeFacetMapping.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeFacetMapping.java deleted file mode 100644 index 72cd04537..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeFacetMapping.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import org.eclipse.core.runtime.IConfigurationElement; -/** - * - */ -public class RuntimeFacetMapping { - private IConfigurationElement element; - - /** - * Create a new runtime facet mapping. - * - * @param element a configuration element - */ - public RuntimeFacetMapping(IConfigurationElement element) { - super(); - this.element = element; - } - - /** - * - * @return the id - */ - public String getId() { - return element.getAttribute("id"); - } - - /** - * - * @return the id - */ - public String getRuntimeTypeId() { - return element.getAttribute("runtimeTypeId"); - } - - /** - * - * @return the id - */ - public String getVersion() { - return element.getAttribute("version"); - } - - /** - * - * @return the id - */ - public String getRuntimeComponent() { - return element.getAttribute("runtime-component"); - } - - public String toString() { - return "RuntimeFacetMapping[" + getId() + "]"; - } -} diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ServerProfiler.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ServerProfiler.java deleted file mode 100644 index 7ab30035d..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ServerProfiler.java +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.jdt.launching.IVMInstall; -import org.eclipse.jdt.launching.VMRunnerConfiguration; -import org.eclipse.jst.server.core.ServerProfilerDelegate; -/** - * - */ -public class ServerProfiler { - private IConfigurationElement element; - private ServerProfilerDelegate delegate; - - /** - * Create a new server profiler. - * - * @param element a configuration element - */ - public ServerProfiler(IConfigurationElement element) { - super(); - this.element = element; - } - - /** - * - * @return the id - */ - public String getId() { - return element.getAttribute("id"); - } - - /** - * - * @return the name - */ - public String getName() { - return element.getAttribute("name"); - } - - /* - * Loads the delegate class. - */ - protected ServerProfilerDelegate getDelegate() { - if (delegate == null) { - if (element.getAttribute("class") == null) - return null; - try { - delegate = (ServerProfilerDelegate) element.createExecutableExtension("class"); - } catch (Throwable t) { - Trace.trace(Trace.SEVERE, "Could not create delegate " + toString(), t); - } - } - return delegate; - } - - /** - * @deprecated Switch to new API via TODO - * @return the VM args - */ - public String getVMArgs() { - return null; - } - - public void process(ILaunch launch, IVMInstall vmInstall, VMRunnerConfiguration vmConfig, IProgressMonitor monitor) throws CoreException { - try { - ServerProfilerDelegate del = getDelegate(); - if (del != null) - del.process(launch, vmInstall, vmConfig, monitor); - } catch (CoreException ce) { - Trace.trace(Trace.SEVERE, "Could not create delegate " + toString(), ce); - throw ce; - } - } - - public String toString() { - return "ServerProfiler[" + getId() + "]"; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Trace.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Trace.java deleted file mode 100644 index fd470af25..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Trace.java +++ /dev/null @@ -1,85 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -/** - * Helper class to route trace output. - */ -public class Trace { - /** - * Config tracing - */ - public static final byte CONFIG = 0; - /** - * Warning tracing - */ - public static final byte WARNING = 1; - /** - * Severe tracing - */ - public static final byte SEVERE = 2; - /** - * Finest tracing - */ - public static final byte FINEST = 3; - - public static final byte PUBLISHING = 4; - - private static Set<String> logged = new HashSet<String>(); - - /** - * Trace constructor comment. - */ - private Trace() { - super(); - } - - /** - * Trace the given text. - * - * @param level trace level - * @param s String - */ - public static void trace(byte level, String s) { - Trace.trace(level, s, null); - } - - /** - * Trace the given message and exception. - * - * @param level trace level - * @param s String - * @param t Throwable - */ - public static void trace(byte level, String s, Throwable t) { - if (s == null) - return; - - if (level == SEVERE) { - if (!logged.contains(s)) { - JavaServerPlugin.getInstance().getLog().log(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, s, t)); - logged.add(s); - } - } - - if (!JavaServerPlugin.getInstance().isDebugging()) - return; - - System.out.println(JavaServerPlugin.PLUGIN_ID + " " + s); - if (t != null) - t.printStackTrace(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/XMLMemento.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/XMLMemento.java deleted file mode 100644 index 119f14ddf..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/XMLMemento.java +++ /dev/null @@ -1,246 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.core.internal; - -import java.io.*; -import java.util.*; - -import org.w3c.dom.*; -import org.xml.sax.*; - -import javax.xml.parsers.*; -import javax.xml.transform.*; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -/** - * A Memento is a class independent container for persistence - * info. It is a reflection of 3 storage requirements. - * - * 1) We need the ability to persist an object and restore it. - * 2) The class for an object may be absent. If so we would - * like to skip the object and keep reading. - * 3) The class for an object may change. If so the new class - * should be able to read the old persistence info. - * - * We could ask the objects to serialize themselves into an - * ObjectOutputStream, DataOutputStream, or Hashtable. However - * all of these approaches fail to meet the second requirement. - * - * Memento supports binary persistance with a version ID. - */ -public final class XMLMemento implements IMemento { - private Document factory; - private Element element; - - /** - * Answer a memento for the document and element. For simplicity - * you should use createReadRoot and createWriteRoot to create the initial - * mementos on a document. - */ - private XMLMemento(Document doc, Element el) { - factory = doc; - element = el; - } - - /** - * @see IMemento#createChild(String) - */ - public IMemento createChild(String type) { - Element child = factory.createElement(type); - element.appendChild(child); - return new XMLMemento(factory, child); - } - - /** - * Create a Document from a Reader and answer a root memento for reading - * a document. - */ - private static XMLMemento createReadRoot(InputStream in) { - Document document = null; - try { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder parser = factory.newDocumentBuilder(); - document = parser.parse(new InputSource(in)); - Node node = document.getFirstChild(); - if (node instanceof Element) - return new XMLMemento(document, (Element) node); - } catch (Exception e) { - // ignore - } finally { - try { - in.close(); - } catch (Exception e) { - // ignore - } - } - return null; - } - - /** - * Answer a root memento for writing a document. - * - * @param type a type - * @return a memento - */ - public static XMLMemento createWriteRoot(String type) { - Document document; - try { - document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); - Element element = document.createElement(type); - document.appendChild(element); - return new XMLMemento(document, element); - } catch (ParserConfigurationException e) { - throw new Error(e); - } - } - - /* - * @see IMemento - */ - public IMemento getChild(String type) { - // Get the nodes. - NodeList nodes = element.getChildNodes(); - int size = nodes.getLength(); - if (size == 0) - return null; - - // Find the first node which is a child of this node. - for (int nX = 0; nX < size; nX ++) { - Node node = nodes.item(nX); - if (node instanceof Element) { - Element element2 = (Element)node; - if (element2.getNodeName().equals(type)) - return new XMLMemento(factory, element2); - } - } - - // A child was not found. - return null; - } - - /* - * @see IMemento - */ - public IMemento [] getChildren(String type) { - // Get the nodes. - NodeList nodes = element.getChildNodes(); - int size = nodes.getLength(); - if (size == 0) - return new IMemento[0]; - - // Extract each node with given type. - List<Element> list = new ArrayList<Element>(size); - for (int nX = 0; nX < size; nX ++) { - Node node = nodes.item(nX); - if (node instanceof Element) { - Element element2 = (Element)node; - if (element2.getNodeName().equals(type)) - list.add(element2); - } - } - - // Create a memento for each node. - size = list.size(); - IMemento [] results = new IMemento[size]; - for (int x = 0; x < size; x ++) { - results[x] = new XMLMemento(factory, list.get(x)); - } - return results; - } - - /* - * @see IMemento - */ - public String getString(String key) { - Attr attr = element.getAttributeNode(key); - if (attr == null) - return null; - return attr.getValue(); - } - - /** - * Loads a memento from the given filename. - * - * @param filename java.lang.String - * @exception java.io.IOException - * @return a memento - */ - public static IMemento loadMemento(String filename) throws IOException { - InputStream in = null; - try { - in = new BufferedInputStream(new FileInputStream(filename)); - return XMLMemento.createReadRoot(in); - } finally { - try { - if (in != null) - in.close(); - } catch (Exception e) { - // ignore - } - } - } - - /* - * @see IMemento - */ - public void putString(String key, String value) { - if (value == null) - return; - element.setAttribute(key, value); - } - - /** - * Save this Memento to a Writer. - * - * @param os an output stream - * @throws IOException if anything goes wrong - */ - private void save(OutputStream os) throws IOException { - Result result = new StreamResult(os); - Source source = new DOMSource(factory); - try { - Transformer transformer = TransformerFactory.newInstance().newTransformer(); - transformer.setOutputProperty(OutputKeys.INDENT, "yes"); - transformer.setOutputProperty(OutputKeys.METHOD, "xml"); - transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); - transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "2"); - transformer.transform(source, result); - } catch (Exception e) { - throw (IOException) (new IOException().initCause(e)); - } - } - - /** - * Saves the memento to the given file. - * - * @param filename java.lang.String - * @exception java.io.IOException - */ - public void saveToFile(String filename) throws IOException { - FileOutputStream w = null; - try { - w = new FileOutputStream(filename); - save(w); - } catch (IOException e) { - throw e; - } catch (Exception e) { - throw new IOException(e.getLocalizedMessage()); - } finally { - if (w != null) { - try { - w.close(); - } catch (Exception e) { - // ignore - } - } - } - } -} diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.html b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.html deleted file mode 100644 index 0dfa3c3ae..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.html +++ /dev/null @@ -1,66 +0,0 @@ -<html> -<head> -<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -<link rel="stylesheet" href="../../../../..//apistyles.css" type="text/css"> -<title>WTP API overview</title> -</head> -<body> -<table width="500"> -<tr> -<td> -<p>Support for Java and J2EE server types.</p> -</td> -</tr> -</table> -<table width="500"> -<tr> -<td> -<p>The ClasspathRuntimeTargetHandler class provides a common subclass -for runtime target handlers that need to modify a project's classpath -when a project is targetted to a particular runtime.</p> -</td> -</tr> -</table> -<table width="500"> -<tr> -<td> -<p>IGenericRuntime and its working copy provide type-specific access -to the generic runtime type. When using a generic runtime, clients can -access the type specific information by adapting to these types using -<pre>IGenericRuntime gr = (IGenericRuntime) runtime.getAdapter(IGenericRuntime.class)</pre>. -GenericRuntimeUtil contains some utility methods for handling the -generic runtime type.</p> -</td> -</tr> -</table> -<table width="500"> -<tr> -<td> -<p>IEnterpriseApplication, IEJBModule, IWebModule, IApplicationClientModule, -and IConnectorModule are J2EE module interfaces meant to be implemented -by module delegates that provide J2EE module support.</p> -</td> -</tr> -</table> -<table width="500"> -<tr> -<td> -<p>ILooseArchive and ILooseArchiveSupport are module interfaces for modules -that take advantage of loose archive support - allowing JARs contained within -the module to be available in a separate Java project instead of directly -within the module.</p> -</td> -</tr> -</table> -<table width="500"> -<tr> -<td> -<p>The remainder of the classes in this package are module artifact and -launchable types to provide access to J2EE resource types for the server tool -framework.</p> -</td> -</tr> -</table> -</body> -</html> diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.xml b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.xml deleted file mode 100644 index b4c05295a..000000000 --- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<html> -<head> - <!-- Escape to the root of your source folder --> - <meta - name="root" - content="../../../../../" /> - <title>WTP API overview</title> -</head> - -<body> - -<p>Support for Java and J2EE server types.</p> - -<p>The ClasspathRuntimeTargetHandler class provides a common subclass -for runtime target handlers that need to modify a project's classpath -when a project is targetted to a particular runtime.</p> - -<p>IGenericRuntime and its working copy provide type-specific access -to the generic runtime type. When using a generic runtime, clients can -access the type specific information by adapting to these types using -<pre>IGenericRuntime gr = (IGenericRuntime) runtime.getAdapter(IGenericRuntime.class)</pre>. -GenericRuntimeUtil contains some utility methods for handling the -generic runtime type.</p> - -<p>IEnterpriseApplication, IEJBModule, IWebModule, IApplicationClientModule, -and IConnectorModule are J2EE module interfaces meant to be implemented -by module delegates that provide J2EE module support.</p> - -<p>ILooseArchive and ILooseArchiveSupport are module interfaces for modules -that take advantage of loose archive support - allowing JARs contained within -the module to be available in a separate Java project instead of directly -within the module.</p> - -<p>The remainder of the classes in this package are module artifact and -launchable types to provide access to J2EE resource types for the server tool -framework.</p> - -</body> -</html>
\ No newline at end of file |