Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 116478 Details for
Bug 249531
Cannot add new module type support to an existing runtime type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
v2.0
new-ep-patch-v2.0.txt (text/plain), 12.65 KB, created by
Angel Vera
on 2008-10-29 17:10:42 EDT
(
hide
)
Description:
v2.0
Filename:
MIME Type:
Creator:
Angel Vera
Created:
2008-10-29 17:10:42 EDT
Size:
12.65 KB
patch
obsolete
>Index: plugin.xml >=================================================================== >RCS file: /cvsroot/webtools/servertools/plugins/org.eclipse.wst.server.core/plugin.xml,v >retrieving revision 1.19 >diff -u -r1.19 plugin.xml >--- plugin.xml 5 Feb 2008 03:13:27 -0000 1.19 >+++ plugin.xml 29 Oct 2008 21:08:47 -0000 >@@ -19,6 +19,7 @@ > <extension-point id="installableServers" name="%extensionPointInstallableServers" schema="schema/installableServers.exsd"/> > <extension-point id="installableRuntimes" name="%extensionPointInstallableRuntimes" schema="schema/installableRuntimes.exsd"/> > <extension-point id="runtimeFacetComponentProviders" name="%extensionPointRuntimeFacetComponentProviders" schema="schema/runtimeFacetComponentProviders.exsd"/> >+ <extension-point id="runtimeModuleType" name="%extensionPointRuntimeModuleType" schema="schema/runtimeModuleType.exsd"/> > > <extension point="org.eclipse.wst.server.core.moduleTypes"> > <moduleType >@@ -34,4 +35,4 @@ > id="org.eclipse.wst.server.core.default" > class="org.eclipse.wst.server.core.internal.facets.RuntimeBridge"/> > </extension> >-</plugin> >\ No newline at end of file >+</plugin> >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/webtools/servertools/plugins/org.eclipse.wst.server.core/plugin.properties,v >retrieving revision 1.26 >diff -u -r1.26 plugin.properties >--- plugin.properties 5 Feb 2008 03:13:27 -0000 1.26 >+++ plugin.properties 29 Oct 2008 21:08:47 -0000 >@@ -14,6 +14,7 @@ > extensionPointServerStartup=Server Startup > extensionPointModuleTypes=Module Types > extensionPointRuntimeTypes=Runtime Types >+extensionPointRuntimeModuleType=Runtime Module Types > extensionPointRuntimeTargetHandlers=Runtime Target Handlers > extensionPointRuntimeLocators=Runtime Locators > extensionPointServerTypes=Server Types >Index: servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java >=================================================================== >RCS file: /cvsroot/webtools/servertools/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java,v >retrieving revision 1.57 >diff -u -r1.57 ServerPlugin.java >--- servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java 2 Apr 2008 03:04:30 -0000 1.57 >+++ servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java 29 Oct 2008 21:08:47 -0000 >@@ -10,12 +10,26 @@ > *******************************************************************************/ > package org.eclipse.wst.server.core.internal; > >-import java.io.*; >-import java.util.*; >+import java.io.File; > import java.text.DateFormat; >+import java.util.ArrayList; >+import java.util.HashMap; >+import java.util.Iterator; >+import java.util.List; >+import java.util.Map; >+import java.util.StringTokenizer; > > import org.eclipse.core.resources.IProject; >-import org.eclipse.core.runtime.*; >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IConfigurationElement; >+import org.eclipse.core.runtime.IExtensionRegistry; >+import org.eclipse.core.runtime.IPath; >+import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.IRegistryChangeListener; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Platform; >+import org.eclipse.core.runtime.Plugin; >+import org.eclipse.core.runtime.Status; > import org.eclipse.core.runtime.jobs.Job; > import org.eclipse.osgi.util.NLS; > import org.eclipse.wst.server.core.IModuleArtifact; >@@ -35,6 +49,7 @@ > public class ServerPlugin extends Plugin { > public static final String PROJECT_PREF_FILE = ".serverPreference"; > public static final String EXCLUDE_SERVER_ADAPTERS = "excludeServerAdapters"; >+ private static final String EXTENSION_RUNTIME_MODULE_TYPE = "runtimeModuleType"; > > private static final String SHUTDOWN_JOB_FAMILY = "org.eclipse.wst.server.core.family"; > //public static final String REGISTRY_JOB_FAMILY = "org.eclipse.wst.server.registry.family"; >@@ -406,6 +421,30 @@ > return s; > } > >+ /** >+ * Load the Loose Module Types. >+ */ >+ protected static synchronized void loadRuntimeModuleTypes(IRuntimeType runtimeType) { >+ IExtensionRegistry registry = Platform.getExtensionRegistry(); >+ IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, EXTENSION_RUNTIME_MODULE_TYPE); >+ for (IConfigurationElement ce : cf) { >+ try { >+ String [] looseModuleRuntimeIds = ServerPlugin.tokenize(ce.getAttribute("runtimeTypes"), ","); >+ if (looseModuleRuntimeIds.length < 0){ >+ Trace.trace(Trace.EXTENSION_POINT, " runtimeTypes on extension point definition is empty"); >+ return; >+ } >+ >+ if (ServerPlugin.contains(looseModuleRuntimeIds, runtimeType.getId())){ >+ ((RuntimeType)runtimeType).addModuleType(ce); >+ Trace.trace(Trace.EXTENSION_POINT, " Loaded Runtime supported ModuleType: " + ce.getAttribute("id")); >+ } >+ } catch (Throwable t) { >+ Trace.trace(Trace.SEVERE, " Could not load Runtime supported ModuleType: " + ce.getAttribute("id"), t); >+ } >+ } >+ } >+ > protected static List<org.eclipse.wst.server.core.IModuleType> getModuleTypes(IConfigurationElement[] elements) { > List<IModuleType> list = new ArrayList<IModuleType>(); > if (elements == null) >Index: servercore/org/eclipse/wst/server/core/internal/RuntimeType.java >=================================================================== >RCS file: /cvsroot/webtools/servertools/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeType.java,v >retrieving revision 1.15 >diff -u -r1.15 RuntimeType.java >--- servercore/org/eclipse/wst/server/core/internal/RuntimeType.java 29 Aug 2007 14:18:33 -0000 1.15 >+++ servercore/org/eclipse/wst/server/core/internal/RuntimeType.java 29 Oct 2008 21:08:47 -0000 >@@ -12,9 +12,7 @@ > > import java.util.List; > >-import org.eclipse.core.runtime.CoreException; >-import org.eclipse.core.runtime.IConfigurationElement; >-import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.*; > import org.eclipse.wst.server.core.*; > import org.eclipse.wst.server.core.model.RuntimeDelegate; > /** >@@ -119,7 +117,7 @@ > public IModuleType[] getModuleTypes() { > try { > if (moduleTypes == null) >- moduleTypes = ServerPlugin.getModuleTypes(element.getChildren("moduleType")); >+ loadModuleTypes(); > > IModuleType[] mt = new IModuleType[moduleTypes.size()]; > moduleTypes.toArray(mt); >@@ -128,6 +126,29 @@ > return new IModuleType[0]; > } > } >+ >+ protected void loadModuleTypes(){ >+ moduleTypes = ServerPlugin.getModuleTypes(element.getChildren("moduleType")); >+ ServerPlugin.loadRuntimeModuleTypes(this); >+ } >+ >+ /** >+ * Adds a Loose ModuleType to this runtime >+ * @param moduleType >+ * @throws CoreException if the moduleType is null or if already added >+ */ >+ public void addModuleType(IConfigurationElement cfe) throws CoreException{ >+ if (cfe == null) >+ throw new CoreException(new Status(IStatus.ERROR,ServerPlugin.PLUGIN_ID,"<null> moduleType")); >+ >+ IConfigurationElement [] childs = cfe.getChildren("moduleType"); >+ if (childs.length < 1) >+ throw new CoreException(new Status(IStatus.ERROR,ServerPlugin.PLUGIN_ID,"No moduleType found for runtime")); >+ >+ List<IModuleType> extraModuleTypes = ServerPlugin.getModuleTypes(childs); >+ moduleTypes.addAll(extraModuleTypes); >+ >+ } > > public boolean canCreate() { > try { >Index: schema/runtimeModuleType.exsd >=================================================================== >RCS file: schema/runtimeModuleType.exsd >diff -N schema/runtimeModuleType.exsd >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ schema/runtimeModuleType.exsd 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,143 @@ >+<?xml version='1.0' encoding='UTF-8'?> >+<!-- Schema file written by PDE --> >+<schema targetNamespace="org.eclipse.wst.server.core" xmlns="http://www.w3.org/2001/XMLSchema"> >+<annotation> >+ <appinfo> >+ <meta.schema plugin="org.eclipse.wst.server.core" id="runtimeSupportedModuleType" name="Runtime Supported Module"/> >+ </appinfo> >+ <documentation> >+ This extension point is used to provide a supported ModuleType for a Runtime >+ >+<b>Provisional API:</b> >+This class/interface/extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves. >+ </documentation> >+ </annotation> >+ >+ <element name="extension"> >+ <annotation> >+ <appinfo> >+ <meta.element /> >+ </appinfo> >+ </annotation> >+ <complexType> >+ <sequence> >+ <element ref="runtimeModuleType" minOccurs="1" maxOccurs="unbounded"/> >+ </sequence> >+ <attribute name="point" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="id" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="name" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ <appinfo> >+ <meta.attribute translatable="true"/> >+ </appinfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="runtimeModuleType"> >+ <complexType> >+ <sequence> >+ <element ref="moduleType" minOccurs="1" maxOccurs="unbounded"/> >+ </sequence> >+ <attribute name="runtimeTypes" type="string" use="required"> >+ <annotation> >+ <documentation> >+ specifies a comma separated list of the unique identifier of the runtimeTypes that supports this module >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="id" type="string" use="required"> >+ <annotation> >+ <documentation> >+ specifies a unique identifier for this extension point >+ </documentation> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="moduleType"> >+ <complexType> >+ <attribute name="types" type="string" use="required"> >+ <annotation> >+ <documentation> >+ a comma separated list of the module types that this runtime supports >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="versions" type="string" use="required"> >+ <annotation> >+ <documentation> >+ a comma separated list of the module versions that this runtime supports >+ </documentation> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="since"/> >+ </appinfo> >+ <documentation> >+ 3.0.3 >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="examples"/> >+ </appinfo> >+ <documentation> >+ [Enter extension point usage example here.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="apiinfo"/> >+ </appinfo> >+ <documentation> >+ [Enter API information here.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="implementation"/> >+ </appinfo> >+ <documentation> >+ [Enter information about supplied implementation of this extension point.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="copyright"/> >+ </appinfo> >+ <documentation> >+ Copyright (c) 2008 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>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 249531
:
115400
|
115470
|
115471
|
115710
|
116306
|
116307
| 116478