|
Lines 10-20
Link Here
|
| 10 |
**********************************************************************/ |
10 |
**********************************************************************/ |
| 11 |
package org.eclipse.wst.server.core; |
11 |
package org.eclipse.wst.server.core; |
| 12 |
|
12 |
|
| 13 |
import java.util.*; |
13 |
import java.util.ArrayList; |
|
|
14 |
import java.util.Iterator; |
| 15 |
import java.util.List; |
| 14 |
|
16 |
|
| 15 |
import org.eclipse.core.resources.IProject; |
17 |
import org.eclipse.core.resources.IProject; |
| 16 |
import org.eclipse.core.runtime.*; |
18 |
import org.eclipse.core.runtime.CoreException; |
| 17 |
import org.eclipse.wst.server.core.internal.*; |
19 |
import org.eclipse.core.runtime.IConfigurationElement; |
|
|
20 |
import org.eclipse.core.runtime.IExtensionDelta; |
| 21 |
import org.eclipse.core.runtime.IExtensionRegistry; |
| 22 |
import org.eclipse.core.runtime.IProgressMonitor; |
| 23 |
import org.eclipse.core.runtime.IRegistryChangeEvent; |
| 24 |
import org.eclipse.core.runtime.IRegistryChangeListener; |
| 25 |
import org.eclipse.core.runtime.Platform; |
| 26 |
import org.eclipse.wst.server.core.internal.ModuleProperties; |
| 27 |
import org.eclipse.wst.server.core.internal.ModuleType; |
| 28 |
import org.eclipse.wst.server.core.internal.ResourceManager; |
| 29 |
import org.eclipse.wst.server.core.internal.RuntimeType; |
| 30 |
import org.eclipse.wst.server.core.internal.ServerPlugin; |
| 31 |
import org.eclipse.wst.server.core.internal.ServerPreferences; |
| 32 |
import org.eclipse.wst.server.core.internal.ServerType; |
| 33 |
import org.eclipse.wst.server.core.internal.Trace; |
| 18 |
/** |
34 |
/** |
| 19 |
* Main class for server core API. |
35 |
* Main class for server core API. |
| 20 |
* <p> |
36 |
* <p> |
|
Lines 32-37
Link Here
|
| 32 |
public final class ServerCore { |
48 |
public final class ServerCore { |
| 33 |
private static final String EXTENSION_SERVER_TYPE = "serverTypes"; |
49 |
private static final String EXTENSION_SERVER_TYPE = "serverTypes"; |
| 34 |
private static final String EXTENSION_RUNTIME_TYPE = "runtimeTypes"; |
50 |
private static final String EXTENSION_RUNTIME_TYPE = "runtimeTypes"; |
|
|
51 |
private static final String EXTENSION_RUNTIME_SUPPORTEDMODULE_TYPE = "RuntimeSupportedModuleType"; |
| 35 |
|
52 |
|
| 36 |
// cached copy of all runtime types |
53 |
// cached copy of all runtime types |
| 37 |
private static List<IRuntimeType> runtimeTypes; |
54 |
private static List<IRuntimeType> runtimeTypes; |
|
Lines 190-195
Link Here
|
| 190 |
IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, EXTENSION_RUNTIME_TYPE); |
207 |
IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, EXTENSION_RUNTIME_TYPE); |
| 191 |
List<IRuntimeType> list = new ArrayList<IRuntimeType>(cf.length); |
208 |
List<IRuntimeType> list = new ArrayList<IRuntimeType>(cf.length); |
| 192 |
addRuntimeTypes(cf, list); |
209 |
addRuntimeTypes(cf, list); |
|
|
210 |
cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, EXTENSION_RUNTIME_SUPPORTEDMODULE_TYPE); |
| 211 |
addRuntimeSupportedModuleTypes(cf, list); |
| 193 |
addRegistryListener(); |
212 |
addRegistryListener(); |
| 194 |
runtimeTypes = list; |
213 |
runtimeTypes = list; |
| 195 |
|
214 |
|
|
Lines 197-202
Link Here
|
| 197 |
} |
216 |
} |
| 198 |
|
217 |
|
| 199 |
/** |
218 |
/** |
|
|
219 |
* Load the loose Module Types. |
| 220 |
*/ |
| 221 |
private static synchronized void addRuntimeSupportedModuleTypes(IConfigurationElement[] cf, List<IRuntimeType> list) { |
| 222 |
for (IConfigurationElement ce : cf) { |
| 223 |
try { |
| 224 |
IRuntimeType runtimeType = findRuntimeType(ce.getAttribute("runtimeType")); |
| 225 |
if (runtimeType != null){ |
| 226 |
IModuleType moduleType = new ModuleType(ce.getAttribute("moduleType"),ce.getAttribute("version")); |
| 227 |
((RuntimeType)runtimeType).addModuleType(moduleType); |
| 228 |
} |
| 229 |
Trace.trace(Trace.EXTENSION_POINT, " Loaded Runtime supported ModuleType: " + ce.getAttribute("id")); |
| 230 |
} catch (Throwable t) { |
| 231 |
Trace.trace(Trace.SEVERE, " Could not load Runtime supported ModuleType: " + ce.getAttribute("id"), t); |
| 232 |
} |
| 233 |
} |
| 234 |
} |
| 235 |
|
| 236 |
/** |
| 200 |
* Load the runtime types. |
237 |
* Load the runtime types. |
| 201 |
*/ |
238 |
*/ |
| 202 |
private static synchronized void addRuntimeTypes(IConfigurationElement[] cf, List<IRuntimeType> list) { |
239 |
private static synchronized void addRuntimeTypes(IConfigurationElement[] cf, List<IRuntimeType> list) { |