Skip to main content
aboutsummaryrefslogblamecommitdiffstats
blob: d03b0424b3ec7f504dda267ba811172f68c636ff (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594

















































































































































































































































































































































































































































































































































































































                                                                                                                                                                                                                       
### Eclipse Workspace Patch 1.0
#P org.eclipse.osgi
Index: core/adaptor/org/eclipse/osgi/service/resolver/BundleDescription.java
===================================================================
RCS file: /home/eclipse/org.eclipse.osgi/core/adaptor/org/eclipse/osgi/service/resolver/BundleDescription.java,v
retrieving revision 1.11
diff -u -r1.11 BundleDescription.java
--- core/adaptor/org/eclipse/osgi/service/resolver/BundleDescription.java	17 Mar 2006 14:46:43 -0000	1.11
+++ core/adaptor/org/eclipse/osgi/service/resolver/BundleDescription.java	9 May 2006 21:27:12 -0000
@@ -227,4 +227,27 @@
 	 * @return the list of execution environments that are required.
 	 */
 	public String[] getExecutionEnvironments();
+	
+	// AMC
+	/**
+	 * Returns the supplemented import packages defined by the Supplement-Importer
+	 * clause.
+	 */
+	public ImportPackageSpecification[] getSupplementedImportPackages();
+	
+	/**
+	 * Returns the supplemented export packages defined by the Supplement-Exporter
+	 * clause.
+	 */
+	public ImportPackageSpecification[] getSupplementedExportPackages();
+	
+	//end AMC
+	
+	//knibb
+	/**
+	 * Returns the supplemented bundles defined by the Supplement-Bundle clause 
+	 */
+	public BundleDescription[] getSupplementedBundles();
+	//end knibb
+
 }
Index: core/framework/org/eclipse/osgi/framework/internal/core/Constants.java
===================================================================
RCS file: /home/eclipse/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Constants.java,v
retrieving revision 1.29
diff -u -r1.29 Constants.java
--- core/framework/org/eclipse/osgi/framework/internal/core/Constants.java	26 Oct 2005 17:58:14 -0000	1.29
+++ core/framework/org/eclipse/osgi/framework/internal/core/Constants.java	9 May 2006 21:27:12 -0000
@@ -268,4 +268,44 @@
 	 * @deprecated use {@link #ECLIPSE_LAZYSTART_EXCEPTIONS}
 	 */
 	public static final String ECLIPSE_AUTOSTART_EXCEPTIONS = ECLIPSE_LAZYSTART_EXCEPTIONS;
+
+
+	// Added by AMC
+
+	/**
+	 * Manifest header (named "Supplement-Importer") identifying the names
+	 * (and optionally, version numbers) of the packages that the bundle supplements.
+	 * All importers of one of these packages will have the exported packages of this
+	 * bundle added to their imports in addition.
+	 * 
+	 * <p>
+	 * The attribute value may be retrieved from the <code>Dictionary</code>
+	 * object returned by the <code>Bundle.getHeaders</code> method.
+	 */
+	public static final String	SUPPLEMENT_IMPORTER					= "Eclipse-SupplementImporter"; //$NON-NLS-1$
+
+	/**
+	 * Manifest header (named &quot;Supplement-Exporter&quot;) identifying the names
+	 * (and optionally, version numbers) of the packages that the bundle supplements.
+	 * All exporters of one of these packages will have the exported packages of this bundle 
+	 * added to their imports list.
+	 * 
+	 * <p>
+	 * The attribute value may be retrieved from the <code>Dictionary</code>
+	 * object returned by the <code>Bundle.getHeaders</code> method.
+	 */
+	public static final String	SUPPLEMENT_EXPORTER					= "Eclipse-SupplementExporter"; //$NON-NLS-1$
+
+	//knibb
+	/**
+	 * Manifest header (named &quot;Supplement-Bundle&quot;) identifying the names
+	 * (and optionally, version numbers) of any bundles supplemented by this bundle.
+	 * All supplemented bundles will have all the exported packages of this bundle 
+	 * added to their imports list
+	 * 
+	 * <p>
+	 * The attribute value may be retrieved from the <code>Dictionary</code>
+	 * object returned by the <code>Bundle.getHeaders</code> method.
+	 */
+	public static final String	SUPPLEMENT_BUNDLE						= "Eclipse-SupplementBundle"; //$NON-NLS-1$
 }
Index: resolver/src/org/eclipse/osgi/internal/resolver/StateBuilder.java
===================================================================
RCS file: /home/eclipse/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateBuilder.java,v
retrieving revision 1.46
diff -u -r1.46 StateBuilder.java
--- resolver/src/org/eclipse/osgi/internal/resolver/StateBuilder.java	24 Apr 2006 16:23:48 -0000	1.46
+++ resolver/src/org/eclipse/osgi/internal/resolver/StateBuilder.java	9 May 2006 21:27:18 -0000
@@ -101,6 +101,23 @@
 		result.setGenericRequires(createGenericRequires(genericRequires));
 		ManifestElement[] genericCapabilities = getGenericCapabilities(manifest, genericAliases);
 		result.setGenericCapabilities(createGenericCapabilities(genericCapabilities));
+
+		// AMC addition
+		ManifestElement[] supplementImporter = ManifestElement.parseHeader(Constants.SUPPLEMENT_IMPORTER, (String) manifest.get(Constants.SUPPLEMENT_IMPORTER));
+		if (supplementImporter != null)
+			result.setSupplementedImportPackages(createPackageSpecification(supplementImporter,manifestVersion));
+		ManifestElement[] supplementExporter = ManifestElement.parseHeader(Constants.SUPPLEMENT_EXPORTER, (String) manifest.get(Constants.SUPPLEMENT_EXPORTER));
+		if (supplementExporter != null)
+			result.setSupplementedExportPackages(createPackageSpecification(supplementExporter,manifestVersion));
+		// end AMC
+		
+		//knibb
+		
+		ManifestElement[] supplementBundle = ManifestElement.parseHeader(Constants.SUPPLEMENT_BUNDLE, (String) manifest.get(Constants.SUPPLEMENT_BUNDLE));
+		if (supplementBundle != null)
+			result.setSupplementedBundles(createBundleSpecification(supplementBundle,manifestVersion));
+		
+		//end knibb
 		return result;
 	}
 
@@ -544,4 +561,46 @@
 		if (!hostName.equals(Constants.SYSTEM_BUNDLE_SYMBOLICNAME) && !hostName.equals(Constants.getInternalSymbolicName()))
 			throw new BundleException(NLS.bind(StateMsg.HEADER_EXTENSION_ERROR, hostName));
 	}
-}
+	
+	// AMC
+	
+	private static ImportPackageSpecification[] createPackageSpecification(ManifestElement[] packages, int manifestVersion) {
+		ImportPackageSpecificationImpl[] result = new ImportPackageSpecificationImpl[packages.length];
+		for (int p = 0; p < packages.length; p++) {
+			String[] packagesNames = packages[p].getValueComponents();
+			for (int i = 0; i < packagesNames.length; i++) {
+				ImportPackageSpecificationImpl spec = new ImportPackageSpecificationImpl();
+				spec.setName(packagesNames[i]);
+				// set common attributes for both dynamic and static imports
+				spec.setVersionRange(getVersionRange(manifestVersion < 2 ? packages[p].getAttribute(Constants.PACKAGE_SPECIFICATION_VERSION) : packages[p].getAttribute(Constants.VERSION_ATTRIBUTE)));
+				spec.setBundleSymbolicName(packages[p].getAttribute(Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE));
+				spec.setBundleVersionRange(getVersionRange(packages[p].getAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE)));
+				spec.setAttributes(getAttributes(packages[p],DEFINED_MATCHING_ATTRS));	
+				//spec.setPropagate(ManifestElement.getArrayFromList(packages[p].getDirective(Constants.GROUPING_DIRECTIVE)));
+				spec.setDirective(Constants.RESOLUTION_DIRECTIVE,getResolution(packages[p].getDirective(Constants.RESOLUTION_DIRECTIVE)));
+				result[p] = spec;
+			}
+		}
+		return result;
+	}
+	//End AMC
+	
+	//knibb
+	
+	private static BundleDescription[] createBundleSpecification(ManifestElement[] bundles, int manifestVersion) {
+		BundleDescriptionImpl[] result = new BundleDescriptionImpl[bundles.length];
+		for (int b=0; b<bundles.length; b++) {
+			String[] bundleNames = bundles[b].getValueComponents();
+			for(int i=0; i<bundleNames.length; i++) {
+				BundleDescriptionImpl spec = new BundleDescriptionImpl();
+				spec.setName(bundleNames[i]);
+				//TODO incomplete - only matches bundle name at this time
+				result[b] = spec;
+			}
+		}
+		return result;
+	}
+	
+	
+	//end knibb
+}
\ No newline at end of file
Index: resolver/src/org/eclipse/osgi/internal/resolver/BundleSpecificationImpl.java
===================================================================
RCS file: /home/eclipse/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/BundleSpecificationImpl.java,v
retrieving revision 1.6
diff -u -r1.6 BundleSpecificationImpl.java
--- resolver/src/org/eclipse/osgi/internal/resolver/BundleSpecificationImpl.java	12 Sep 2005 16:44:01 -0000	1.6
+++ resolver/src/org/eclipse/osgi/internal/resolver/BundleSpecificationImpl.java	9 May 2006 21:27:17 -0000
@@ -18,6 +18,14 @@
 	private boolean exported;
 	private boolean optional;
 
+	// AMC
+	public BundleSpecificationImpl() {  /* empty */ }
+	
+	public BundleSpecificationImpl(String name) {
+		setName(name);
+	}
+	// End AMC
+	
 	protected void setExported(boolean exported) {
 		this.exported = exported;
 	}
Index: resolver/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java
===================================================================
RCS file: /home/eclipse/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java,v
retrieving revision 1.35
diff -u -r1.35 BundleDescriptionImpl.java
--- resolver/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java	17 Mar 2006 14:46:42 -0000	1.35
+++ resolver/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java	9 May 2006 21:27:17 -0000
@@ -91,6 +91,35 @@
 			return EMPTY_IMPORTS;
 		return lazyData.importPackages;
 	}
+	
+	// AMC
+	
+	public ImportPackageSpecification[] getSupplementedImportPackages() {
+		fullyLoad();
+		if (lazyData.supplementedImports == null)
+			return new ImportPackageSpecification[0];
+		return lazyData.supplementedImports;
+	}
+	
+	public ImportPackageSpecification[] getSupplementedExportPackages() {
+		fullyLoad();
+		if (lazyData.supplementedExports == null)
+			return new ImportPackageSpecification[0];
+		return lazyData.supplementedExports;
+	}
+	
+	// END AMC
+	
+	//knibb
+	
+	public BundleDescription[] getSupplementedBundles() {
+		fullyLoad();
+		if (lazyData.SupplementedBundles == null)
+			return new BundleDescription[0];
+		return lazyData.SupplementedBundles;
+	}
+	
+	//end knibb
 
 	public BundleSpecification[] getRequiredBundles() {
 		fullyLoad();
@@ -224,6 +253,31 @@
 		}
 	}
 
+	// AMC
+	
+	protected void setSupplementedImportPackages(ImportPackageSpecification[] supplementedImports) {
+		checkLazyData();
+		lazyData.supplementedImports = supplementedImports;
+	}
+	
+	
+	protected void setSupplementedExportPackages(ImportPackageSpecification[] supplementedExports) {
+		checkLazyData();
+		lazyData.supplementedExports = supplementedExports;
+	}
+	
+	// END AMC
+	
+	//knibb
+	
+	protected void setSupplementedBundles(BundleDescription[] supplementedBundles) {
+		checkLazyData();
+		lazyData.SupplementedBundles = supplementedBundles;
+	}
+	
+	//end knibb
+	
+	
 	protected void setRequiredBundles(BundleSpecification[] requiredBundles) {
 		checkLazyData();
 		lazyData.requiredBundles = requiredBundles;
@@ -543,5 +597,11 @@
 		String[] executionEnvironments;
 
 		HashMap dynamicStamps;
+		
+		// AMC
+		ImportPackageSpecification[] supplementedImports;
+		ImportPackageSpecification[] supplementedExports;
+		//knibb
+		BundleDescription[] SupplementedBundles;
 	}
 }
Index: resolver/src/org/eclipse/osgi/internal/module/ResolverBundle.java
===================================================================
RCS file: /home/eclipse/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/module/ResolverBundle.java,v
retrieving revision 1.20
diff -u -r1.20 ResolverBundle.java
--- resolver/src/org/eclipse/osgi/internal/module/ResolverBundle.java	3 May 2006 13:35:59 -0000	1.20
+++ resolver/src/org/eclipse/osgi/internal/module/ResolverBundle.java	9 May 2006 21:27:14 -0000
@@ -252,6 +252,16 @@
 				return allRequires[i];
 		return null;
 	}
+	
+	// AMC
+	void addRequired(BundleConstraint required) {
+		BundleConstraint[] newRequires = new BundleConstraint[requires.length + 1];
+		System.arraycopy(requires,0,newRequires,0,requires.length);
+		newRequires[requires.length] = required;
+		requires = newRequires;
+	}
+	
+	// End AMC
 
 	public BundleDescription getBundle() {
 		return (BundleDescription) getBaseDescription();
@@ -494,4 +504,4 @@
 	int getRefs() {
 		return refs == null ? 0 : refs.size();
 	}
-}
+}
\ No newline at end of file
Index: resolver/src/org/eclipse/osgi/internal/module/ResolverImpl.java
===================================================================
RCS file: /home/eclipse/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/module/ResolverImpl.java,v
retrieving revision 1.35
diff -u -r1.35 ResolverImpl.java
--- resolver/src/org/eclipse/osgi/internal/module/ResolverImpl.java	17 Apr 2006 20:22:58 -0000	1.35
+++ resolver/src/org/eclipse/osgi/internal/module/ResolverImpl.java	9 May 2006 21:27:16 -0000
@@ -15,6 +15,7 @@
 import org.eclipse.osgi.framework.debug.Debug;
 import org.eclipse.osgi.framework.debug.FrameworkDebugOptions;
 import org.eclipse.osgi.internal.resolver.BundleDescriptionImpl;
+import org.eclipse.osgi.internal.resolver.BundleSpecificationImpl;
 import org.eclipse.osgi.service.resolver.*;
 import org.eclipse.osgi.util.ManifestElement;
 import org.osgi.framework.*;
@@ -29,6 +30,7 @@
 	private static final String OPTION_GENERICS = RESOLVER + "/generics"; //$NON-NLS-1$
 	private static final String OPTION_GROUPING = RESOLVER + "/grouping"; //$NON-NLS-1$
 	private static final String OPTION_CYCLES = RESOLVER + "/cycles"; //$NON-NLS-1$
+	private static final String OPTION_SUPPLEMENTS = RESOLVER + "/supplements"; //$NON-NLS-1$
 	public static boolean DEBUG = false;
 	public static boolean DEBUG_WIRING = false;
 	public static boolean DEBUG_IMPORTS = false;
@@ -571,6 +573,7 @@
 
 	// This method will attempt to resolve the supplied bundle and any bundles that it is dependent on
 	private boolean resolveBundle(ResolverBundle bundle, ArrayList cycle) {
+//		System.out.println("ResolverImpl.resolveBundle() bundle=" + bundle.getName());
 		if (bundle.isFragment())
 			return false;
 		if (!bundle.isResolvable()) {
@@ -646,6 +649,100 @@
 				}
 			}
 		}
+		
+		// AMC
+//		System.err.println("? ResolverImpl.resolveBundle() bundle=" + bundle); //$NON-NLS-1$
+		if (!failed) {
+			// XXX this feels horribly inefficient...
+			// Iterate thru resolver bundles looking for any supplementors of packages that this
+			// bundle imports or exports. If we find a match, resolve it as a required bundle of
+			// this bundle
+			// Exports first
+			ResolverExport[] exports = bundle.getExportPackages();
+			outerExport: for (Iterator iter = resolverBundles.iterator(); iter.hasNext(); ) {
+				Object[] suppliers = (Object[]) iter.next();
+				//suppliers is an array of ResolverBundle objects. ResolverBundle is a subclass of VersionSupplier
+				//so suppliers has type VersionSupplier[]
+				//unfortunately this results in a ClassCastException so that is why this is an Object[] and not VersionSupplier[]
+				for (int s = 0; s < suppliers.length; s++) {
+					//the cast from Object to VersionSupplier is made here
+					VersionSupplier supplier = (VersionSupplier) suppliers[s];
+					BundleDescription desc = supplier.getBundle();
+					ImportPackageSpecification[] supplements = desc.getSupplementedExportPackages();
+					for (int i = 0; i < supplements.length; i++) {
+						for (int e = 0; e < exports.length; e++) {
+							if (supplements[i].getName().equals(exports[e].getName())) {
+								// it's a match
+								if(Debug.DEBUG_SUPPLEMENTS)
+									System.out.println("export  " + exports[i] + " supplemented by " + desc);  //$NON-NLS-1$//$NON-NLS-2$
+								// add suppliers[s].getBundle as a required bundle for me...
+								addRequired(bundle,supplier.getBundle(), cycle);
+								continue outerExport;
+							}
+						}
+					}
+				}
+			}
+			// Then imports
+			ResolverImport[] imports = bundle.getImportPackages();
+			outer: for (Iterator iter = resolverBundles.iterator(); iter.hasNext();) {
+				Object[] suppliers = (Object[]) iter.next();
+				for (int s = 0; s < suppliers.length; s++) {
+					VersionSupplier supplier = (VersionSupplier) suppliers[s];
+					BundleDescription desc = supplier.getBundle();
+					ImportPackageSpecification[] supplements = desc.getSupplementedImportPackages();
+					for (int i = 0; i < supplements.length; i++) {
+						for (int j = 0; j < imports.length; j++) {
+							ImportPackageSpecification possibleMatch = (ImportPackageSpecification) imports[j].getVersionConstraint();
+							if (possibleMatch.getName().equals(supplements[i].getName())) {
+								// we have a match
+								if(Debug.DEBUG_SUPPLEMENTS)
+									System.out.println("import  " + imports[j] + " supplemented by " + desc); //$NON-NLS-1$ //$NON-NLS-2$
+								addRequired(bundle,supplier.getBundle(), cycle);
+								continue outer;
+							}
+						}
+					}
+				}
+			}
+		}		
+		// END AMC
+		
+		//knibb
+		//now check for any other bundles which supplement this bundle
+		//TODO - would be usefull to have an exclusion mechanism here (e.g. you could then say someting like "supplement all bundles, except....")
+		if(!failed) {
+			String myName = bundle.getName();
+			for (Iterator iter = resolverBundles.iterator(); iter.hasNext();) {
+				Object[] suppliers = (Object[]) iter.next();
+				outerBundles: for(int s=0; s < suppliers.length; s++){
+					VersionSupplier supplier = (VersionSupplier) suppliers[s];
+					BundleDescription desc = supplier.getBundle();
+					//don't want to supplement ourselves so break if desc and bundle are the same
+					if(bundle.getBundle().equals(desc)){
+						continue outerBundles;
+					}
+					//supplemtor should not supplement any bundle on which it depends
+					BundleSpecification[] bundlesRequiredBySupplementor = desc.getRequiredBundles(); 
+					for(int i=0; i<bundlesRequiredBySupplementor.length; i++){
+						if(bundlesRequiredBySupplementor[i].getName().equals( myName )) 
+							continue outerBundles; //avoid circular dependacy - do not allow a bundle to supplement any bundle on which it depends
+					}
+					BundleDescription[] supplemented = desc.getSupplementedBundles();	//the list of bundles it (desc) supplements
+					for(int i=0; i<supplemented.length; i++){
+//						if ( myName.equals(supplemented[i].getName())){
+						if ( equals_wild(supplemented[i].getName(), myName)){
+							addRequired(bundle, desc, cycle);
+							if(Debug.DEBUG_SUPPLEMENTS)
+								System.out.println("bundle  Supplement-Bundle: " + bundle + "  supplemeted by [" + desc +"]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+						}
+					}
+				}
+			}
+		}
+		
+		//end knibb
+		
 		// Need to check that all mandatory imports are wired. If they are then
 		// set the bundle RESOLVED, otherwise set it back to UNRESOLVED
 		if (failed) {
@@ -666,6 +763,16 @@
 		return bundle.getState() != ResolverBundle.UNRESOLVED;
 	}
 
+	// AMC
+	private void addRequired(ResolverBundle toBundle, BundleDescription toBeAdded, ArrayList cycle) {
+		// TODO
+		BundleSpecification spec = new BundleSpecificationImpl(toBeAdded.getName());
+		BundleConstraint constraint = new BundleConstraint(toBundle,spec);
+		if (resolveRequire(constraint, cycle)) {
+			toBundle.addRequired(constraint);
+		}
+	}
+
 	private boolean resolveGenericReq(GenericConstraint constraint, ArrayList cycle) {
 		if (DEBUG_REQUIRES)
 			ResolverImpl.log("Trying to resolve: " + constraint.getBundle() + ", " + constraint.getVersionConstraint()); //$NON-NLS-1$ //$NON-NLS-2$
@@ -1328,6 +1435,25 @@
 	VersionHashMap getResolverExports() {
 		return resolverExports;
 	}
+	
+	//knibb
+	//test if two Strings are equal
+	//with wild card support - only supports strings ending in *
+	private boolean equals_wild(String input, String match){
+		if(input.equals(match)){
+			//its a match so just return true
+			return true;
+		}
+		if(input.endsWith("*")==false){
+			//no wildcards are being used here
+			return false;
+		}
+		String wild_in = input.substring(0, input.length()-1);
+		if(match.startsWith(wild_in))
+			return true;
+		
+		return false;
+	}
 
 	public void setSelectionPolicy(Comparator selectionPolicy) {
 		this.selectionPolicy = selectionPolicy;
Index: resolver/src/org/eclipse/osgi/internal/module/VersionHashMap.java
===================================================================
RCS file: /home/eclipse/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/module/VersionHashMap.java,v
retrieving revision 1.5
diff -u -r1.5 VersionHashMap.java
--- resolver/src/org/eclipse/osgi/internal/module/VersionHashMap.java	23 Jan 2006 19:13:00 -0000	1.5
+++ resolver/src/org/eclipse/osgi/internal/module/VersionHashMap.java	9 May 2006 21:27:16 -0000
@@ -28,6 +28,14 @@
 		for (int i = 0; i < versionSuppliers.length; i++)
 			put(versionSuppliers[i].getName(), versionSuppliers[i]);
 	}
+	
+	// AMC
+	
+	Iterator iterator() {
+		return internal.values().iterator();
+	}
+	
+	// END AMC
 
 	public void put(Object key, Object value) {
 		super.put(key, value);
Index: .options
===================================================================
RCS file: /home/eclipse/org.eclipse.osgi/.options,v
retrieving revision 1.14
diff -u -r1.14 .options
--- .options	1 May 2006 17:08:49 -0000	1.14
+++ .options	9 May 2006 21:27:12 -0000
@@ -23,6 +23,9 @@
 # Debug the loading of message bundles
 org.eclipse.osgi/debug/messageBundles=false
 
+# Debug supplements mechanism
+org.eclipse.osgi/debug/supplements=false
+
 # Eclipse adaptor options
 org.eclipse.osgi/eclipseadaptor/debug = false
 org.eclipse.osgi/eclipseadaptor/debug/location = false
Index: core/framework/org/eclipse/osgi/framework/debug/Debug.java
===================================================================
RCS file: /home/eclipse/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/debug/Debug.java,v
retrieving revision 1.17
diff -u -r1.17 Debug.java
--- core/framework/org/eclipse/osgi/framework/debug/Debug.java	1 May 2006 15:37:20 -0000	1.17
+++ core/framework/org/eclipse/osgi/framework/debug/Debug.java	9 May 2006 21:27:12 -0000
@@ -90,6 +90,12 @@
 	public static boolean MONITOR_ACTIVATION = false; // "monitor/bundles"
 
 	/**
+	 * Show info about the supplements mechanism
+	 */
+//	public static  boolean DEBUG_SUPPLEMENTS = Boolean.getBoolean("org.eclipse.osgi.showSupplementsInfo"); //$NON-NLS-1$ //$NON-NLS-2$
+	public static  boolean DEBUG_SUPPLEMENTS = false;  // "debug/supplements"
+
+	/**
 	 * Base debug option key (org.eclispe.osgi).
 	 */
 	public static final String ECLIPSE_OSGI = "org.eclipse.osgi"; //$NON-NLS-1$
@@ -150,6 +156,10 @@
 	 * Message bundles Debug option key.
 	 */
 	public static final String OPTION_DEBUG_MESSAGE_BUNDLES = ECLIPSE_OSGI + "/debug/messageBundles"; //$NON-NLS-1$
+	/**
+	 * Supplements mechansism Debug option key.
+	 */
+	public static final String OPTION_DEBUG_SUPPLEMENTS = ECLIPSE_OSGI + "/debug/supplements"; //$NON-NLS-1$
 
 	static {
 		FrameworkDebugOptions dbgOptions = FrameworkDebugOptions.getDefault();
@@ -168,6 +178,7 @@
 			DEBUG_PACKAGEADMIN = dbgOptions.getBooleanOption(OPTION_DEBUG_PACKAGEADMIN, false);
 			DEBUG_PACKAGEADMIN_TIMING = dbgOptions.getBooleanOption(OPTION_DEBUG_PACKAGEADMIN_TIMING, false) || dbgOptions.getBooleanOption("org.eclipse.core.runtime/debug", false); //$NON-NLS-1$
 			DEBUG_MESSAGE_BUNDLES = dbgOptions.getBooleanOption(OPTION_DEBUG_MESSAGE_BUNDLES, false);
+			DEBUG_SUPPLEMENTS = dbgOptions.getBooleanOption(OPTION_DEBUG_SUPPLEMENTS, false);
 			MONITOR_ACTIVATION = dbgOptions.getBooleanOption(OPTION_MONITOR_ACTIVATION, false);
 		}
 	}
@@ -351,4 +362,4 @@
 		}
 	}
 
-}
+}
\ No newline at end of file
Index: defaultAdaptor/src/org/eclipse/osgi/baseadaptor/loader/ClasspathManager.java
===================================================================
RCS file: /home/eclipse/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/loader/ClasspathManager.java,v
retrieving revision 1.6
diff -u -r1.6 ClasspathManager.java
--- defaultAdaptor/src/org/eclipse/osgi/baseadaptor/loader/ClasspathManager.java	1 May 2006 14:14:24 -0000	1.6
+++ defaultAdaptor/src/org/eclipse/osgi/baseadaptor/loader/ClasspathManager.java	9 May 2006 21:27:14 -0000
@@ -68,6 +68,10 @@
 	 * </p>
 	 */
 	public void initialize() {
+//		String bundleName = data.getSymbolicName();
+//		if (bundleName.equals("org.eclipse.osgi.aspectj.tests")) {
+//			System.out.println("? ClasspathManager.initialize() bundle=" + bundleName);
+//		}
 		entries = buildClasspath(classpath, this, data, classloader.getDomain());
 		ClassLoadingHook[] hooks = data.getAdaptor().getHookRegistry().getClassLoadingHooks();
 		for (int i = 0; i < hooks.length; i++)
@@ -530,4 +534,4 @@
 		return classloader;
 	}
 
-}
+}
\ No newline at end of file

Back to the top