Mercurial > projects > dwt2
comparison org.eclipse.osgi/osgi/src/org/osgi/framework/BundleEvent.d @ 105:bbe49769ec18
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 08 Nov 2009 12:42:30 +0100 |
parents | 12b890a6392a |
children |
comparison
equal
deleted
inserted
replaced
104:88652073d1c2 | 105:bbe49769ec18 |
---|---|
1 /* | 1 /* |
2 * $Header: /cvshome/build/org.osgi.framework/src/org/osgi/framework/BundleEvent.java,v 1.19 2007/02/20 00:14:12 hargrave Exp $ | 2 * $Header: /cvshome/build/org.osgi.framework/src/org/osgi/framework/BundleEvent.java,v 1.19 2007/02/20 00:14:12 hargrave Exp $ |
3 * | 3 * |
4 * Copyright (c) OSGi Alliance (2000, 2007). All Rights Reserved. | 4 * Copyright (c) OSGi Alliance (2000, 2007). All Rights Reserved. |
5 * | 5 * |
6 * Licensed under the Apache License, Version 2.0 (the "License"); | 6 * Licensed under the Apache License, Version 2.0 (the "License"); |
7 * you may not use this file except in compliance with the License. | 7 * you may not use this file except in compliance with the License. |
8 * You may obtain a copy of the License at | 8 * You may obtain a copy of the License at |
9 * | 9 * |
10 * http://www.apache.org/licenses/LICENSE-2.0 | 10 * http://www.apache.org/licenses/LICENSE-2.0 |
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
15 * See the License for the specific language governing permissions and | 15 * See the License for the specific language governing permissions and |
16 * limitations under the License. | 16 * limitations under the License. |
17 */ | 17 */ |
18 | 18 |
19 // Port to the D programming language: | |
20 // Frank Benoit <benoit@tionex.de> | |
19 module org.osgi.framework.BundleEvent; | 21 module org.osgi.framework.BundleEvent; |
20 import org.osgi.framework.Bundle; | 22 |
23 import java.lang.all; | |
24 | |
25 import org.osgi.framework.Bundle; // packageimport | |
21 | 26 |
22 import java.util.EventObject; | 27 import java.util.EventObject; |
23 | 28 |
24 /** | 29 /** |
25 * An event from the Framework describing a bundle lifecycle change. | 30 * An event from the Framework describing a bundle lifecycle change. |
26 * <p> | 31 * <p> |
27 * <code>BundleEvent</code> objects are delivered to | 32 * <code>BundleEvent</code> objects are delivered to |
28 * <code>SynchronousBundleListener</code>s and <code>BundleListener</code>s | 33 * <code>SynchronousBundleListener</code>s and <code>BundleListener</code>s |
29 * when a change occurs in a bundle's lifecycle. A type code is used to identify | 34 * when a change occurs in a bundle's lifecycle. A type code is used to identify |
30 * the event type for future extendability. | 35 * the event type for future extendability. |
31 * | 36 * |
32 * <p> | 37 * <p> |
33 * OSGi Alliance reserves the right to extend the set of types. | 38 * OSGi Alliance reserves the right to extend the set of types. |
34 * | 39 * |
35 * @Immutable | 40 * @Immutable |
36 * @see BundleListener | 41 * @see BundleListener |
37 * @see SynchronousBundleListener | 42 * @see SynchronousBundleListener |
38 * @version $Revision: 1.19 $ | 43 * @version $Revision: 1.19 $ |
39 */ | 44 */ |
52 | 57 |
53 /** | 58 /** |
54 * The bundle has been installed. | 59 * The bundle has been installed. |
55 * <p> | 60 * <p> |
56 * The value of <code>INSTALLED</code> is 0x00000001. | 61 * The value of <code>INSTALLED</code> is 0x00000001. |
57 * | 62 * |
58 * @see BundleContext#installBundle(String) | 63 * @see BundleContext#installBundle(String) |
59 */ | 64 */ |
60 public final static int INSTALLED = 0x00000001; | 65 public final static int INSTALLED = 0x00000001; |
61 | 66 |
62 /** | 67 /** |
65 * The bundle's | 70 * The bundle's |
66 * {@link BundleActivator#start(BundleContext) BundleActivator start} method | 71 * {@link BundleActivator#start(BundleContext) BundleActivator start} method |
67 * has been executed if the bundle has a bundle activator class. | 72 * has been executed if the bundle has a bundle activator class. |
68 * <p> | 73 * <p> |
69 * The value of <code>STARTED</code> is 0x00000002. | 74 * The value of <code>STARTED</code> is 0x00000002. |
70 * | 75 * |
71 * @see Bundle#start() | 76 * @see Bundle#start() |
72 */ | 77 */ |
73 public final static int STARTED = 0x00000002; | 78 public final static int STARTED = 0x00000002; |
74 | 79 |
75 /** | 80 /** |
78 * The bundle's | 83 * The bundle's |
79 * {@link BundleActivator#stop(BundleContext) BundleActivator stop} method | 84 * {@link BundleActivator#stop(BundleContext) BundleActivator stop} method |
80 * has been executed if the bundle has a bundle activator class. | 85 * has been executed if the bundle has a bundle activator class. |
81 * <p> | 86 * <p> |
82 * The value of <code>STOPPED</code> is 0x00000004. | 87 * The value of <code>STOPPED</code> is 0x00000004. |
83 * | 88 * |
84 * @see Bundle#stop() | 89 * @see Bundle#stop() |
85 */ | 90 */ |
86 public final static int STOPPED = 0x00000004; | 91 public final static int STOPPED = 0x00000004; |
87 | 92 |
88 /** | 93 /** |
89 * The bundle has been updated. | 94 * The bundle has been updated. |
90 * <p> | 95 * <p> |
91 * The value of <code>UPDATED</code> is 0x00000008. | 96 * The value of <code>UPDATED</code> is 0x00000008. |
92 * | 97 * |
93 * @see Bundle#update() | 98 * @see Bundle#update() |
94 */ | 99 */ |
95 public final static int UPDATED = 0x00000008; | 100 public final static int UPDATED = 0x00000008; |
96 | 101 |
97 /** | 102 /** |
98 * The bundle has been uninstalled. | 103 * The bundle has been uninstalled. |
99 * <p> | 104 * <p> |
100 * The value of <code>UNINSTALLED</code> is 0x00000010. | 105 * The value of <code>UNINSTALLED</code> is 0x00000010. |
101 * | 106 * |
102 * @see Bundle#uninstall | 107 * @see Bundle#uninstall |
103 */ | 108 */ |
104 public final static int UNINSTALLED = 0x00000010; | 109 public final static int UNINSTALLED = 0x00000010; |
105 | 110 |
106 /** | 111 /** |
107 * The bundle has been resolved. | 112 * The bundle has been resolved. |
108 * <p> | 113 * <p> |
109 * The value of <code>RESOLVED</code> is 0x00000020. | 114 * The value of <code>RESOLVED</code> is 0x00000020. |
110 * | 115 * |
111 * @see Bundle#RESOLVED | 116 * @see Bundle#RESOLVED |
112 * @since 1.3 | 117 * @since 1.3 |
113 */ | 118 */ |
114 public final static int RESOLVED = 0x00000020; | 119 public final static int RESOLVED = 0x00000020; |
115 | 120 |
116 /** | 121 /** |
117 * The bundle has been unresolved. | 122 * The bundle has been unresolved. |
118 * <p> | 123 * <p> |
119 * The value of <code>UNRESOLVED</code> is 0x00000040. | 124 * The value of <code>UNRESOLVED</code> is 0x00000040. |
120 * | 125 * |
121 * @see Bundle#INSTALLED | 126 * @see Bundle#INSTALLED |
122 * @since 1.3 | 127 * @since 1.3 |
123 */ | 128 */ |
124 public final static int UNRESOLVED = 0x00000040; | 129 public final static int UNRESOLVED = 0x00000040; |
125 | 130 |
131 * is about to be called if the bundle has a bundle activator class. This | 136 * is about to be called if the bundle has a bundle activator class. This |
132 * event is only delivered to {@link SynchronousBundleListener}s. It is not | 137 * event is only delivered to {@link SynchronousBundleListener}s. It is not |
133 * delivered to <code>BundleListener</code>s. | 138 * delivered to <code>BundleListener</code>s. |
134 * <p> | 139 * <p> |
135 * The value of <code>STARTING</code> is 0x00000080. | 140 * The value of <code>STARTING</code> is 0x00000080. |
136 * | 141 * |
137 * @see Bundle#start() | 142 * @see Bundle#start() |
138 * @since 1.3 | 143 * @since 1.3 |
139 */ | 144 */ |
140 public final static int STARTING = 0x00000080; | 145 public final static int STARTING = 0x00000080; |
141 | 146 |
147 * is about to be called if the bundle has a bundle activator class. This | 152 * is about to be called if the bundle has a bundle activator class. This |
148 * event is only delivered to {@link SynchronousBundleListener}s. It is not | 153 * event is only delivered to {@link SynchronousBundleListener}s. It is not |
149 * delivered to <code>BundleListener</code>s. | 154 * delivered to <code>BundleListener</code>s. |
150 * <p> | 155 * <p> |
151 * The value of <code>STOPPING</code> is 0x00000100. | 156 * The value of <code>STOPPING</code> is 0x00000100. |
152 * | 157 * |
153 * @see Bundle#stop() | 158 * @see Bundle#stop() |
154 * @since 1.3 | 159 * @since 1.3 |
155 */ | 160 */ |
156 public final static int STOPPING = 0x00000100; | 161 public final static int STOPPING = 0x00000100; |
157 | 162 |
164 * <code>BundleContext</code>. This event is only delivered to | 169 * <code>BundleContext</code>. This event is only delivered to |
165 * {@link SynchronousBundleListener}s. It is not delivered to | 170 * {@link SynchronousBundleListener}s. It is not delivered to |
166 * <code>BundleListener</code>s. | 171 * <code>BundleListener</code>s. |
167 * <p> | 172 * <p> |
168 * The value of <code>LAZY_ACTIVATION</code> is 0x00000200. | 173 * The value of <code>LAZY_ACTIVATION</code> is 0x00000200. |
169 * | 174 * |
170 * @since 1.4 | 175 * @since 1.4 |
171 */ | 176 */ |
172 public final static int LAZY_ACTIVATION = 0x00000200; | 177 public final static int LAZY_ACTIVATION = 0x00000200; |
173 | 178 |
174 /** | 179 /** |
175 * Creates a bundle event of the specified type. | 180 * Creates a bundle event of the specified type. |
176 * | 181 * |
177 * @param type The event type. | 182 * @param type The event type. |
178 * @param bundle The bundle which had a lifecycle change. | 183 * @param bundle The bundle which had a lifecycle change. |
179 */ | 184 */ |
180 | 185 |
181 public this(int type, Bundle bundle) { | 186 public this(int type, Bundle bundle) { |
182 super(cast(Object)bundle); | 187 super(bundle); |
183 this.bundle = bundle; | 188 this.bundle = bundle; |
184 this.type = type; | 189 this.type = type; |
185 } | 190 } |
186 | 191 |
187 /** | 192 /** |
188 * Returns the bundle which had a lifecycle change. This bundle is the | 193 * Returns the bundle which had a lifecycle change. This bundle is the |
189 * source of the event. | 194 * source of the event. |
190 * | 195 * |
191 * @return The bundle that had a change occur in its lifecycle. | 196 * @return The bundle that had a change occur in its lifecycle. |
192 */ | 197 */ |
193 public Bundle getBundle() { | 198 public Bundle getBundle() { |
194 return bundle; | 199 return bundle; |
195 } | 200 } |
206 * <li>{@link #STOPPED} | 211 * <li>{@link #STOPPED} |
207 * <li>{@link #UPDATED} | 212 * <li>{@link #UPDATED} |
208 * <li>{@link #UNRESOLVED} | 213 * <li>{@link #UNRESOLVED} |
209 * <li>{@link #UNINSTALLED} | 214 * <li>{@link #UNINSTALLED} |
210 * </ul> | 215 * </ul> |
211 * | 216 * |
212 * @return The type of lifecycle event. | 217 * @return The type of lifecycle event. |
213 */ | 218 */ |
214 | 219 |
215 public int getType() { | 220 public int getType() { |
216 return type; | 221 return type; |