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/model/ServerBehaviourDelegate.java (-2 / +15 lines)
Lines 13-19 Link Here
13
import java.util.ArrayList;
13
import java.util.ArrayList;
14
import java.util.Iterator;
14
import java.util.Iterator;
15
import java.util.List;
15
import java.util.List;
16
import org.eclipse.core.runtime.*;
16
17
import org.eclipse.core.runtime.CoreException;
18
import org.eclipse.core.runtime.IAdaptable;
19
import org.eclipse.core.runtime.IPath;
20
import org.eclipse.core.runtime.IProgressMonitor;
21
import org.eclipse.core.runtime.IStatus;
22
import org.eclipse.core.runtime.MultiStatus;
23
import org.eclipse.core.runtime.Status;
17
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
24
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
18
import org.eclipse.debug.core.ILaunchManager;
25
import org.eclipse.debug.core.ILaunchManager;
19
import org.eclipse.osgi.util.NLS;
26
import org.eclipse.osgi.util.NLS;
Lines 21-27 Link Here
21
import org.eclipse.wst.server.core.IServer;
28
import org.eclipse.wst.server.core.IServer;
22
import org.eclipse.wst.server.core.IServerWorkingCopy;
29
import org.eclipse.wst.server.core.IServerWorkingCopy;
23
import org.eclipse.wst.server.core.TaskModel;
30
import org.eclipse.wst.server.core.TaskModel;
24
import org.eclipse.wst.server.core.internal.*;
31
import org.eclipse.wst.server.core.internal.ExternalModule;
32
import org.eclipse.wst.server.core.internal.Messages;
33
import org.eclipse.wst.server.core.internal.ProgressUtil;
34
import org.eclipse.wst.server.core.internal.Publisher;
35
import org.eclipse.wst.server.core.internal.Server;
36
import org.eclipse.wst.server.core.internal.ServerPlugin;
37
import org.eclipse.wst.server.core.internal.Trace;
25
/**
38
/**
26
 * A server delegate provides the implementation for various 
39
 * A server delegate provides the implementation for various 
27
 * generic and server-type-specific operations for a specific type of server.
40
 * generic and server-type-specific operations for a specific type of server.
(-)servercore/org/eclipse/wst/server/core/ServerCore.java (+31 lines)
Lines 32-37 Link Here
32
public final class ServerCore {
32
public final class ServerCore {
33
	private static final String EXTENSION_SERVER_TYPE = "serverTypes";
33
	private static final String EXTENSION_SERVER_TYPE = "serverTypes";
34
	private static final String EXTENSION_RUNTIME_TYPE = "runtimeTypes";
34
	private static final String EXTENSION_RUNTIME_TYPE = "runtimeTypes";
35
	private static final String EXTENSION_RUNTIME_MODULE_TYPE = "runtimeModuleType";
35
36
36
	//	cached copy of all runtime types
37
	//	cached copy of all runtime types
37
	private static List<IRuntimeType> runtimeTypes;
38
	private static List<IRuntimeType> runtimeTypes;
Lines 190-195 Link Here
190
		IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, EXTENSION_RUNTIME_TYPE);
191
		IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, EXTENSION_RUNTIME_TYPE);
191
		List<IRuntimeType> list = new ArrayList<IRuntimeType>(cf.length);
192
		List<IRuntimeType> list = new ArrayList<IRuntimeType>(cf.length);
192
		addRuntimeTypes(cf, list);
193
		addRuntimeTypes(cf, list);
194
		cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, EXTENSION_RUNTIME_MODULE_TYPE);
195
		addRuntimeModuleTypes(cf, list);
193
		addRegistryListener();
196
		addRegistryListener();
194
		runtimeTypes = list;
197
		runtimeTypes = list;
195
		
198
		
Lines 197-202 Link Here
197
	}
200
	}
198
201
199
	/**
202
	/**
203
	 * Load the Loose Module Types.
204
	 */
205
	private static synchronized void addRuntimeModuleTypes(IConfigurationElement[] cf, List<IRuntimeType> runtimeTypesList) {	
206
		if (runtimeTypesList == null){
207
			Trace.trace(Trace.EXTENSION_POINT, "  runtimeTypeList is null");
208
			return;
209
		}
210
		
211
		for (IConfigurationElement ce : cf) {
212
			try {
213
				String [] looseModuleRuntimeIds = ServerPlugin.tokenize(ce.getAttribute("runtimeTypes"), ",");				
214
				if (looseModuleRuntimeIds.length >= 0){
215
					Trace.trace(Trace.EXTENSION_POINT, "  runtimeTypes on extension point definition is empty");
216
					return;
217
				}
218
				
219
				for (IRuntimeType runtimeType: runtimeTypesList){					
220
					ServerPlugin.contains(looseModuleRuntimeIds, runtimeType.getId());
221
					((RuntimeType)runtimeType).addModuleType(ce);					
222
					Trace.trace(Trace.EXTENSION_POINT, "  Loaded Runtime supported ModuleType: " + ce.getAttribute("id"));
223
				}
224
			} catch (Throwable t) {
225
				Trace.trace(Trace.SEVERE, "  Could not load Runtime supported ModuleType: " + ce.getAttribute("id"), t);
226
			}
227
		}
228
	}
229
	
230
	/**
200
	 * Load the runtime types.
231
	 * Load the runtime types.
201
	 */
232
	 */
202
	private static synchronized void addRuntimeTypes(IConfigurationElement[] cf, List<IRuntimeType> list) {
233
	private static synchronized void addRuntimeTypes(IConfigurationElement[] cf, List<IRuntimeType> list) {
(-)servercore/org/eclipse/wst/server/core/internal/RuntimeType.java (-3 / +19 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 128-133 Link Here
128
			return new IModuleType[0];
126
			return new IModuleType[0];
129
		}
127
		}
130
	}
128
	}
129
	
130
	/**
131
	 * Adds a Loose ModuleType to this runtime  
132
	 * @param moduleType
133
	 * @throws CoreException if the moduleType is null or if already added
134
	 */
135
	public void addModuleType(IConfigurationElement cfe) throws CoreException{
136
		if (cfe == null)
137
			throw new CoreException(new Status(IStatus.ERROR,ServerPlugin.PLUGIN_ID,"<null> moduleType"));
138
		
139
		IConfigurationElement [] childs = cfe.getChildren("moduleType");
140
		if (childs.length < 1)
141
			throw new CoreException(new Status(IStatus.ERROR,ServerPlugin.PLUGIN_ID,"No moduleType found for runtime"));
142
		
143
		List<IModuleType> extraModuleTypes = ServerPlugin.getModuleTypes(childs);
144
		moduleTypes.addAll(extraModuleTypes);
145
146
	}
131
147
132
	public boolean canCreate() {
148
	public boolean canCreate() {
133
		try {
149
		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