Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 249531 | Differences between
and this patch

Collapse All | Expand All

(-)plugin.xml (-1 / +2 lines)
Lines 19-24 Link Here
19
  <extension-point id="installableServers" name="%extensionPointInstallableServers" schema="schema/installableServers.exsd"/>
19
  <extension-point id="installableServers" name="%extensionPointInstallableServers" schema="schema/installableServers.exsd"/>
20
  <extension-point id="installableRuntimes" name="%extensionPointInstallableRuntimes" schema="schema/installableRuntimes.exsd"/>
20
  <extension-point id="installableRuntimes" name="%extensionPointInstallableRuntimes" schema="schema/installableRuntimes.exsd"/>
21
  <extension-point id="runtimeFacetComponentProviders" name="%extensionPointRuntimeFacetComponentProviders" schema="schema/runtimeFacetComponentProviders.exsd"/>
21
  <extension-point id="runtimeFacetComponentProviders" name="%extensionPointRuntimeFacetComponentProviders" schema="schema/runtimeFacetComponentProviders.exsd"/>
22
  <extension-point id="runtimeModuleType" name="%extensionPointRuntimeModuleType" schema="schema/runtimeModuleType.exsd"/>
22
23
23
  <extension point="org.eclipse.wst.server.core.moduleTypes">
24
  <extension point="org.eclipse.wst.server.core.moduleTypes">
24
    <moduleType
25
    <moduleType
Lines 34-37 Link Here
34
      id="org.eclipse.wst.server.core.default"
35
      id="org.eclipse.wst.server.core.default"
35
      class="org.eclipse.wst.server.core.internal.facets.RuntimeBridge"/>
36
      class="org.eclipse.wst.server.core.internal.facets.RuntimeBridge"/>
36
  </extension>
37
  </extension>
37
</plugin>
38
</plugin>
(-)plugin.properties (+1 lines)
Lines 14-19 Link Here
14
extensionPointServerStartup=Server Startup
14
extensionPointServerStartup=Server Startup
15
extensionPointModuleTypes=Module Types
15
extensionPointModuleTypes=Module Types
16
extensionPointRuntimeTypes=Runtime Types
16
extensionPointRuntimeTypes=Runtime Types
17
extensionPointRuntimeModuleType=Runtime Module Types
17
extensionPointRuntimeTargetHandlers=Runtime Target Handlers
18
extensionPointRuntimeTargetHandlers=Runtime Target Handlers
18
extensionPointRuntimeLocators=Runtime Locators
19
extensionPointRuntimeLocators=Runtime Locators
19
extensionPointServerTypes=Server Types
20
extensionPointServerTypes=Server Types
(-)servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java (-3 / +42 lines)
Lines 10-21 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.wst.server.core.internal;
11
package org.eclipse.wst.server.core.internal;
12
12
13
import java.io.*;
13
import java.io.File;
14
import java.util.*;
15
import java.text.DateFormat;
14
import java.text.DateFormat;
15
import java.util.ArrayList;
16
import java.util.HashMap;
17
import java.util.Iterator;
18
import java.util.List;
19
import java.util.Map;
20
import java.util.StringTokenizer;
16
21
17
import org.eclipse.core.resources.IProject;
22
import org.eclipse.core.resources.IProject;
18
import org.eclipse.core.runtime.*;
23
import org.eclipse.core.runtime.CoreException;
24
import org.eclipse.core.runtime.IConfigurationElement;
25
import org.eclipse.core.runtime.IExtensionRegistry;
26
import org.eclipse.core.runtime.IPath;
27
import org.eclipse.core.runtime.IProgressMonitor;
28
import org.eclipse.core.runtime.IRegistryChangeListener;
29
import org.eclipse.core.runtime.IStatus;
30
import org.eclipse.core.runtime.Platform;
31
import org.eclipse.core.runtime.Plugin;
32
import org.eclipse.core.runtime.Status;
19
import org.eclipse.core.runtime.jobs.Job;
33
import org.eclipse.core.runtime.jobs.Job;
20
import org.eclipse.osgi.util.NLS;
34
import org.eclipse.osgi.util.NLS;
21
import org.eclipse.wst.server.core.IModuleArtifact;
35
import org.eclipse.wst.server.core.IModuleArtifact;
Lines 35-40 Link Here
35
public class ServerPlugin extends Plugin {
49
public class ServerPlugin extends Plugin {
36
	public static final String PROJECT_PREF_FILE = ".serverPreference";
50
	public static final String PROJECT_PREF_FILE = ".serverPreference";
37
	public static final String EXCLUDE_SERVER_ADAPTERS = "excludeServerAdapters";
51
	public static final String EXCLUDE_SERVER_ADAPTERS = "excludeServerAdapters";
52
	private static final String EXTENSION_RUNTIME_MODULE_TYPE = "runtimeModuleType";
38
53
39
	private static final String SHUTDOWN_JOB_FAMILY = "org.eclipse.wst.server.core.family";
54
	private static final String SHUTDOWN_JOB_FAMILY = "org.eclipse.wst.server.core.family";
40
	//public static final String REGISTRY_JOB_FAMILY = "org.eclipse.wst.server.registry.family";
55
	//public static final String REGISTRY_JOB_FAMILY = "org.eclipse.wst.server.registry.family";
Lines 406-411 Link Here
406
		return s;
421
		return s;
407
	}
422
	}
408
423
424
	/**
425
	 * Load the Loose Module Types.
426
	 */
427
	protected static synchronized void loadRuntimeModuleTypes(IRuntimeType runtimeType) {	
428
		IExtensionRegistry registry = Platform.getExtensionRegistry();
429
		IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, EXTENSION_RUNTIME_MODULE_TYPE);
430
		for (IConfigurationElement ce : cf) {
431
			try {
432
				String [] looseModuleRuntimeIds = ServerPlugin.tokenize(ce.getAttribute("runtimeTypes"), ",");				
433
				if (looseModuleRuntimeIds.length < 0){
434
					Trace.trace(Trace.EXTENSION_POINT, "  runtimeTypes on extension point definition is empty");
435
					return;
436
				}
437
				
438
				if (ServerPlugin.contains(looseModuleRuntimeIds, runtimeType.getId())){
439
					((RuntimeType)runtimeType).addModuleType(ce);					
440
					Trace.trace(Trace.EXTENSION_POINT, "  Loaded Runtime supported ModuleType: " + ce.getAttribute("id"));
441
				}
442
			} catch (Throwable t) {
443
				Trace.trace(Trace.SEVERE, "  Could not load Runtime supported ModuleType: " + ce.getAttribute("id"), t);
444
			}
445
		}
446
	}
447
	
409
	protected static List<org.eclipse.wst.server.core.IModuleType> getModuleTypes(IConfigurationElement[] elements) {
448
	protected static List<org.eclipse.wst.server.core.IModuleType> getModuleTypes(IConfigurationElement[] elements) {
410
		List<IModuleType> list = new ArrayList<IModuleType>();
449
		List<IModuleType> list = new ArrayList<IModuleType>();
411
		if (elements == null)
450
		if (elements == null)
(-)servercore/org/eclipse/wst/server/core/internal/RuntimeType.java (-4 / +25 lines)
Lines 12-20 Link Here
12
12
13
import java.util.List;
13
import java.util.List;
14
14
15
import org.eclipse.core.runtime.CoreException;
15
import org.eclipse.core.runtime.*;
16
import org.eclipse.core.runtime.IConfigurationElement;
17
import org.eclipse.core.runtime.IProgressMonitor;
18
import org.eclipse.wst.server.core.*;
16
import org.eclipse.wst.server.core.*;
19
import org.eclipse.wst.server.core.model.RuntimeDelegate;
17
import org.eclipse.wst.server.core.model.RuntimeDelegate;
20
/**
18
/**
Lines 119-125 Link Here
119
	public IModuleType[] getModuleTypes() {
117
	public IModuleType[] getModuleTypes() {
120
		try {
118
		try {
121
			if (moduleTypes == null)
119
			if (moduleTypes == null)
122
				moduleTypes = ServerPlugin.getModuleTypes(element.getChildren("moduleType"));
120
				loadModuleTypes();
123
	
121
	
124
			IModuleType[] mt = new IModuleType[moduleTypes.size()];
122
			IModuleType[] mt = new IModuleType[moduleTypes.size()];
125
			moduleTypes.toArray(mt);
123
			moduleTypes.toArray(mt);
Lines 128-133 Link Here
128
			return new IModuleType[0];
126
			return new IModuleType[0];
129
		}
127
		}
130
	}
128
	}
129
	
130
	protected void loadModuleTypes(){
131
		moduleTypes = ServerPlugin.getModuleTypes(element.getChildren("moduleType"));
132
		ServerPlugin.loadRuntimeModuleTypes(this);
133
	}
134
	
135
	/**
136
	 * Adds a Loose ModuleType to this runtime  
137
	 * @param moduleType
138
	 * @throws CoreException if the moduleType is null or if already added
139
	 */
140
	public void addModuleType(IConfigurationElement cfe) throws CoreException{
141
		if (cfe == null)
142
			throw new CoreException(new Status(IStatus.ERROR,ServerPlugin.PLUGIN_ID,"<null> moduleType"));
143
		
144
		IConfigurationElement [] childs = cfe.getChildren("moduleType");
145
		if (childs.length < 1)
146
			throw new CoreException(new Status(IStatus.ERROR,ServerPlugin.PLUGIN_ID,"No moduleType found for runtime"));
147
		
148
		List<IModuleType> extraModuleTypes = ServerPlugin.getModuleTypes(childs);
149
		moduleTypes.addAll(extraModuleTypes);
150
151
	}
131
152
132
	public boolean canCreate() {
153
	public boolean canCreate() {
133
		try {
154
		try {
(-)schema/runtimeModuleType.exsd (+143 lines)
Added Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.wst.server.core" xmlns="http://www.w3.org/2001/XMLSchema">
4
<annotation>
5
      <appinfo>
6
         <meta.schema plugin="org.eclipse.wst.server.core" id="runtimeSupportedModuleType" name="Runtime Supported Module"/>
7
      </appinfo>
8
      <documentation>
9
         This extension point is used to provide a supported ModuleType for a Runtime
10
11
&lt;b&gt;Provisional API:&lt;/b&gt;
12
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.
13
      </documentation>
14
   </annotation>
15
16
   <element name="extension">
17
      <annotation>
18
         <appinfo>
19
            <meta.element />
20
         </appinfo>
21
      </annotation>
22
      <complexType>
23
         <sequence>
24
            <element ref="runtimeModuleType" minOccurs="1" maxOccurs="unbounded"/>
25
         </sequence>
26
         <attribute name="point" type="string" use="required">
27
            <annotation>
28
               <documentation>
29
                  
30
               </documentation>
31
            </annotation>
32
         </attribute>
33
         <attribute name="id" type="string">
34
            <annotation>
35
               <documentation>
36
                  
37
               </documentation>
38
            </annotation>
39
         </attribute>
40
         <attribute name="name" type="string">
41
            <annotation>
42
               <documentation>
43
                  
44
               </documentation>
45
               <appinfo>
46
                  <meta.attribute translatable="true"/>
47
               </appinfo>
48
            </annotation>
49
         </attribute>
50
      </complexType>
51
   </element>
52
53
   <element name="runtimeModuleType">
54
      <complexType>
55
         <sequence>
56
            <element ref="moduleType" minOccurs="1" maxOccurs="unbounded"/>
57
         </sequence>
58
         <attribute name="runtimeTypes" type="string" use="required">
59
            <annotation>
60
               <documentation>
61
                  specifies a comma separated list of the unique identifier of the runtimeTypes that supports this module
62
               </documentation>
63
            </annotation>
64
         </attribute>
65
         <attribute name="id" type="string" use="required">
66
            <annotation>
67
               <documentation>
68
                  specifies a unique identifier for this extension point
69
               </documentation>
70
            </annotation>
71
         </attribute>
72
      </complexType>
73
   </element>
74
75
   <element name="moduleType">
76
      <complexType>
77
         <attribute name="types" type="string" use="required">
78
            <annotation>
79
               <documentation>
80
                  a comma separated list of the module types that this runtime supports
81
               </documentation>
82
            </annotation>
83
         </attribute>
84
         <attribute name="versions" type="string" use="required">
85
            <annotation>
86
               <documentation>
87
                  a comma separated list of the module versions that this runtime supports
88
               </documentation>
89
            </annotation>
90
         </attribute>
91
      </complexType>
92
   </element>
93
94
   <annotation>
95
      <appinfo>
96
         <meta.section type="since"/>
97
      </appinfo>
98
      <documentation>
99
         3.0.3
100
      </documentation>
101
   </annotation>
102
103
   <annotation>
104
      <appinfo>
105
         <meta.section type="examples"/>
106
      </appinfo>
107
      <documentation>
108
         [Enter extension point usage example here.]
109
      </documentation>
110
   </annotation>
111
112
   <annotation>
113
      <appinfo>
114
         <meta.section type="apiinfo"/>
115
      </appinfo>
116
      <documentation>
117
         [Enter API information here.]
118
      </documentation>
119
   </annotation>
120
121
   <annotation>
122
      <appinfo>
123
         <meta.section type="implementation"/>
124
      </appinfo>
125
      <documentation>
126
         [Enter information about supplied implementation of this extension point.]
127
      </documentation>
128
   </annotation>
129
130
   <annotation>
131
      <appinfo>
132
         <meta.section type="copyright"/>
133
      </appinfo>
134
      <documentation>
135
         Copyright (c) 2008 IBM Corporation and others.&lt;br&gt;
136
All rights reserved. This program and the accompanying materials are made 
137
available under the terms of the Eclipse Public License v1.0 which accompanies 
138
this distribution, and is available at 
139
&lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
140
      </documentation>
141
   </annotation>
142
143
</schema>

Return to bug 249531