KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > osgi > service > resolver > VersionConstraint


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 package org.eclipse.osgi.service.resolver;
12
13 /**
14  * VersionConstraints represent the relationship between two bundles (in the
15  * case of bundle requires) or a bundle and a package (in the case of import/export).
16  * <p>
17  * Clients may implement this interface.
18  * </p>
19  * @since 3.1
20  */

21 public interface VersionConstraint extends Cloneable JavaDoc {
22
23     /**
24      * Returns this constraint's name.
25      *
26      * @return this constraint's name
27      */

28     public String JavaDoc getName();
29
30     /**
31      * Returns the version range for this constraint.
32      * @return the version range for this constraint, or <code>null</code>
33      */

34     public VersionRange getVersionRange();
35
36     /**
37      * Returns the bundle that declares this constraint.
38      *
39      * @return a bundle description
40      */

41     public BundleDescription getBundle();
42
43     /**
44      * Returns whether this constraint is resolved. A resolved constraint
45      * is guaranteed to have its supplier defined.
46      *
47      * @return <code>true</code> if this bundle is resolved, <code>false</code>
48      * otherwise
49      */

50     public boolean isResolved();
51
52     /**
53      * Returns whether this constraint could be satisfied by the given supplier.
54      * This will depend on the suppliers different attributes including its name,
55      * versions and other arbitrary attributes
56      *
57      * @param supplier a supplier to be tested against this constraint (may be
58      * <code>null</code>)
59      * @return <code>true</code> if this constraint could be resolved using the supplier,
60      * <code>false</code> otherwise
61      */

62     public boolean isSatisfiedBy(BaseDescription supplier);
63
64     /**
65      * Returns the supplier that satisfies this constraint, if it is resolved.
66      *
67      * @return a supplier, or <code>null</code>
68      * @see #isResolved()
69      */

70     public BaseDescription getSupplier();
71 }
72
Popular Tags