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 115400 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]
v0.1
new-ep-patch.txt (text/plain), 5.31 KB, created by
Angel Vera
on 2008-10-17 10:40:56 EDT
(
hide
)
Description:
v0.1
Filename:
MIME Type:
Creator:
Angel Vera
Created:
2008-10-17 10:40:56 EDT
Size:
5.31 KB
patch
obsolete
>Index: servercore/org/eclipse/wst/server/core/ServerCore.java >=================================================================== >RCS file: /cvsroot/webtools/servertools/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerCore.java,v >retrieving revision 1.39 >diff -u -r1.39 ServerCore.java >--- servercore/org/eclipse/wst/server/core/ServerCore.java 4 Mar 2008 22:41:08 -0000 1.39 >+++ servercore/org/eclipse/wst/server/core/ServerCore.java 17 Oct 2008 14:38:40 -0000 >@@ -10,11 +10,27 @@ > **********************************************************************/ > package org.eclipse.wst.server.core; > >-import java.util.*; >+import java.util.ArrayList; >+import java.util.Iterator; >+import java.util.List; > > import org.eclipse.core.resources.IProject; >-import org.eclipse.core.runtime.*; >-import org.eclipse.wst.server.core.internal.*; >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IConfigurationElement; >+import org.eclipse.core.runtime.IExtensionDelta; >+import org.eclipse.core.runtime.IExtensionRegistry; >+import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.IRegistryChangeEvent; >+import org.eclipse.core.runtime.IRegistryChangeListener; >+import org.eclipse.core.runtime.Platform; >+import org.eclipse.wst.server.core.internal.ModuleProperties; >+import org.eclipse.wst.server.core.internal.ModuleType; >+import org.eclipse.wst.server.core.internal.ResourceManager; >+import org.eclipse.wst.server.core.internal.RuntimeType; >+import org.eclipse.wst.server.core.internal.ServerPlugin; >+import org.eclipse.wst.server.core.internal.ServerPreferences; >+import org.eclipse.wst.server.core.internal.ServerType; >+import org.eclipse.wst.server.core.internal.Trace; > /** > * Main class for server core API. > * <p> >@@ -32,6 +48,7 @@ > public final class ServerCore { > private static final String EXTENSION_SERVER_TYPE = "serverTypes"; > private static final String EXTENSION_RUNTIME_TYPE = "runtimeTypes"; >+ private static final String EXTENSION_RUNTIME_SUPPORTEDMODULE_TYPE = "RuntimeSupportedModuleType"; > > // cached copy of all runtime types > private static List<IRuntimeType> runtimeTypes; >@@ -190,6 +207,8 @@ > IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, EXTENSION_RUNTIME_TYPE); > List<IRuntimeType> list = new ArrayList<IRuntimeType>(cf.length); > addRuntimeTypes(cf, list); >+ cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, EXTENSION_RUNTIME_SUPPORTEDMODULE_TYPE); >+ addRuntimeSupportedModuleTypes(cf, list); > addRegistryListener(); > runtimeTypes = list; > >@@ -197,6 +216,24 @@ > } > > /** >+ * Load the loose Module Types. >+ */ >+ private static synchronized void addRuntimeSupportedModuleTypes(IConfigurationElement[] cf, List<IRuntimeType> list) { >+ for (IConfigurationElement ce : cf) { >+ try { >+ IRuntimeType runtimeType = findRuntimeType(ce.getAttribute("runtimeType")); >+ if (runtimeType != null){ >+ IModuleType moduleType = new ModuleType(ce.getAttribute("moduleType"),ce.getAttribute("version")); >+ ((RuntimeType)runtimeType).addModuleType(moduleType); >+ } >+ 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); >+ } >+ } >+ } >+ >+ /** > * Load the runtime types. > */ > private static synchronized void addRuntimeTypes(IConfigurationElement[] cf, List<IRuntimeType> list) { >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 17 Oct 2008 14:38:40 -0000 >@@ -15,7 +15,12 @@ > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IConfigurationElement; > import org.eclipse.core.runtime.IProgressMonitor; >-import org.eclipse.wst.server.core.*; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.wst.server.core.IModuleType; >+import org.eclipse.wst.server.core.IRuntimeType; >+import org.eclipse.wst.server.core.IRuntimeWorkingCopy; >+import org.eclipse.wst.server.core.ServerUtil; > import org.eclipse.wst.server.core.model.RuntimeDelegate; > /** > * >@@ -128,6 +133,21 @@ > return new IModuleType[0]; > } > } >+ >+ /** >+ * Adds a Loose ModuleType to this runtime >+ * @param moduleType >+ * @throws CoreException if the moduleType is null or if already added >+ */ >+ public void addModuleType(IModuleType moduleType) throws CoreException{ >+ if (moduleType == null) >+ throw new CoreException(new Status(IStatus.ERROR,ServerPlugin.PLUGIN_ID,"Invalid moduleType")); >+ >+ if (moduleTypes.contains(moduleType)) >+ throw new CoreException(new Status(IStatus.ERROR,ServerPlugin.PLUGIN_ID,"Invalid moduleType")); >+ >+ moduleTypes.add(moduleType); >+ } > > public boolean canCreate() { > try {
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