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 240724 | Differences between
and this patch

Collapse All | Expand All

(-)core/framework/org/eclipse/osgi/framework/internal/core/Framework.java (+40 lines)
Lines 28-33 Link Here
28
import org.eclipse.osgi.internal.permadmin.EquinoxSecurityManager;
28
import org.eclipse.osgi.internal.permadmin.EquinoxSecurityManager;
29
import org.eclipse.osgi.internal.permadmin.SecurityAdmin;
29
import org.eclipse.osgi.internal.permadmin.SecurityAdmin;
30
import org.eclipse.osgi.internal.profile.Profile;
30
import org.eclipse.osgi.internal.profile.Profile;
31
import org.eclipse.osgi.service.environment.ExecutionEnvironment;
31
import org.eclipse.osgi.util.ManifestElement;
32
import org.eclipse.osgi.util.ManifestElement;
32
import org.eclipse.osgi.util.NLS;
33
import org.eclipse.osgi.util.NLS;
33
import org.osgi.framework.*;
34
import org.osgi.framework.*;
Lines 66-71 Link Here
66
	protected SecurityAdmin securityAdmin;
67
	protected SecurityAdmin securityAdmin;
67
	/** Startlevel object. This object manages the framework and bundle startlevels */
68
	/** Startlevel object. This object manages the framework and bundle startlevels */
68
	protected StartLevelManager startLevelManager;
69
	protected StartLevelManager startLevelManager;
70
	/** ProfileService object. This object manages the vm profiles */
71
	protected ExecutionEnvironmentServiceImpl executionEnvService;
69
	/** The ServiceRegistry */
72
	/** The ServiceRegistry */
70
	protected ServiceRegistry serviceRegistry; //TODO This is duplicated from the adaptor, do we really gain ?
73
	protected ServiceRegistry serviceRegistry; //TODO This is duplicated from the adaptor, do we really gain ?
71
	/** next free service id. */
74
	/** next free service id. */
Lines 216-221 Link Here
216
		installLock = new Hashtable(10);
219
		installLock = new Hashtable(10);
217
		/* create the system bundle */
220
		/* create the system bundle */
218
		createSystemBundle();
221
		createSystemBundle();
222
223
		// create the profile service
224
		executionEnvService = new ExecutionEnvironmentServiceImpl(this);
225
219
		loadVMProfile(); // load VM profile after the system bundle has been created
226
		loadVMProfile(); // load VM profile after the system bundle has been created
220
		setBootDelegation(); //set boot delegation property after system exports have been set
227
		setBootDelegation(); //set boot delegation property after system exports have been set
221
		if (Profile.PROFILE && Profile.STARTUP)
228
		if (Profile.PROFILE && Profile.STARTUP)
Lines 231-236 Link Here
231
		bundles = new BundleRepository(bundleDatas == null ? 10 : bundleDatas.length + 1);
238
		bundles = new BundleRepository(bundleDatas == null ? 10 : bundleDatas.length + 1);
232
		/* add the system bundle to the Bundle Repository */
239
		/* add the system bundle to the Bundle Repository */
233
		bundles.add(systemBundle);
240
		bundles.add(systemBundle);
241
242
		// search for profiles
243
		discoverProfiles();
244
234
		if (bundleDatas != null) {
245
		if (bundleDatas != null) {
235
			for (int i = 0; i < bundleDatas.length; i++) {
246
			for (int i = 0; i < bundleDatas.length; i++) {
236
				try {
247
				try {
Lines 401-407 Link Here
401
			bootDelegationStems = (String[]) stemMatch.toArray(new String[stemMatch.size()]);
412
			bootDelegationStems = (String[]) stemMatch.toArray(new String[stemMatch.size()]);
402
	}
413
	}
403
414
415
	private void discoverProfiles() {
416
		Enumeration e = systemBundle.findEntries("profiles", "*.profile", false); //$NON-NLS-1$ //$NON-NLS-2$
417
		while (e.hasMoreElements()) {
418
			URL url = (URL) e.nextElement();
419
			InputStream in = null;
420
			try {
421
				Properties properties = new Properties();
422
				in = url.openStream();
423
				properties.load(new BufferedInputStream(in));
424
425
				// time to create profiles!
426
				ExecutionEnvironment ee = new ExecutionEnvironmentImpl(properties);
427
				executionEnvService.register(ee);
428
429
			} catch (IOException ex) {
430
				// TODO consider logging ...
431
			} finally {
432
				if (in != null)
433
					try {
434
						in.close();
435
					} catch (IOException ee) {
436
						// do nothing
437
					}
438
			}
439
		}
440
441
	}
442
404
	private void loadVMProfile() {
443
	private void loadVMProfile() {
444
		// TODO handle managing profiles here
405
		Properties profileProps = findVMProfile();
445
		Properties profileProps = findVMProfile();
406
		String systemExports = properties.getProperty(Constants.OSGI_FRAMEWORK_SYSTEM_PACKAGES);
446
		String systemExports = properties.getProperty(Constants.OSGI_FRAMEWORK_SYSTEM_PACKAGES);
407
		// set the system exports property using the vm profile; only if the property is not already set
447
		// set the system exports property using the vm profile; only if the property is not already set
(-)core/framework/org/eclipse/osgi/framework/internal/core/SystemBundleActivator.java (-1 / +6 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2003, 2005 IBM Corporation and others.
2
 * Copyright (c) 2003, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 28-33 Link Here
28
	protected ServiceRegistration packageAdmin;
28
	protected ServiceRegistration packageAdmin;
29
	protected ServiceRegistration securityAdmin;
29
	protected ServiceRegistration securityAdmin;
30
	protected ServiceRegistration startLevel;
30
	protected ServiceRegistration startLevel;
31
	protected ServiceRegistration executionEnvironmentService;
31
	protected ServiceRegistration debugOptions;
32
	protected ServiceRegistration debugOptions;
32
33
33
	public SystemBundleActivator() {
34
	public SystemBundleActivator() {
Lines 44-49 Link Here
44
			securityAdmin = register(new String[] {Constants.OSGI_PERMISSIONADMIN_NAME, ConditionalPermissionAdmin.class.getName()}, framework.securityAdmin);
45
			securityAdmin = register(new String[] {Constants.OSGI_PERMISSIONADMIN_NAME, ConditionalPermissionAdmin.class.getName()}, framework.securityAdmin);
45
		if (framework.startLevelManager != null)
46
		if (framework.startLevelManager != null)
46
			startLevel = register(new String[] {Constants.OSGI_STARTLEVEL_NAME}, framework.startLevelManager);
47
			startLevel = register(new String[] {Constants.OSGI_STARTLEVEL_NAME}, framework.startLevelManager);
48
		if (framework.executionEnvService != null)
49
			executionEnvironmentService = register(new String[] {"org.eclipse.osgi.service.environment.ExecutionEnvironmentService"}, framework.executionEnvService); //$NON-NLS-1$
47
		FrameworkDebugOptions dbgOptions = null;
50
		FrameworkDebugOptions dbgOptions = null;
48
		if ((dbgOptions = FrameworkDebugOptions.getDefault()) != null)
51
		if ((dbgOptions = FrameworkDebugOptions.getDefault()) != null)
49
			debugOptions = register(new String[] {org.eclipse.osgi.service.debug.DebugOptions.class.getName()}, dbgOptions);
52
			debugOptions = register(new String[] {org.eclipse.osgi.service.debug.DebugOptions.class.getName()}, dbgOptions);
Lines 68-73 Link Here
68
			securityAdmin.unregister();
71
			securityAdmin.unregister();
69
		if (startLevel != null)
72
		if (startLevel != null)
70
			startLevel.unregister();
73
			startLevel.unregister();
74
		if (executionEnvironmentService != null)
75
			executionEnvironmentService.unregister();
71
		if (debugOptions != null)
76
		if (debugOptions != null)
72
			debugOptions.unregister();
77
			debugOptions.unregister();
73
78
(-)profiles/CDC-1.1_Foundation-1.1.profile (+24 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2005 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
# 
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
11
org.osgi.framework.system.packages = \
12
 javax.microedition.io,\
13
 javax.microedition.pki,\
14
 javax.security.auth.x500
15
org.osgi.framework.bootdelegation = \
16
 javax.microedition.io,\
17
 javax.microedition.pki,\
18
 javax.security.auth.x500
19
org.osgi.framework.executionenvironment = \
20
 OSGi/Minimum-1.0,\
21
 OSGi/Minimum-1.1,\
22
 CDC-1.0/Foundation-1.0,\
23
 CDC-1.1/Foundation-1.1
24
osgi.java.profile.name = CDC-1.1/Foundation-1.1
(-)profiles/JavaSE-1.6.profile (+185 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2003, 2005 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
# 
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
11
org.osgi.framework.system.packages = \
12
 javax.accessibility,\
13
 javax.activation,\
14
 javax.activity,\
15
 javax.annotation,\
16
 javax.annotation.processing,\
17
 javax.crypto,\
18
 javax.crypto.interfaces,\
19
 javax.crypto.spec,\
20
 javax.imageio,\
21
 javax.imageio.event,\
22
 javax.imageio.metadata,\
23
 javax.imageio.plugins.bmp,\
24
 javax.imageio.plugins.jpeg,\
25
 javax.imageio.spi,\
26
 javax.imageio.stream,\
27
 javax.jws,\
28
 javax.jws.soap,\
29
 javax.lang.model,\
30
 javax.lang.model.element,\
31
 javax.lang.model.type,\
32
 javax.lang.model.util,\
33
 javax.management,\
34
 javax.management.loading,\
35
 javax.management.modelmbean,\
36
 javax.management.monitor,\
37
 javax.management.openmbean,\
38
 javax.management.relation,\
39
 javax.management.remote,\
40
 javax.management.remote.rmi,\
41
 javax.management.timer,\
42
 javax.naming,\
43
 javax.naming.directory,\
44
 javax.naming.event,\
45
 javax.naming.ldap,\
46
 javax.naming.spi,\
47
 javax.net,\
48
 javax.net.ssl,\
49
 javax.print,\
50
 javax.print.attribute,\
51
 javax.print.attribute.standard,\
52
 javax.print.event,\
53
 javax.rmi,\
54
 javax.rmi.CORBA,\
55
 javax.rmi.ssl,\
56
 javax.script,\
57
 javax.security.auth,\
58
 javax.security.auth.callback,\
59
 javax.security.auth.kerberos,\
60
 javax.security.auth.login,\
61
 javax.security.auth.spi,\
62
 javax.security.auth.x500,\
63
 javax.security.cert,\
64
 javax.security.sasl,\
65
 javax.sound.midi,\
66
 javax.sound.midi.spi,\
67
 javax.sound.sampled,\
68
 javax.sound.sampled.spi,\
69
 javax.sql,\
70
 javax.sql.rowset,\
71
 javax.sql.rowset.serial,\
72
 javax.sql.rowset.spi,\
73
 javax.swing,\
74
 javax.swing.border,\
75
 javax.swing.colorchooser,\
76
 javax.swing.event,\
77
 javax.swing.filechooser,\
78
 javax.swing.plaf,\
79
 javax.swing.plaf.basic,\
80
 javax.swing.plaf.metal,\
81
 javax.swing.plaf.multi,\
82
 javax.swing.plaf.synth,\
83
 javax.swing.table,\
84
 javax.swing.text,\
85
 javax.swing.text.html,\
86
 javax.swing.text.html.parser,\
87
 javax.swing.text.rtf,\
88
 javax.swing.tree,\
89
 javax.swing.undo,\
90
 javax.tools,\
91
 javax.transaction,\
92
 javax.transaction.xa,\
93
 javax.xml,\
94
 javax.xml.bind,\
95
 javax.xml.bind.annotation,\
96
 javax.xml.bind.annotation.adapters,\
97
 javax.xml.bind.attachment,\
98
 javax.xml.bind.helpers,\
99
 javax.xml.bind.util,\
100
 javax.xml.crypto,\
101
 javax.xml.crypto.dom,\
102
 javax.xml.crypto.dsig,\
103
 javax.xml.crypto.dsig.dom,\
104
 javax.xml.crypto.dsig.keyinfo,\
105
 javax.xml.crypto.dsig.spec,\
106
 javax.xml.datatype,\
107
 javax.xml.namespace,\
108
 javax.xml.parsers,\
109
 javax.xml.soap,\
110
 javax.xml.stream,\
111
 javax.xml.stream.events,\
112
 javax.xml.stream.util,\
113
 javax.xml.transform,\
114
 javax.xml.transform.dom,\
115
 javax.xml.transform.sax,\
116
 javax.xml.transform.stax,\
117
 javax.xml.transform.stream,\
118
 javax.xml.validation,\
119
 javax.xml.ws,\
120
 javax.xml.ws.handler,\
121
 javax.xml.ws.handler.soap,\
122
 javax.xml.ws.http,\
123
 javax.xml.ws.soap,\
124
 javax.xml.ws.spi,\
125
 javax.xml.xpath,\
126
 org.ietf.jgss,\
127
 org.omg.CORBA,\
128
 org.omg.CORBA_2_3,\
129
 org.omg.CORBA_2_3.portable,\
130
 org.omg.CORBA.DynAnyPackage,\
131
 org.omg.CORBA.ORBPackage,\
132
 org.omg.CORBA.portable,\
133
 org.omg.CORBA.TypeCodePackage,\
134
 org.omg.CosNaming,\
135
 org.omg.CosNaming.NamingContextExtPackage,\
136
 org.omg.CosNaming.NamingContextPackage,\
137
 org.omg.Dynamic,\
138
 org.omg.DynamicAny,\
139
 org.omg.DynamicAny.DynAnyFactoryPackage,\
140
 org.omg.DynamicAny.DynAnyPackage,\
141
 org.omg.IOP,\
142
 org.omg.IOP.CodecFactoryPackage,\
143
 org.omg.IOP.CodecPackage,\
144
 org.omg.Messaging,\
145
 org.omg.PortableInterceptor,\
146
 org.omg.PortableInterceptor.ORBInitInfoPackage,\
147
 org.omg.PortableServer,\
148
 org.omg.PortableServer.CurrentPackage,\
149
 org.omg.PortableServer.POAManagerPackage,\
150
 org.omg.PortableServer.POAPackage,\
151
 org.omg.PortableServer.portable,\
152
 org.omg.PortableServer.ServantLocatorPackage,\
153
 org.omg.SendingContext,\
154
 org.omg.stub.java.rmi,\
155
 org.w3c.dom,\
156
 org.w3c.dom.bootstrap,\
157
 org.w3c.dom.css,\
158
 org.w3c.dom.events,\
159
 org.w3c.dom.html,\
160
 org.w3c.dom.ls,\
161
 org.w3c.dom.ranges,\
162
 org.w3c.dom.stylesheets,\
163
 org.w3c.dom.traversal,\
164
 org.w3c.dom.views ,\
165
 org.xml.sax,\
166
 org.xml.sax.ext,\
167
 org.xml.sax.helpers
168
org.osgi.framework.bootdelegation = \
169
 javax.*,\
170
 org.ietf.jgss,\
171
 org.omg.*,\
172
 org.w3c.*,\
173
 org.xml.*,\
174
 sun.*,\
175
 com.sun.*
176
org.osgi.framework.executionenvironment = \
177
 OSGi/Minimum-1.0,\
178
 OSGi/Minimum-1.1,\
179
 JRE-1.1,\
180
 J2SE-1.2,\
181
 J2SE-1.3,\
182
 J2SE-1.4,\
183
 J2SE-1.5,\
184
 JavaSE-1.6
185
osgi.java.profile.name = JavaSE-1.6
(-)profiles/CDC-1.0_Foundation-1.0.profile (+19 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2005 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
# 
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
11
org.osgi.framework.system.packages = \
12
 javax.microedition.io
13
org.osgi.framework.bootdelegation = \
14
 javax.microedition.io
15
org.osgi.framework.executionenvironment = \
16
 OSGi/Minimum-1.0,\
17
 OSGi/Minimum-1.1,\
18
 CDC-1.0/Foundation-1.0
19
osgi.java.profile.name = CDC-1.0/Foundation-1.0
(-)profiles/JRE-1.1.profile (+17 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2003, 2005 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
# 
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
11
org.osgi.framework.system.packages = 
12
org.osgi.framework.bootdelegation = \
13
 sun.*,\
14
 com.sun.*
15
org.osgi.framework.executionenvironment = \
16
 JRE-1.1
17
osgi.java.profile.name = JRE-1.1
(-)profiles/J2SE-1.3.profile (+63 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2003, 2005 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
# 
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
11
org.osgi.framework.system.packages = \
12
 javax.accessibility,\
13
 javax.naming,\
14
 javax.naming.directory,\
15
 javax.naming.event,\
16
 javax.naming.ldap,\
17
 javax.naming.spi,\
18
 javax.rmi,\
19
 javax.rmi.CORBA,\
20
 javax.sound.midi,\
21
 javax.sound.midi.spi,\
22
 javax.sound.sampled,\
23
 javax.sound.sampled.spi,\
24
 javax.swing,\
25
 javax.swing.border,\
26
 javax.swing.colorchooser,\
27
 javax.swing.event,\
28
 javax.swing.filechooser,\
29
 javax.swing.plaf,\
30
 javax.swing.plaf.basic,\
31
 javax.swing.plaf.metal,\
32
 javax.swing.plaf.multi,\
33
 javax.swing.table,\
34
 javax.swing.text,\
35
 javax.swing.text.html,\
36
 javax.swing.text.html.parser,\
37
 javax.swing.text.rtf,\
38
 javax.swing.tree,\
39
 javax.swing.undo,\
40
 javax.transaction,\
41
 org.omg.CORBA,\
42
 org.omg.CORBA_2_3,\
43
 org.omg.CORBA_2_3.portable,\
44
 org.omg.CORBA.DynAnyPackage,\
45
 org.omg.CORBA.ORBPackage,\
46
 org.omg.CORBA.portable,\
47
 org.omg.CORBA.TypeCodePackage,\
48
 org.omg.CosNaming,\
49
 org.omg.CosNaming.NamingContextPackage,\
50
 org.omg.SendingContext,\
51
 org.omg.stub.java.rmi
52
org.osgi.framework.bootdelegation = \
53
 javax.*,\
54
 org.omg.*,\
55
 sun.*,\
56
 com.sun.*
57
org.osgi.framework.executionenvironment = \
58
 OSGi/Minimum-1.0,\
59
 OSGi/Minimum-1.1,\
60
 JRE-1.1,\
61
 J2SE-1.2,\
62
 J2SE-1.3
63
osgi.java.profile.name = J2SE-1.3
(-)core/framework/org/eclipse/osgi/framework/internal/core/ExecutionEnvironmentImpl.java (+48 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Code 9 Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Chris Aniszczyk <zx@code9.com> - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.osgi.framework.internal.core;
12
13
import java.util.ArrayList;
14
import java.util.Properties;
15
import org.eclipse.osgi.service.environment.ExecutionEnvironment;
16
17
public class ExecutionEnvironmentImpl implements ExecutionEnvironment {
18
19
	private String name;
20
	private ArrayList environments;
21
	private ArrayList packages;
22
23
	public ExecutionEnvironmentImpl(Properties properties) {
24
		this.name = properties.getProperty(Constants.OSGI_JAVA_PROFILE_NAME);
25
		// TODO do the environments and packages
26
	}
27
28
	public String getName() {
29
		return name;
30
	}
31
32
	public void setName(String name) {
33
		this.name = name;
34
	}
35
36
	public String[] getSupportedEnvironments() {
37
		return (String[]) environments.toArray(new String[environments.size()]);
38
	}
39
40
	public String[] getSystemPackages() {
41
		return (String[]) packages.toArray(new String[packages.size()]);
42
	}
43
44
	public String toString() {
45
		return this.name;
46
	}
47
48
}
(-)profiles/J2SE-1.4.profile (+123 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2003, 2005 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
# 
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
11
org.osgi.framework.system.packages = \
12
 javax.accessibility,\
13
 javax.crypto,\
14
 javax.crypto.interfaces,\
15
 javax.crypto.spec,\
16
 javax.imageio,\
17
 javax.imageio.event,\
18
 javax.imageio.metadata,\
19
 javax.imageio.plugins.jpeg,\
20
 javax.imageio.spi,\
21
 javax.imageio.stream,\
22
 javax.naming,\
23
 javax.naming.directory,\
24
 javax.naming.event,\
25
 javax.naming.ldap,\
26
 javax.naming.spi,\
27
 javax.net,\
28
 javax.net.ssl,\
29
 javax.print,\
30
 javax.print.attribute,\
31
 javax.print.attribute.standard,\
32
 javax.print.event,\
33
 javax.rmi,\
34
 javax.rmi.CORBA,\
35
 javax.security.auth,\
36
 javax.security.auth.callback,\
37
 javax.security.auth.kerberos,\
38
 javax.security.auth.login,\
39
 javax.security.auth.spi,\
40
 javax.security.auth.x500,\
41
 javax.security.cert,\
42
 javax.sound.midi,\
43
 javax.sound.midi.spi,\
44
 javax.sound.sampled,\
45
 javax.sound.sampled.spi,\
46
 javax.sql,\
47
 javax.swing,\
48
 javax.swing.border,\
49
 javax.swing.colorchooser,\
50
 javax.swing.event,\
51
 javax.swing.filechooser,\
52
 javax.swing.plaf,\
53
 javax.swing.plaf.basic,\
54
 javax.swing.plaf.metal,\
55
 javax.swing.plaf.multi,\
56
 javax.swing.table,\
57
 javax.swing.text,\
58
 javax.swing.text.html,\
59
 javax.swing.text.html.parser,\
60
 javax.swing.text.rtf,\
61
 javax.swing.tree,\
62
 javax.swing.undo,\
63
 javax.transaction,\
64
 javax.transaction.xa,\
65
 javax.xml.parsers,\
66
 javax.xml.transform,\
67
 javax.xml.transform.dom,\
68
 javax.xml.transform.sax,\
69
 javax.xml.transform.stream,\
70
 org.ietf.jgss,\
71
 org.omg.CORBA,\
72
 org.omg.CORBA_2_3,\
73
 org.omg.CORBA_2_3.portable,\
74
 org.omg.CORBA.DynAnyPackage,\
75
 org.omg.CORBA.ORBPackage,\
76
 org.omg.CORBA.portable,\
77
 org.omg.CORBA.TypeCodePackage,\
78
 org.omg.CosNaming,\
79
 org.omg.CosNaming.NamingContextExtPackage,\
80
 org.omg.CosNaming.NamingContextPackage,\
81
 org.omg.Dynamic,\
82
 org.omg.DynamicAny,\
83
 org.omg.DynamicAny.DynAnyFactoryPackage,\
84
 org.omg.DynamicAny.DynAnyPackage,\
85
 org.omg.IOP,\
86
 org.omg.IOP.CodecFactoryPackage,\
87
 org.omg.IOP.CodecPackage,\
88
 org.omg.Messaging,\
89
 org.omg.PortableInterceptor,\
90
 org.omg.PortableInterceptor.ORBInitInfoPackage,\
91
 org.omg.PortableServer,\
92
 org.omg.PortableServer.CurrentPackage,\
93
 org.omg.PortableServer.POAManagerPackage,\
94
 org.omg.PortableServer.POAPackage,\
95
 org.omg.PortableServer.portable,\
96
 org.omg.PortableServer.ServantLocatorPackage,\
97
 org.omg.SendingContext,\
98
 org.omg.stub.java.rmi,\
99
 org.w3c.dom,\
100
 org.w3c.dom.css,\
101
 org.w3c.dom.events,\
102
 org.w3c.dom.html,\
103
 org.w3c.dom.stylesheets,\
104
 org.w3c.dom.views ,\
105
 org.xml.sax,\
106
 org.xml.sax.ext,\
107
 org.xml.sax.helpers
108
org.osgi.framework.bootdelegation = \
109
 javax.*,\
110
 org.ietf.jgss,\
111
 org.omg.*,\
112
 org.w3c.*,\
113
 org.xml.*,\
114
 sun.*,\
115
 com.sun.*
116
org.osgi.framework.executionenvironment = \
117
 OSGi/Minimum-1.0,\
118
 OSGi/Minimum-1.1,\
119
 JRE-1.1,\
120
 J2SE-1.2,\
121
 J2SE-1.3,\
122
 J2SE-1.4
123
osgi.java.profile.name = J2SE-1.4
(-)profiles/OSGi_Minimum-1.1.profile (+18 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2003, 2005 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
# 
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
11
org.osgi.framework.system.packages = 
12
org.osgi.framework.bootdelegation = \
13
 sun.*,\
14
 com.sun.*
15
org.osgi.framework.executionenvironment = \
16
 OSGi/Minimum-1.0,\
17
 OSGi/Minimum-1.1
18
osgi.java.profile.name = OSGi/Minimum-1.1
(-)profiles/OSGi_Minimum-1.0.profile (+17 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2003, 2005 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
# 
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
11
org.osgi.framework.system.packages = 
12
org.osgi.framework.bootdelegation = \
13
 sun.*,\
14
 com.sun.*
15
org.osgi.framework.executionenvironment = \
16
 OSGi/Minimum-1.0
17
osgi.java.profile.name = OSGi/Minimum-1.0
(-)supplement/src/org/eclipse/osgi/service/environment/ExecutionEnvironment.java (+41 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Code 9 Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Chris Aniszczyk <zx@code9.com> - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.osgi.service.environment;
12
13
/**
14
 * A vm profile represents an execution environment.
15
 * 
16
 * @since 3.5
17
 */
18
public interface ExecutionEnvironment {
19
20
	/**
21
	 * The unique and primary name of the execution environment profile
22
	 * 
23
	 * @since 3.5
24
	 */
25
	public String getName();
26
27
	/**
28
	 * The unique and primary name of the execution environment profile
29
	 * 
30
	 * @since 3.5
31
	 */
32
	public String[] getSystemPackages();
33
34
	/**
35
	 * The unique and primary name of the execution environment profile
36
	 * 
37
	 * @since 3.5
38
	 */
39
	public String[] getSupportedEnvironments();
40
41
}
(-)profiles/J2SE-1.5.profile (+150 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2003, 2005 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
# 
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
11
org.osgi.framework.system.packages = \
12
 javax.accessibility,\
13
 javax.activity,\
14
 javax.crypto,\
15
 javax.crypto.interfaces,\
16
 javax.crypto.spec,\
17
 javax.imageio,\
18
 javax.imageio.event,\
19
 javax.imageio.metadata,\
20
 javax.imageio.plugins.bmp,\
21
 javax.imageio.plugins.jpeg,\
22
 javax.imageio.spi,\
23
 javax.imageio.stream,\
24
 javax.management,\
25
 javax.management.loading,\
26
 javax.management.modelmbean,\
27
 javax.management.monitor,\
28
 javax.management.openmbean,\
29
 javax.management.relation,\
30
 javax.management.remote,\
31
 javax.management.remote.rmi,\
32
 javax.management.timer,\
33
 javax.naming,\
34
 javax.naming.directory,\
35
 javax.naming.event,\
36
 javax.naming.ldap,\
37
 javax.naming.spi,\
38
 javax.net,\
39
 javax.net.ssl,\
40
 javax.print,\
41
 javax.print.attribute,\
42
 javax.print.attribute.standard,\
43
 javax.print.event,\
44
 javax.rmi,\
45
 javax.rmi.CORBA,\
46
 javax.rmi.ssl,\
47
 javax.security.auth,\
48
 javax.security.auth.callback,\
49
 javax.security.auth.kerberos,\
50
 javax.security.auth.login,\
51
 javax.security.auth.spi,\
52
 javax.security.auth.x500,\
53
 javax.security.cert,\
54
 javax.security.sasl,\
55
 javax.sound.midi,\
56
 javax.sound.midi.spi,\
57
 javax.sound.sampled,\
58
 javax.sound.sampled.spi,\
59
 javax.sql,\
60
 javax.sql.rowset,\
61
 javax.sql.rowset.serial,\
62
 javax.sql.rowset.spi,\
63
 javax.swing,\
64
 javax.swing.border,\
65
 javax.swing.colorchooser,\
66
 javax.swing.event,\
67
 javax.swing.filechooser,\
68
 javax.swing.plaf,\
69
 javax.swing.plaf.basic,\
70
 javax.swing.plaf.metal,\
71
 javax.swing.plaf.multi,\
72
 javax.swing.plaf.synth,\
73
 javax.swing.table,\
74
 javax.swing.text,\
75
 javax.swing.text.html,\
76
 javax.swing.text.html.parser,\
77
 javax.swing.text.rtf,\
78
 javax.swing.tree,\
79
 javax.swing.undo,\
80
 javax.transaction,\
81
 javax.transaction.xa,\
82
 javax.xml,\
83
 javax.xml.datatype,\
84
 javax.xml.namespace,\
85
 javax.xml.parsers,\
86
 javax.xml.transform,\
87
 javax.xml.transform.dom,\
88
 javax.xml.transform.sax,\
89
 javax.xml.transform.stream,\
90
 javax.xml.validation,\
91
 javax.xml.xpath,\
92
 org.ietf.jgss,\
93
 org.omg.CORBA,\
94
 org.omg.CORBA_2_3,\
95
 org.omg.CORBA_2_3.portable,\
96
 org.omg.CORBA.DynAnyPackage,\
97
 org.omg.CORBA.ORBPackage,\
98
 org.omg.CORBA.portable,\
99
 org.omg.CORBA.TypeCodePackage,\
100
 org.omg.CosNaming,\
101
 org.omg.CosNaming.NamingContextExtPackage,\
102
 org.omg.CosNaming.NamingContextPackage,\
103
 org.omg.Dynamic,\
104
 org.omg.DynamicAny,\
105
 org.omg.DynamicAny.DynAnyFactoryPackage,\
106
 org.omg.DynamicAny.DynAnyPackage,\
107
 org.omg.IOP,\
108
 org.omg.IOP.CodecFactoryPackage,\
109
 org.omg.IOP.CodecPackage,\
110
 org.omg.Messaging,\
111
 org.omg.PortableInterceptor,\
112
 org.omg.PortableInterceptor.ORBInitInfoPackage,\
113
 org.omg.PortableServer,\
114
 org.omg.PortableServer.CurrentPackage,\
115
 org.omg.PortableServer.POAManagerPackage,\
116
 org.omg.PortableServer.POAPackage,\
117
 org.omg.PortableServer.portable,\
118
 org.omg.PortableServer.ServantLocatorPackage,\
119
 org.omg.SendingContext,\
120
 org.omg.stub.java.rmi,\
121
 org.w3c.dom,\
122
 org.w3c.dom.bootstrap,\
123
 org.w3c.dom.css,\
124
 org.w3c.dom.events,\
125
 org.w3c.dom.html,\
126
 org.w3c.dom.ls,\
127
 org.w3c.dom.ranges,\
128
 org.w3c.dom.stylesheets,\
129
 org.w3c.dom.traversal,\
130
 org.w3c.dom.views ,\
131
 org.xml.sax,\
132
 org.xml.sax.ext,\
133
 org.xml.sax.helpers
134
org.osgi.framework.bootdelegation = \
135
 javax.*,\
136
 org.ietf.jgss,\
137
 org.omg.*,\
138
 org.w3c.*,\
139
 org.xml.*,\
140
 sun.*,\
141
 com.sun.*
142
org.osgi.framework.executionenvironment = \
143
 OSGi/Minimum-1.0,\
144
 OSGi/Minimum-1.1,\
145
 JRE-1.1,\
146
 J2SE-1.2,\
147
 J2SE-1.3,\
148
 J2SE-1.4,\
149
 J2SE-1.5
150
osgi.java.profile.name = J2SE-1.5
(-)supplement/src/org/eclipse/osgi/service/environment/ExecutionEnvironmentService.java (+69 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Code 9 Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Chris Aniszczyk <zx@code9.com> - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.osgi.service.environment;
12
13
/**
14
 * The profile service is used to register, unregister and acquire profiles.
15
 * 
16
 * <p>
17
 * Profiles available by default:
18
 * <ul>
19
 * 	<li>OSGi/Minimum-1.0</li>
20
 * 	<li>OSGi/Minimum-1.1</li>
21
 *  <li>CDC-1.0/Foundation-1.0</li>
22
 *  <li>CDC-1.1/Foundation-1.1</li>
23
 *  <li>JRE-1.1</li>
24
 *  <li>J2SE-1.2</li>
25
 *  <li>J2SE-1.3</li>
26
 *  <li>J2SE-1.4</li>
27
 *  <li>J2SE-1.5</li>
28
 *  <li>JavaSE-1.6</li>
29
 * </p>
30
 * 
31
 * <p>
32
 * This interface is not intended to be implemented by clients.
33
 * </p>
34
 * 
35
 * @since 3.5
36
 * @noimplement This interface is not intended to be implemented by clients.
37
 */
38
public interface ExecutionEnvironmentService {
39
40
	public static String OSGI_MINIMUM_1_0 = "OSGi/Minimum-1.0"; //$NON-NLS-1$
41
	public static String OSGI_MINIMUM_1_1 = "OSGi/Minimum-1.1"; //$NON-NLS-1$
42
	public static String FOUNDATION_1_0 = "CDC-1.0/Foundation-1.0"; //$NON-NLS-1$
43
	public static String FOUNDATION_1_1 = "CDC-1.1/Foundation-1.1"; //$NON-NLS-1$
44
	public static String JRE_1_1 = "JRE-1.1"; //$NON-NLS-1$
45
	public static String J2SE_1_2 = "J2SE-1.2"; //$NON-NLS-1$
46
	public static String J2SE_1_3 = "J2SE-1.3"; //$NON-NLS-1$
47
	public static String J2SE_1_4 = "J2SE-1.4"; //$NON-NLS-1$
48
	public static String J2SE_1_5 = "J2SE-1.5"; //$NON-NLS-1$
49
	public static String JAVASE_1_6 = "JavaSE-1.6"; //$NON-NLS-1$
50
51
	/**
52
	 * Acquire an execution environment profile
53
	 * 
54
	 * @param name the unique name of the profile
55
	 * 
56
	 * @return A <code>ExecutionEnvironment</code> for the given unique name.
57
	 */
58
	public ExecutionEnvironment getExecutionEnvironment(String name);
59
60
	/**
61
	 * Acquire the list of all available execution environment profiles
62
	 * 
63
	 * @param name the unique name of the profile
64
	 * 
65
	 * @return A list of <code>ExecutionEnvironment</code> available.
66
	 */
67
	public ExecutionEnvironment[] getExecutionEnvironments();
68
69
}
(-)profiles/J2SE-1.2.profile (+42 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2003, 2005 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
# 
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
11
org.osgi.framework.system.packages = \
12
 javax.accessibility,\
13
 javax.swing,\
14
 javax.swing.border,\
15
 javax.swing.colorchooser,\
16
 javax.swing.event,\
17
 javax.swing.filechooser,\
18
 javax.swing.plaf,\
19
 javax.swing.plaf.basic,\
20
 javax.swing.plaf.metal,\
21
 javax.swing.plaf.multi,\
22
 javax.swing.table,\
23
 javax.swing.text,\
24
 javax.swing.text.html,\
25
 javax.swing.text.html.parser,\
26
 javax.swing.text.rtf,\
27
 javax.swing.tree,\
28
 javax.swing.undo,\
29
 org.omg.CORBA,\
30
 org.omg.CORBA.DynAnyPackage,\
31
 org.omg.CORBA.ORBPackage,\
32
 org.omg.CORBA.portable,\
33
 org.omg.CORBA.TypeCodePackage,\
34
 org.omg.CosNaming,\
35
 org.omg.CosNaming.NamingContextPackage
36
org.osgi.framework.bootdelegation = \
37
 sun.*,\
38
 com.sun.*
39
org.osgi.framework.executionenvironment = \
40
 JRE-1.1,\
41
 J2SE-1.2
42
osgi.java.profile.name = J2SE-1.2
(-)core/framework/org/eclipse/osgi/framework/internal/core/ExecutionEnvironmentServiceImpl.java (+47 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Code 9 Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Chris Aniszczyk <zx@code9.com> - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.osgi.framework.internal.core;
12
13
import java.util.HashMap;
14
import java.util.Map;
15
import org.eclipse.osgi.service.environment.ExecutionEnvironment;
16
import org.eclipse.osgi.service.environment.ExecutionEnvironmentService;
17
18
public class ExecutionEnvironmentServiceImpl implements ExecutionEnvironmentService {
19
20
	protected static Framework framework;
21
	protected static Map profileMap;
22
23
	protected static final String[] PROFILES = {ExecutionEnvironmentService.FOUNDATION_1_0, ExecutionEnvironmentService.FOUNDATION_1_1, ExecutionEnvironmentService.J2SE_1_2, ExecutionEnvironmentService.J2SE_1_3, ExecutionEnvironmentService.J2SE_1_4, ExecutionEnvironmentService.J2SE_1_5, ExecutionEnvironmentService.JAVASE_1_6};
24
25
	/** This constructor is called by the Framework */
26
	protected ExecutionEnvironmentServiceImpl(Framework framework) {
27
		ExecutionEnvironmentServiceImpl.framework = framework;
28
		profileMap = new HashMap(7);
29
	}
30
31
	public ExecutionEnvironment getExecutionEnvironment(String name) {
32
		return (ExecutionEnvironment) profileMap.get(name);
33
	}
34
35
	protected void register(ExecutionEnvironment profile) {
36
		profileMap.put(profile.getName(), profile);
37
	}
38
39
	protected void unregister(ExecutionEnvironment profile) {
40
		profileMap.remove(profile.getName());
41
	}
42
43
	public ExecutionEnvironment[] getExecutionEnvironments() {
44
		return (ExecutionEnvironment[]) profileMap.values().toArray(new ExecutionEnvironment[profileMap.size()]);
45
	}
46
47
}
(-)src/org/eclipse/osgi/tests/eclipseadaptor/AllTests.java (-1 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005 IBM Corporation and others.
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-12 Link Here
7
 * 
7
 * 
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Chris Aniszczyk <zx@code9.com> - bug 240724
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.osgi.tests.eclipseadaptor;
12
package org.eclipse.osgi.tests.eclipseadaptor;
12
13
Lines 18-23 Link Here
18
		TestSuite suite = new TestSuite(AllTests.class.getName());
19
		TestSuite suite = new TestSuite(AllTests.class.getName());
19
		suite.addTest(EnvironmentInfoTest.suite());
20
		suite.addTest(EnvironmentInfoTest.suite());
20
		suite.addTest(FilePathTest.suite());
21
		suite.addTest(FilePathTest.suite());
22
		suite.addTest(ExecutionEnvironmentTest.suite());
21
		return suite;
23
		return suite;
22
	}
24
	}
23
}
25
}
(-)src/org/eclipse/osgi/tests/eclipseadaptor/ExecutionEnvironmentTest.java (+46 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Code 9 Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     Code 9 Corporation - initial API and implementation
10
 *     Chris Aniszczyk <zx@code9.com> - bug 240724
11
 *******************************************************************************/
12
package org.eclipse.osgi.tests.eclipseadaptor;
13
14
import junit.framework.*;
15
import org.eclipse.osgi.service.environment.ExecutionEnvironment;
16
import org.eclipse.osgi.service.environment.ExecutionEnvironmentService;
17
import org.eclipse.osgi.tests.OSGiTestsActivator;
18
import org.osgi.framework.ServiceReference;
19
20
public class ExecutionEnvironmentTest extends TestCase {
21
22
	public static Test suite() {
23
		return new TestSuite(ExecutionEnvironmentTest.class);
24
	}
25
26
	public ExecutionEnvironmentTest(String name) {
27
		super(name);
28
	}
29
30
	public void testExecutionEnvironments() {
31
		ServiceReference reference = null;
32
		reference = OSGiTestsActivator.getContext().getServiceReference(ExecutionEnvironmentService.class.getName());
33
		assertNotNull(reference);
34
35
		ExecutionEnvironmentService eeService = (ExecutionEnvironmentService) OSGiTestsActivator.getContext().getService(reference);
36
		assertNotNull(eeService);
37
38
		ExecutionEnvironment[] environments = eeService.getExecutionEnvironments();
39
		assertNotNull(environments);
40
41
		ExecutionEnvironment env1 = eeService.getExecutionEnvironment(ExecutionEnvironmentService.FOUNDATION_1_0);
42
		assertNotNull(env1);
43
44
		// TODO add more tests
45
	}
46
}

Return to bug 240724