KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > osgi > internal > module > VersionSupplier


1 /*******************************************************************************
2  * Copyright (c) 2004, 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 package org.eclipse.osgi.internal.module;
12
13 import org.eclipse.osgi.service.resolver.BaseDescription;
14 import org.eclipse.osgi.service.resolver.BundleDescription;
15 import org.osgi.framework.Version;
16
17 /*
18  * A companion to BaseDescription from the state used while resolving.
19  */

20 public abstract class VersionSupplier {
21     BaseDescription base;
22     boolean dropped = false;
23
24     VersionSupplier(BaseDescription base) {
25         this.base = base;
26     }
27
28     public Version getVersion() {
29         return base.getVersion();
30     }
31
32     public String JavaDoc getName() {
33         return base.getName();
34     }
35
36     public BaseDescription getBaseDescription() {
37         return base;
38     }
39
40     // returns true if this version supplier has been dropped and is no longer available as a wire
41
boolean isDropped() {
42         return dropped;
43     }
44
45     // sets the dropped status. This should only be called by the VersionHashMap
46
// when VersionSuppliers are removed
47
void setDropped(boolean dropped) {
48         this.dropped = dropped;
49     }
50
51     /*
52      * returns the BundleDescription which supplies this VersionSupplier
53      */

54     abstract public BundleDescription getBundle();
55
56     public String JavaDoc toString() {
57         return base.toString();
58     }
59 }
60
Popular Tags