KickJava   Java API By Example, From Geeks To Geeks.

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


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  * BundleDeltas represent the changes related to an individual bundle between two
15  * states.
16  * <p>
17  * Clients may implement this interface.
18  * </p>
19  * @since 3.1
20  */

21 public interface BundleDelta extends Comparable JavaDoc {
22
23     /**
24      * Delta type constant (bit mask) indicating that the bundle has been added
25      * to the new state.
26      * @see BundleDelta#getType
27      */

28     public static final int ADDED = 0x1;
29     /**
30      * Delta type constant (bit mask) indicating that the bundle is no longer present in
31      * the new state.
32      * @see BundleDelta#getType
33      */

34     public static final int REMOVED = 0x2;
35     /**
36      * Delta type constant (bit mask) indicating that the bundle has been updated
37      * between the old and new state. Note that an update delta may in fact represent
38      * a downgrading of the bundle to a previous version.
39      * @see BundleDelta#getType
40      */

41     public static final int UPDATED = 0x4;
42     /**
43      * Delta type constant (bit mask) indicating that the bundle has become resolved
44      * in the new state.
45      * @see BundleDelta#getType
46      */

47     public static final int RESOLVED = 0x8;
48     /**
49      * Delta type constant (bit mask) indicating that the bundle has become unresolved
50      * in the new state. Note that newly added bundles are unresolved by default and
51      * as such, do not transition to unresolved state so this flag is not set.
52      * @see BundleDelta#getType
53      */

54     public static final int UNRESOLVED = 0x10;
55     /**
56      * Delta type constant (bit mask) indicating that the bundles and packages which this
57      * bundle requires/imports (respectively) have changed in the new state.
58      * @see BundleDelta#getType
59      * @deprecated this type is no longer valid
60      */

61     public static final int LINKAGE_CHANGED = 0x20;
62
63     /**
64      * Delta type constant (bit mask) indicating that the bundles which this
65      * bundle optionally requires have changed in the new state.
66      * @see BundleDelta#getType
67      * @deprecated this type is no longer valid
68      */

69     public static final int OPTIONAL_LINKAGE_CHANGED = 0x40;
70
71     /**
72      * Delta type constant (bit mask) indicating that the this bundle is
73      * pending a removal. Note that bundles with this flag set will also
74      * have the {@link BundleDelta#REMOVED} flag set. A bundle will have
75      * this flag set if it has been removed from the state but has other
76      * existing bundles in the state that depend on it.
77      * @see BundleDelta#getType
78      */

79     public static final int REMOVAL_PENDING = 0x80;
80
81     /**
82      * Delta type constant (bit mask) indicating that the this bundle has
83      * completed a pending removal. A bundle will complete a pending removal only
84      * after it has been re-resolved by the resolver.
85      */

86     public static final int REMOVAL_COMPLETE = 0x100;
87
88     /**
89      * Returns the BundleDescription that this bundle delta is for.
90      * @return the BundleDescription that this bundle delta is for.
91      */

92     public BundleDescription getBundle();
93
94     /**
95      * Returns the type of change which occured. The return value is composed
96      * of by bit-wise masking the relevant flags from the set ADDED, REMOVED,
97      * UPDATED, RESOLVED, UNRESOLVED, LINKAGE_CHANGED, REMOVAL_PENDING, REMOVAL_COMPLETE.
98      * Note that bundle start and stop state changes are not captured in the
99      * delta as they do not represent structural changes but rather transient
100      * runtime states.
101      * @return the type of change which occured
102      */

103     public int getType();
104
105     /**
106      * Answers an integer indicating the relative positions of the receiver and
107      * the argument in the natural order of elements of the receiver's class.
108      * <p>
109      * The natural order of elements is determined by the bundle id of the
110      * BundleDescription that this bundle delta is for.
111      *
112      * @return int which should be <0 if the receiver should sort before the
113      * argument, 0 if the receiver should sort in the same position as
114      * the argument, and >0 if the receiver should sort after the
115      * argument.
116      * @param obj
117      * another BundleDelta an object to compare the receiver to
118      * @exception ClassCastException
119      * if the argument can not be converted into something
120      * comparable with the receiver.
121      */

122     public int compareTo(Object JavaDoc obj);
123 }
124
Popular Tags