Mercurial > projects > dwt2
annotate org.eclipse.osgi/osgi/src/org/osgi/framework/Bundle.d @ 105:bbe49769ec18
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 08 Nov 2009 12:42:30 +0100 |
parents | 0628aaa2996c |
children |
rev | line source |
---|---|
12
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1 /* |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2 * $Header: /cvshome/build/org.osgi.framework/src/org/osgi/framework/Bundle.java,v 1.54 2007/02/21 16:49:05 hargrave Exp $ |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4 * Copyright (c) OSGi Alliance (2000, 2007). All Rights Reserved. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
5 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
6 * Licensed under the Apache License, Version 2.0 (the "License"); |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
7 * you may not use this file except in compliance with the License. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
8 * You may obtain a copy of the License at |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
9 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
10 * http://www.apache.org/licenses/LICENSE-2.0 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
11 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
12 * Unless required by applicable law or agreed to in writing, software |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
13 * distributed under the License is distributed on an "AS IS" BASIS, |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
15 * See the License for the specific language governing permissions and |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
16 * limitations under the License. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
17 */ |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
18 |
105 | 19 // Port to the D programming language: |
20 // Frank Benoit <benoit@tionex.de> | |
72
896cd9e80913
Fix, thanks yidabu for the report.
Frank Benoit <benoit@tionex.de>
parents:
12
diff
changeset
|
21 module org.osgi.framework.Bundle; |
12
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
22 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
23 import java.lang.all; |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
24 |
105 | 25 import org.osgi.framework.BundleException; // packageimport |
26 import org.osgi.framework.ServiceReference; // packageimport | |
27 import org.osgi.framework.BundleContext; // packageimport | |
28 | |
29 import java.io.IOException; | |
30 import java.io.InputStream; | |
31 import java.net.URL; | |
32 import java.util.Dictionary; | |
33 import java.util.Enumeration; | |
12
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
34 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
35 /** |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
36 * An installed bundle in the Framework. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
37 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
38 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
39 * A <code>Bundle</code> object is the access point to define the lifecycle of |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
40 * an installed bundle. Each bundle installed in the OSGi environment must have |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
41 * an associated <code>Bundle</code> object. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
42 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
43 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
44 * A bundle must have a unique identity, a <code>long</code>, chosen by the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
45 * Framework. This identity must not change during the lifecycle of a bundle, |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
46 * even when the bundle is updated. Uninstalling and then reinstalling the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
47 * bundle must create a new unique identity. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
48 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
49 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
50 * A bundle can be in one of six states: |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
51 * <ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
52 * <li>{@link #UNINSTALLED} |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
53 * <li>{@link #INSTALLED} |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
54 * <li>{@link #RESOLVED} |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
55 * <li>{@link #STARTING} |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
56 * <li>{@link #STOPPING} |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
57 * <li>{@link #ACTIVE} |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
58 * </ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
59 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
60 * Values assigned to these states have no specified ordering; they represent |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
61 * bit values that may be ORed together to determine if a bundle is in one of |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
62 * the valid states. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
63 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
64 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
65 * A bundle should only execute code when its state is one of |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
66 * <code>STARTING</code>,<code>ACTIVE</code>, or <code>STOPPING</code>. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
67 * An <code>UNINSTALLED</code> bundle can not be set to another state; it is a |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
68 * zombie and can only be reached because references are kept somewhere. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
69 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
70 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
71 * The Framework is the only entity that is allowed to create |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
72 * <code>Bundle</code> objects, and these objects are only valid within the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
73 * Framework that created them. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
74 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
75 * @ThreadSafe |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
76 * @version $Revision: 1.54 $ |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
77 */ |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
78 public interface Bundle { |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
79 /** |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
80 * The bundle is uninstalled and may not be used. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
81 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
82 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
83 * The <code>UNINSTALLED</code> state is only visible after a bundle is |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
84 * uninstalled; the bundle is in an unusable state but references to the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
85 * <code>Bundle</code> object may still be available and used for |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
86 * introspection. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
87 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
88 * The value of <code>UNINSTALLED</code> is 0x00000001. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
89 */ |
105 | 90 public static final int UNINSTALLED = 0x00000001; |
12
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
91 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
92 /** |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
93 * The bundle is installed but not yet resolved. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
94 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
95 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
96 * A bundle is in the <code>INSTALLED</code> state when it has been |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
97 * installed in the Framework but is not or cannot be resolved. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
98 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
99 * This state is visible if the bundle's code dependencies are not resolved. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
100 * The Framework may attempt to resolve an <code>INSTALLED</code> bundle's |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
101 * code dependencies and move the bundle to the <code>RESOLVED</code> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
102 * state. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
103 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
104 * The value of <code>INSTALLED</code> is 0x00000002. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
105 */ |
105 | 106 public static final int INSTALLED = 0x00000002; |
12
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
107 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
108 /** |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
109 * The bundle is resolved and is able to be started. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
110 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
111 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
112 * A bundle is in the <code>RESOLVED</code> state when the Framework has |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
113 * successfully resolved the bundle's code dependencies. These dependencies |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
114 * include: |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
115 * <ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
116 * <li>The bundle's class path from its {@link Constants#BUNDLE_CLASSPATH} |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
117 * Manifest header. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
118 * <li>The bundle's package dependencies from its |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
119 * {@link Constants#EXPORT_PACKAGE} and {@link Constants#IMPORT_PACKAGE} |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
120 * Manifest headers. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
121 * <li>The bundle's required bundle dependencies from its |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
122 * {@link Constants#REQUIRE_BUNDLE} Manifest header. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
123 * <li>A fragment bundle's host dependency from its |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
124 * {@link Constants#FRAGMENT_HOST} Manifest header. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
125 * </ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
126 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
127 * Note that the bundle is not active yet. A bundle must be put in the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
128 * <code>RESOLVED</code> state before it can be started. The Framework may |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
129 * attempt to resolve a bundle at any time. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
130 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
131 * The value of <code>RESOLVED</code> is 0x00000004. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
132 */ |
105 | 133 public static final int RESOLVED = 0x00000004; |
12
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
134 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
135 /** |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
136 * The bundle is in the process of starting. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
137 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
138 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
139 * A bundle is in the <code>STARTING</code> state when its |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
140 * {@link #start(int) start} method is active. A bundle must be in this |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
141 * state when the bundle's {@link BundleActivator#start} is called. If the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
142 * <code>BundleActivator.start</code> method completes without exception, |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
143 * then the bundle has successfully started and must move to the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
144 * <code>ACTIVE</code> state. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
145 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
146 * If the bundle has a |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
147 * {@link Constants#ACTIVATION_LAZY lazy activation policy}, then the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
148 * bundle may remain in this state for some time until the activation is |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
149 * triggered. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
150 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
151 * The value of <code>STARTING</code> is 0x00000008. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
152 */ |
105 | 153 public static final int STARTING = 0x00000008; |
12
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
154 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
155 /** |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
156 * The bundle is in the process of stopping. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
157 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
158 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
159 * A bundle is in the <code>STOPPING</code> state when its |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
160 * {@link #stop(int) stop} method is active. A bundle must be in this state |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
161 * when the bundle's {@link BundleActivator#stop} method is called. When the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
162 * <code>BundleActivator.stop</code> method completes the bundle is |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
163 * stopped and must move to the <code>RESOLVED</code> state. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
164 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
165 * The value of <code>STOPPING</code> is 0x00000010. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
166 */ |
105 | 167 public static final int STOPPING = 0x00000010; |
12
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
168 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
169 /** |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
170 * The bundle is now running. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
171 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
172 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
173 * A bundle is in the <code>ACTIVE</code> state when it has been |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
174 * successfully started and activated. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
175 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
176 * The value of <code>ACTIVE</code> is 0x00000020. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
177 */ |
105 | 178 public static final int ACTIVE = 0x00000020; |
12
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
179 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
180 /** |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
181 * The bundle start operation is transient and the persistent autostart |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
182 * setting of the bundle is not modified. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
183 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
184 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
185 * This bit may be set when calling {@link #start(int)} to notify the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
186 * framework that the autostart setting of the bundle must not be modified. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
187 * If this bit is not set, then the autostart setting of the bundle is |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
188 * modified. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
189 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
190 * @since 1.4 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
191 * @see #start(int) |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
192 */ |
105 | 193 public static final int START_TRANSIENT = 0x00000001; |
12
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
194 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
195 /** |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
196 * The bundle start operation must activate the bundle according to the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
197 * bundle's declared |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
198 * {@link Constants#BUNDLE_ACTIVATIONPOLICY activation policy}. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
199 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
200 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
201 * This bit may be set when calling {@link #start(int)} to notify the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
202 * framework that the bundle must be activated using the bundle's declared |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
203 * activation policy. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
204 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
205 * @since 1.4 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
206 * @see Constants#BUNDLE_ACTIVATIONPOLICY |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
207 * @see #start(int) |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
208 */ |
105 | 209 public static final int START_ACTIVATION_POLICY = 0x00000002; |
12
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
210 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
211 /** |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
212 * The bundle stop is transient and the persistent autostart setting of the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
213 * bundle is not modified. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
214 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
215 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
216 * This bit may be set when calling {@link #stop(int)} to notify the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
217 * framework that the autostart setting of the bundle must not be modified. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
218 * If this bit is not set, then the autostart setting of the bundle is |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
219 * modified. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
220 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
221 * @since 1.4 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
222 * @see #stop(int) |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
223 */ |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
224 public static final int STOP_TRANSIENT = 0x00000001; |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
225 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
226 /** |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
227 * Returns this bundle's current state. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
228 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
229 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
230 * A bundle can be in only one state at any time. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
231 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
232 * @return An element of <code>UNINSTALLED</code>,<code>INSTALLED</code>, |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
233 * <code>RESOLVED</code>,<code>STARTING</code>, |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
234 * <code>STOPPING</code>,<code>ACTIVE</code>. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
235 */ |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
236 public int getState(); |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
237 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
238 /** |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
239 * Starts this bundle. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
240 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
241 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
242 * If this bundle's state is <code>UNINSTALLED</code> then an |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
243 * <code>IllegalStateException</code> is thrown. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
244 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
245 * If the Framework implements the optional Start Level service and the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
246 * current start level is less than this bundle's start level: |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
247 * <ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
248 * <li>If the {@link #START_TRANSIENT} option is set, then a |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
249 * <code>BundleException</code> is thrown indicating this bundle cannot be |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
250 * started due to the Framework's current start level. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
251 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
252 * <li>Otherwise, the Framework must set this bundle's persistent autostart |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
253 * setting to <em>Started with declared activation</em> if the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
254 * {@link #START_ACTIVATION_POLICY} option is set or |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
255 * <em>Started with eager activation</em> if not set. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
256 * </ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
257 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
258 * When the Framework's current start level becomes equal to or more than |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
259 * this bundle's start level, this bundle will be started. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
260 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
261 * Otherwise, the following steps are required to start this bundle: |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
262 * <ol> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
263 * <li>If this bundle is in the process of being activated or deactivated |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
264 * then this method must wait for activation or deactivation to complete |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
265 * before continuing. If this does not occur in a reasonable time, a |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
266 * <code>BundleException</code> is thrown to indicate this bundle was |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
267 * unable to be started. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
268 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
269 * <li>If this bundle's state is <code>ACTIVE</code> then this method |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
270 * returns immediately. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
271 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
272 * <li>If the {@link #START_TRANSIENT} option is not set then set this |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
273 * bundle's autostart setting to <em>Started with declared activation</em> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
274 * if the {@link #START_ACTIVATION_POLICY} option is set or |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
275 * <em>Started with eager activation</em> if not set. When the Framework |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
276 * is restarted and this bundle's autostart setting is not <em>Stopped</em>, |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
277 * this bundle must be automatically started. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
278 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
279 * <li>If this bundle's state is not <code>RESOLVED</code>, an attempt |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
280 * is made to resolve this bundle. If the Framework cannot resolve this |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
281 * bundle, a <code>BundleException</code> is thrown. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
282 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
283 * <li>If the {@link #START_ACTIVATION_POLICY} option is set and this |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
284 * bundle's declared activation policy is |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
285 * {@link Constants#ACTIVATION_LAZY lazy} then: |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
286 * <ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
287 * <li>If this bundle's state is <code>STARTING</code> then this method |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
288 * returns immediately. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
289 * <li>This bundle's state is set to <code>STARTING</code>. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
290 * <li>A bundle event of type {@link BundleEvent#LAZY_ACTIVATION} is fired. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
291 * <li>This method returns immediately and the remaining steps will be |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
292 * followed when this bundle's activation is later triggered. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
293 * </ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
294 * <i></i> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
295 * <li>This bundle's state is set to <code>STARTING</code>. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
296 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
297 * <li>A bundle event of type {@link BundleEvent#STARTING} is fired. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
298 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
299 * <li>The {@link BundleActivator#start} method of this bundle's |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
300 * <code>BundleActivator</code>, if one is specified, is called. If the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
301 * <code>BundleActivator</code> is invalid or throws an exception then: |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
302 * <ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
303 * <li>This bundle's state is set to <code>STOPPING</code>. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
304 * <li>A bundle event of type {@link BundleEvent#STOPPING} is fired. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
305 * <li>Any services registered by this bundle must be unregistered. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
306 * <li>Any services used by this bundle must be released. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
307 * <li>Any listeners registered by this bundle must be removed. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
308 * <li>This bundle's state is set to <code>RESOLVED</code>. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
309 * <li>A bundle event of type {@link BundleEvent#STOPPED} is fired. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
310 * <li>A <code>BundleException</code> is then thrown. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
311 * </ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
312 * <i></i> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
313 * <li>If this bundle's state is <code>UNINSTALLED</code>, because this |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
314 * bundle was uninstalled while the <code>BundleActivator.start</code> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
315 * method was running, a <code>BundleException</code> is thrown. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
316 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
317 * <li>This bundle's state is set to <code>ACTIVE</code>. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
318 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
319 * <li>A bundle event of type {@link BundleEvent#STARTED} is fired. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
320 * </ol> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
321 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
322 * <b>Preconditions </b> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
323 * <ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
324 * <li><code>getState()</code> in {<code>INSTALLED</code>, |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
325 * <code>RESOLVED</code>} or {<code>INSTALLED</code>, |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
326 * <code>RESOLVED</code>, <code>STARTING</code>} if this bundle has a |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
327 * lazy activation policy. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
328 * </ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
329 * <b>Postconditions, no exceptions thrown </b> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
330 * <ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
331 * <li>Bundle autostart setting is modified unless the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
332 * {@link #START_TRANSIENT} option was set. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
333 * <li><code>getState()</code> in {<code>ACTIVE</code>} unless the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
334 * lazy activation policy was used. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
335 * <li><code>BundleActivator.start()</code> has been called and did not |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
336 * throw an exception unless the lazy activation policy was used. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
337 * </ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
338 * <b>Postconditions, when an exception is thrown </b> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
339 * <ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
340 * <li>Depending on when the exception occurred, bundle autostart setting |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
341 * is modified unless the {@link #START_TRANSIENT} option was set. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
342 * <li><code>getState()</code> not in {<code>STARTING</code>, |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
343 * <code>ACTIVE</code>}. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
344 * </ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
345 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
346 * @param options The options for starting this bundle. See |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
347 * {@link #START_TRANSIENT} and {@link #START_ACTIVATION_POLICY}. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
348 * The Framework must ignore unrecognized options. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
349 * @throws BundleException If this bundle could not be started. This could |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
350 * be because a code dependency could not be resolved or the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
351 * specified <code>BundleActivator</code> could not be loaded or |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
352 * threw an exception or this bundle is a fragment. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
353 * @throws java.lang.IllegalStateException If this bundle has been |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
354 * uninstalled or this bundle tries to change its own state. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
355 * @throws java.lang.SecurityException If the caller does not have the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
356 * appropriate <code>AdminPermission[this,EXECUTE]</code>, and |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
357 * the Java Runtime Environment supports permissions. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
358 * @since 1.4 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
359 */ |
105 | 360 public void start(int options) ; |
12
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
361 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
362 /** |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
363 * Starts this bundle with no options. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
364 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
365 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
366 * This method calls <code>start(0)</code>. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
367 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
368 * @throws BundleException If this bundle could not be started. This could |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
369 * be because a code dependency could not be resolved or the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
370 * specified <code>BundleActivator</code> could not be loaded or |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
371 * threw an exception or this bundle is a fragment. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
372 * @throws java.lang.IllegalStateException If this bundle has been |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
373 * uninstalled or this bundle tries to change its own state. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
374 * @throws java.lang.SecurityException If the caller does not have the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
375 * appropriate <code>AdminPermission[this,EXECUTE]</code>, and |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
376 * the Java Runtime Environment supports permissions. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
377 * @see #start(int) |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
378 */ |
105 | 379 public void start() ; |
12
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
380 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
381 /** |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
382 * Stops this bundle. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
383 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
384 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
385 * The following steps are required to stop a bundle: |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
386 * <ol> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
387 * <li>If this bundle's state is <code>UNINSTALLED</code> then an |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
388 * <code>IllegalStateException</code> is thrown. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
389 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
390 * <li>If this bundle is in the process of being activated or deactivated |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
391 * then this method must wait for activation or deactivation to complete |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
392 * before continuing. If this does not occur in a reasonable time, a |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
393 * <code>BundleException</code> is thrown to indicate this bundle was |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
394 * unable to be stopped. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
395 * <li>If the {@link #STOP_TRANSIENT} option is not set then then set this |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
396 * bundle's persistent autostart setting to to <em>Stopped</em>. When the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
397 * Framework is restarted and this bundle's autostart setting is |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
398 * <em>Stopped</em>, this bundle must not be automatically started. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
399 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
400 * <li>If this bundle's state is not <code>ACTIVE</code> then this method |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
401 * returns immediately. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
402 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
403 * <li>This bundle's state is set to <code>STOPPING</code>. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
404 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
405 * <li>A bundle event of type {@link BundleEvent#STOPPING} is fired. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
406 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
407 * <li>The {@link BundleActivator#stop} method of this bundle's |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
408 * <code>BundleActivator</code>, if one is specified, is called. If that |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
409 * method throws an exception, this method must continue to stop this |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
410 * bundle. A <code>BundleException</code> must be thrown after completion |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
411 * of the remaining steps. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
412 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
413 * <li>Any services registered by this bundle must be unregistered. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
414 * <li>Any services used by this bundle must be released. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
415 * <li>Any listeners registered by this bundle must be removed. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
416 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
417 * <li>If this bundle's state is <code>UNINSTALLED</code>, because this |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
418 * bundle was uninstalled while the <code>BundleActivator.stop</code> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
419 * method was running, a <code>BundleException</code> must be thrown. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
420 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
421 * <li>This bundle's state is set to <code>RESOLVED</code>. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
422 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
423 * <li>A bundle event of type {@link BundleEvent#STOPPED} is fired. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
424 * </ol> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
425 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
426 * <b>Preconditions </b> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
427 * <ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
428 * <li><code>getState()</code> in {<code>ACTIVE</code>}. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
429 * </ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
430 * <b>Postconditions, no exceptions thrown </b> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
431 * <ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
432 * <li>Bundle autostart setting is modified unless the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
433 * {@link #STOP_TRANSIENT} option was set. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
434 * <li><code>getState()</code> not in {<code>ACTIVE</code>, |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
435 * <code>STOPPING</code>}. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
436 * <li><code>BundleActivator.stop</code> has been called and did not |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
437 * throw an exception. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
438 * </ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
439 * <b>Postconditions, when an exception is thrown </b> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
440 * <ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
441 * <li>Bundle autostart setting is modified unless the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
442 * {@link #STOP_TRANSIENT} option was set. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
443 * </ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
444 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
445 * @param options The options for stoping this bundle. See |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
446 * {@link #STOP_TRANSIENT}. The Framework must ignore unrecognized |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
447 * options. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
448 * @throws BundleException If this bundle's <code>BundleActivator</code> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
449 * threw an exception or this bundle is a fragment. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
450 * @throws java.lang.IllegalStateException If this bundle has been |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
451 * uninstalled or this bundle tries to change its own state. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
452 * @throws java.lang.SecurityException If the caller does not have the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
453 * appropriate <code>AdminPermission[this,EXECUTE]</code>, and |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
454 * the Java Runtime Environment supports permissions. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
455 * @since 1.4 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
456 */ |
105 | 457 public void stop(int options) ; |
12
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
458 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
459 /** |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
460 * Stops this bundle with no options. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
461 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
462 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
463 * This method calls <code>stop(0)</code>. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
464 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
465 * @throws BundleException If this bundle's <code>BundleActivator</code> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
466 * threw an exception or this bundle is a fragment. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
467 * @throws java.lang.IllegalStateException If this bundle has been |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
468 * uninstalled or this bundle tries to change its own state. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
469 * @throws java.lang.SecurityException If the caller does not have the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
470 * appropriate <code>AdminPermission[this,EXECUTE]</code>, and |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
471 * the Java Runtime Environment supports permissions. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
472 * @see #start(int) |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
473 */ |
105 | 474 public void stop() ; |
12
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
475 |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
476 /** |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
477 * Updates this bundle. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
478 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
479 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
480 * If this bundle's state is <code>ACTIVE</code>, it must be stopped |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
481 * before the update and started after the update successfully completes. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
482 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
483 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
484 * If this bundle has exported any packages, these packages must not be |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
485 * updated. Instead, the previous package version must remain exported until |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
486 * the <code>PackageAdmin.refreshPackages</code> method has been has been |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
487 * called or the Framework is relaunched. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
488 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
489 * <p> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
490 * The following steps are required to update a bundle: |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
491 * <ol> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
492 * <li>If this bundle's state is <code>UNINSTALLED</code> then an |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
493 * <code>IllegalStateException</code> is thrown. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
494 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
495 * <li>If this bundle's state is <code>ACTIVE</code>, |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
496 * <code>STARTING</code> or <code>STOPPING</code>, this bundle is |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
497 * stopped as described in the <code>Bundle.stop</code> method. If |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
498 * <code>Bundle.stop</code> throws an exception, the exception is rethrown |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
499 * terminating the update. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
500 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
501 * <li>The download location of the new version of this bundle is |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
502 * determined from either this bundle's |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
503 * {@link Constants#BUNDLE_UPDATELOCATION} Manifest header (if available) or |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
504 * this bundle's original location. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
505 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
506 * <li>The location is interpreted in an implementation dependent manner, |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
507 * typically as a URL, and the new version of this bundle is obtained from |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
508 * this location. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
509 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
510 * <li>The new version of this bundle is installed. If the Framework is |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
511 * unable to install the new version of this bundle, the original version of |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
512 * this bundle must be restored and a <code>BundleException</code> must be |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
513 * thrown after completion of the remaining steps. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
514 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
515 * <li>If this bundle has declared an Bundle-RequiredExecutionEnvironment |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
516 * header, then the listed execution environments must be verified against |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
517 * the installed execution environments. If they do not all match, the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
518 * original version of this bundle must be restored and a |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
519 * <code>BundleException</code> must be thrown after completion of the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
520 * remaining steps. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
521 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
522 * <li>This bundle's state is set to <code>INSTALLED</code>. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
523 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
524 * <li>If the new version of this bundle was successfully installed, a |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
525 * bundle event of type {@link BundleEvent#UPDATED} is fired. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
526 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
527 * <li>If this bundle's state was originally <code>ACTIVE</code>, the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
528 * updated bundle is started as described in the <code>Bundle.start</code> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
529 * method. If <code>Bundle.start</code> throws an exception, a Framework |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
530 * event of type {@link FrameworkEvent#ERROR} is fired containing the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
531 * exception. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
532 * </ol> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
533 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
534 * <b>Preconditions </b> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
535 * <ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
536 * <li><code>getState()</code> not in {<code>UNINSTALLED</code>}. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
537 * </ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
538 * <b>Postconditions, no exceptions thrown </b> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
539 * <ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
540 * <li><code>getState()</code> in {<code>INSTALLED</code>, |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
541 * <code>RESOLVED</code>,<code>ACTIVE</code>}. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
542 * <li>This bundle has been updated. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
543 * </ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
544 * <b>Postconditions, when an exception is thrown </b> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
545 * <ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
546 * <li><code>getState()</code> in {<code>INSTALLED</code>, |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
547 * <code>RESOLVED</code>,<code>ACTIVE</code>}. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
548 * <li>Original bundle is still used; no update occurred. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
549 * </ul> |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
550 * |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
551 * @throws BundleException If the update fails. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
552 * @throws java.lang.IllegalStateException If this bundle has been |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
553 * uninstalled or this bundle tries to change its own state. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
554 * @throws java.lang.SecurityException If the caller does not have the |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
555 * appropriate <code>AdminPermission[this,LIFECYCLE]</code> for |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
556 * both the current bundle and the updated bundle, and the Java |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
557 * Runtime Environment supports permissions. |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
558 * @see #stop() |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
559 * @see #start() |
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
560 */ |
105 | 561 public void update() ; |
562 | |
563 /** | |
564 * Updates this bundle from an <code>InputStream</code>. | |
565 * | |
566 * <p> | |
567 * This method performs all the steps listed in <code>Bundle.update()</code>, | |
568 * except the new version of this bundle must be read from the supplied | |
569 * <code>InputStream</code>, rather than a <code>URL</code>. | |
570 * <p> | |
571 * This method must always close the <code>InputStream</code> when it is | |
572 * done, even if an exception is thrown. | |
573 * | |
574 * @param in The <code>InputStream</code> from which to read the new | |
575 * bundle. | |
576 * @throws BundleException If the provided stream cannot be read or the | |
577 * update fails. | |
578 * @throws java.lang.IllegalStateException If this bundle has been | |
579 * uninstalled or this bundle tries to change its own state. | |
580 * @throws java.lang.SecurityException If the caller does not have the | |
581 * appropriate <code>AdminPermission[this,LIFECYCLE]</code> for | |
582 * both the current bundle and the updated bundle, and the Java | |
583 * Runtime Environment supports permissions. | |
584 * @see #update() | |
585 */ | |
586 public void update(InputStream in_) ; | |
587 | |
588 /** | |
589 * Uninstalls this bundle. | |
590 * | |
591 * <p> | |
592 * This method causes the Framework to notify other bundles that this bundle | |
593 * is being uninstalled, and then puts this bundle into the | |
594 * <code>UNINSTALLED</code> state. The Framework must remove any resources | |
595 * related to this bundle that it is able to remove. | |
596 * | |
597 * <p> | |
598 * If this bundle has exported any packages, the Framework must continue to | |
599 * make these packages available to their importing bundles until the | |
600 * <code>PackageAdmin.refreshPackages</code> method has been called or the | |
601 * Framework is relaunched. | |
602 * | |
603 * <p> | |
604 * The following steps are required to uninstall a bundle: | |
605 * <ol> | |
606 * <li>If this bundle's state is <code>UNINSTALLED</code> then an | |
607 * <code>IllegalStateException</code> is thrown. | |
608 * | |
609 * <li>If this bundle's state is <code>ACTIVE</code>, | |
610 * <code>STARTING</code> or <code>STOPPING</code>, this bundle is | |
611 * stopped as described in the <code>Bundle.stop</code> method. If | |
612 * <code>Bundle.stop</code> throws an exception, a Framework event of type | |
613 * {@link FrameworkEvent#ERROR} is fired containing the exception. | |
614 * | |
615 * <li>This bundle's state is set to <code>UNINSTALLED</code>. | |
616 * | |
617 * <li>A bundle event of type {@link BundleEvent#UNINSTALLED} is fired. | |
618 * | |
619 * <li>This bundle and any persistent storage area provided for this bundle | |
620 * by the Framework are removed. | |
621 * </ol> | |
622 * | |
623 * <b>Preconditions </b> | |
624 * <ul> | |
625 * <li><code>getState()</code> not in {<code>UNINSTALLED</code>}. | |
626 * </ul> | |
627 * <b>Postconditions, no exceptions thrown </b> | |
628 * <ul> | |
629 * <li><code>getState()</code> in {<code>UNINSTALLED</code>}. | |
630 * <li>This bundle has been uninstalled. | |
631 * </ul> | |
632 * <b>Postconditions, when an exception is thrown </b> | |
633 * <ul> | |
634 * <li><code>getState()</code> not in {<code>UNINSTALLED</code>}. | |
635 * <li>This Bundle has not been uninstalled. | |
636 * </ul> | |
637 * | |
638 * @throws BundleException If the uninstall failed. This can occur if | |
639 * another thread is attempting to change this bundle's state and | |
640 * does not complete in a timely manner. | |
641 * @throws java.lang.IllegalStateException If this bundle has been | |
642 * uninstalled or this bundle tries to change its own state. | |
643 * @throws java.lang.SecurityException If the caller does not have the | |
644 * appropriate <code>AdminPermission[this,LIFECYCLE]</code>, and | |
645 * the Java Runtime Environment supports permissions. | |
646 * @see #stop() | |
647 */ | |
648 public void uninstall() ; | |
649 | |
650 /** | |
651 * Returns this bundle's Manifest headers and values. This method returns | |
652 * all the Manifest headers and values from the main section of this | |
653 * bundle's Manifest file; that is, all lines prior to the first blank line. | |
654 * | |
655 * <p> | |
656 * Manifest header names are case-insensitive. The methods of the returned | |
657 * <code>Dictionary</code> object must operate on header names in a | |
658 * case-insensitive manner. | |
659 * | |
660 * If a Manifest header value starts with "%", it must be | |
661 * localized according to the default locale. | |
662 * | |
663 * <p> | |
664 * For example, the following Manifest headers and values are included if | |
665 * they are present in the Manifest file: | |
666 * | |
667 * <pre> | |
668 * Bundle-Name | |
669 * Bundle-Vendor | |
670 * Bundle-Version | |
671 * Bundle-Description | |
672 * Bundle-DocURL | |
673 * Bundle-ContactAddress | |
674 * </pre> | |
675 * | |
676 * <p> | |
677 * This method must continue to return Manifest header information while | |
678 * this bundle is in the <code>UNINSTALLED</code> state. | |
679 * | |
680 * @return A <code>Dictionary</code> object containing this bundle's | |
681 * Manifest headers and values. | |
682 * | |
683 * @throws java.lang.SecurityException If the caller does not have the | |
684 * appropriate <code>AdminPermission[this,METADATA]</code>, and | |
685 * the Java Runtime Environment supports permissions. | |
686 * | |
687 * @see Constants#BUNDLE_LOCALIZATION | |
688 */ | |
689 public Dictionary getHeaders(); | |
690 | |
691 /** | |
692 * Returns this bundle's unique identifier. This bundle is assigned a unique | |
693 * identifier by the Framework when it was installed in the OSGi | |
694 * environment. | |
695 * | |
696 * <p> | |
697 * A bundle's unique identifier has the following attributes: | |
698 * <ul> | |
699 * <li>Is unique and persistent. | |
700 * <li>Is a <code>long</code>. | |
701 * <li>Its value is not reused for another bundle, even after a bundle is | |
702 * uninstalled. | |
703 * <li>Does not change while a bundle remains installed. | |
704 * <li>Does not change when a bundle is updated. | |
705 * </ul> | |
706 * | |
707 * <p> | |
708 * This method must continue to return this bundle's unique identifier while | |
709 * this bundle is in the <code>UNINSTALLED</code> state. | |
710 * | |
711 * @return The unique identifier of this bundle. | |
712 */ | |
713 public long getBundleId(); | |
714 | |
715 /** | |
716 * Returns this bundle's location identifier. | |
717 * | |
718 * <p> | |
719 * The location identifier is the location passed to | |
720 * <code>BundleContext.installBundle</code> when a bundle is installed. | |
721 * The location identifier does not change while this bundle remains | |
722 * installed, even if this bundle is updated. | |
723 * | |
724 * <p> | |
725 * This method must continue to return this bundle's location identifier | |
726 * while this bundle is in the <code>UNINSTALLED</code> state. | |
727 * | |
728 * @return The string representation of this bundle's location identifier. | |
729 * @throws java.lang.SecurityException If the caller does not have the | |
730 * appropriate <code>AdminPermission[this,METADATA]</code>, and | |
731 * the Java Runtime Environment supports permissions. | |
732 */ | |
733 public String getLocation(); | |
734 | |
735 /** | |
736 * Returns this bundle's <code>ServiceReference</code> list for all | |
737 * services it has registered or <code>null</code> if this bundle has no | |
738 * registered services. | |
739 * | |
740 * <p> | |
741 * If the Java runtime supports permissions, a <code>ServiceReference</code> | |
742 * object to a service is included in the returned list only if the caller | |
743 * has the <code>ServicePermission</code> to get the service using at | |
744 * least one of the named classes the service was registered under. | |
745 * | |
746 * <p> | |
747 * The list is valid at the time of the call to this method, however, as the | |
748 * Framework is a very dynamic environment, services can be modified or | |
749 * unregistered at anytime. | |
750 * | |
751 * @return An array of <code>ServiceReference</code> objects or | |
752 * <code>null</code>. | |
753 * @throws java.lang.IllegalStateException If this bundle has been | |
754 * uninstalled. | |
755 * @see ServiceRegistration | |
756 * @see ServiceReference | |
757 * @see ServicePermission | |
758 */ | |
759 public ServiceReference[] getRegisteredServices(); | |
760 | |
761 /** | |
762 * Returns this bundle's <code>ServiceReference</code> list for all | |
763 * services it is using or returns <code>null</code> if this bundle is not | |
764 * using any services. A bundle is considered to be using a service if its | |
765 * use count for that service is greater than zero. | |
766 * | |
767 * <p> | |
768 * If the Java Runtime Environment supports permissions, a | |
769 * <code>ServiceReference</code> object to a service is included in the | |
770 * returned list only if the caller has the <code>ServicePermission</code> | |
771 * to get the service using at least one of the named classes the service | |
772 * was registered under. | |
773 * <p> | |
774 * The list is valid at the time of the call to this method, however, as the | |
775 * Framework is a very dynamic environment, services can be modified or | |
776 * unregistered at anytime. | |
777 * | |
778 * @return An array of <code>ServiceReference</code> objects or | |
779 * <code>null</code>. | |
780 * @throws java.lang.IllegalStateException If this bundle has been | |
781 * uninstalled. | |
782 * @see ServiceReference | |
783 * @see ServicePermission | |
784 */ | |
785 public ServiceReference[] getServicesInUse(); | |
786 | |
787 /** | |
788 * Determines if this bundle has the specified permissions. | |
789 * | |
790 * <p> | |
791 * If the Java Runtime Environment does not support permissions, this method | |
792 * always returns <code>true</code>. | |
793 * <p> | |
794 * <code>permission</code> is of type <code>Object</code> to avoid | |
795 * referencing the <code>java.security.Permission</code> class directly. | |
796 * This is to allow the Framework to be implemented in Java environments | |
797 * which do not support permissions. | |
798 * | |
799 * <p> | |
800 * If the Java Runtime Environment does support permissions, this bundle and | |
801 * all its resources including embedded JAR files, belong to the same | |
802 * <code>java.security.ProtectionDomain</code>; that is, they must share | |
803 * the same set of permissions. | |
804 * | |
805 * @param permission The permission to verify. | |
806 * | |
807 * @return <code>true</code> if this bundle has the specified permission | |
808 * or the permissions possessed by this bundle imply the specified | |
809 * permission; <code>false</code> if this bundle does not have the | |
810 * specified permission or <code>permission</code> is not an | |
811 * <code>instanceof</code> <code>java.security.Permission</code>. | |
812 * | |
813 * @throws java.lang.IllegalStateException If this bundle has been | |
814 * uninstalled. | |
815 */ | |
816 public bool hasPermission(Object permission); | |
12
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
817 |
105 | 818 /** |
819 * Find the specified resource from this bundle. | |
820 * | |
821 * This bundle's class loader is called to search for the specified | |
822 * resource. If this bundle's state is <code>INSTALLED</code>, this | |
823 * method must attempt to resolve this bundle before attempting to get the | |
824 * specified resource. If this bundle cannot be resolved, then only this | |
825 * bundle must be searched for the specified resource. Imported packages | |
826 * cannot be searched when this bundle has not been resolved. If this bundle | |
827 * is a fragment bundle then <code>null</code> is returned. | |
828 * | |
829 * @param name The name of the resource. See | |
830 * <code>java.lang.ClassLoader.getResource</code> for a description | |
831 * of the format of a resource name. | |
832 * @return A URL to the named resource, or <code>null</code> if the | |
833 * resource could not be found or if this bundle is a fragment | |
834 * bundle or if the caller does not have the appropriate | |
835 * <code>AdminPermission[this,RESOURCE]</code>, and the Java | |
836 * Runtime Environment supports permissions. | |
837 * | |
838 * @since 1.1 | |
839 * @throws java.lang.IllegalStateException If this bundle has been | |
840 * uninstalled. | |
841 * @see #getEntry | |
842 * @see #findEntries | |
843 */ | |
844 public URL getResource(String name); | |
845 | |
846 /** | |
847 * Returns this bundle's Manifest headers and values localized to the | |
848 * specified locale. | |
849 * | |
850 * <p> | |
851 * This method performs the same function as | |
852 * <code>Bundle.getHeaders()</code> except the manifest header values are | |
853 * localized to the specified locale. | |
854 * | |
855 * <p> | |
856 * If a Manifest header value starts with "%", it must be | |
857 * localized according to the specified locale. If a locale is specified and | |
858 * cannot be found, then the header values must be returned using the | |
859 * default locale. Localizations are searched for in the following order: | |
860 * | |
861 * <pre> | |
862 * bn + "_" + Ls + "_" + Cs + "_" + Vs | |
863 * bn + "_" + Ls + "_" + Cs | |
864 * bn + "_" + Ls | |
865 * bn + "_" + Ld + "_" + Cd + "_" + Vd | |
866 * bn + "_" + Ld + "_" + Cd | |
867 * bn + "_" + Ld | |
868 * bn | |
869 * </pre> | |
870 * | |
871 * Where <code>bn</code> is this bundle's localization basename, | |
872 * <code>Ls</code>, <code>Cs</code> and <code>Vs</code> are the | |
873 * specified locale (language, country, variant) and <code>Ld</code>, | |
874 * <code>Cd</code> and <code>Vd</code> are the default locale (language, | |
875 * country, variant). | |
876 * | |
877 * If <code>null</code> is specified as the locale string, the header | |
878 * values must be localized using the default locale. If the empty string | |
879 * ("") is specified as the locale string, the header values must | |
880 * not be localized and the raw (unlocalized) header values, including any | |
881 * leading "%", must be returned. | |
882 * | |
883 * <p> | |
884 * This method must continue to return Manifest header information while | |
885 * this bundle is in the <code>UNINSTALLED</code> state, however the | |
886 * header values must only be available in the raw and default locale | |
887 * values. | |
888 * | |
889 * @param locale The locale name into which the header values are to be | |
890 * localized. If the specified locale is <code>null</code> then the | |
891 * locale returned by <code>java.util.Locale.getDefault</code> is | |
892 * used. If the specified locale is the empty string, this method | |
893 * will return the raw (unlocalized) manifest headers including any | |
894 * leading "%". | |
895 * @return A <code>Dictionary</code> object containing this bundle's | |
896 * Manifest headers and values. | |
897 * | |
898 * @throws java.lang.SecurityException If the caller does not have the | |
899 * appropriate <code>AdminPermission[this,METADATA]</code>, and | |
900 * the Java Runtime Environment supports permissions. | |
901 * | |
902 * @see #getHeaders() | |
903 * @see Constants#BUNDLE_LOCALIZATION | |
904 * @since 1.3 | |
905 */ | |
906 public Dictionary getHeaders(String locale); | |
907 | |
908 /** | |
909 * Returns the symbolic name of this bundle as specified by its | |
910 * <code>Bundle-SymbolicName</code> manifest header. The name must be | |
911 * unique, it is recommended to use a reverse domain name naming convention | |
912 * like that used for java packages. If this bundle does not have a | |
913 * specified symbolic name then <code>null</code> is returned. | |
914 * | |
915 * <p> | |
916 * This method must continue to return this bundle's symbolic name while | |
917 * this bundle is in the <code>UNINSTALLED</code> state. | |
918 * | |
919 * @return The symbolic name of this bundle. | |
920 * @since 1.3 | |
921 */ | |
922 public String getSymbolicName(); | |
923 | |
924 /** | |
925 * Loads the specified class using this bundle's classloader. | |
926 * | |
927 * <p> | |
928 * If this bundle is a fragment bundle then this method must throw a | |
929 * <code>ClassNotFoundException</code>. | |
930 * | |
931 * <p> | |
932 * If this bundle's state is <code>INSTALLED</code>, this method must | |
933 * attempt to resolve this bundle before attempting to load the class. | |
934 * | |
935 * <p> | |
936 * If this bundle cannot be resolved, a Framework event of type | |
937 * {@link FrameworkEvent#ERROR} is fired containing a | |
938 * <code>BundleException</code> with details of the reason this bundle | |
939 * could not be resolved. This method must then throw a | |
940 * <code>ClassNotFoundException</code>. | |
941 * | |
942 * <p> | |
943 * If this bundle's state is <code>UNINSTALLED</code>, then an | |
944 * <code>IllegalStateException</code> is thrown. | |
945 * | |
946 * @param name The name of the class to load. | |
947 * @return The Class object for the requested class. | |
948 * @throws java.lang.ClassNotFoundException If no such class can be found or | |
949 * if this bundle is a fragment bundle or if the caller does not | |
950 * have the appropriate <code>AdminPermission[this,CLASS]</code>, | |
951 * and the Java Runtime Environment supports permissions. | |
952 * @throws java.lang.IllegalStateException If this bundle has been | |
953 * uninstalled. | |
954 * @since 1.3 | |
955 */ | |
956 public Class loadClass(String name) ; | |
957 | |
958 /** | |
959 * Find the specified resources from this bundle. | |
960 * | |
961 * This bundle's class loader is called to search for the specified | |
962 * resources. If this bundle's state is <code>INSTALLED</code>, this | |
963 * method must attempt to resolve this bundle before attempting to get the | |
964 * specified resources. If this bundle cannot be resolved, then only this | |
965 * bundle must be searched for the specified resources. Imported packages | |
966 * cannot be searched when a bundle has not been resolved. If this bundle is | |
967 * a fragment bundle then <code>null</code> is returned. | |
968 * | |
969 * @param name The name of the resource. See | |
970 * <code>java.lang.ClassLoader.getResources</code> for a | |
971 * description of the format of a resource name. | |
972 * @return An enumeration of URLs to the named resources, or | |
973 * <code>null</code> if the resource could not be found or if this | |
974 * bundle is a fragment bundle or if the caller does not have the | |
975 * appropriate <code>AdminPermission[this,RESOURCE]</code>, and | |
976 * the Java Runtime Environment supports permissions. | |
977 * | |
978 * @since 1.3 | |
979 * @throws java.lang.IllegalStateException If this bundle has been | |
980 * uninstalled. | |
981 * @throws java.io.IOException If there is an I/O error. | |
982 */ | |
983 public Enumeration getResources(String name) ; | |
984 | |
985 /** | |
986 * Returns an Enumeration of all the paths (<code>String</code> objects) | |
987 * to entries within this bundle whose longest sub-path matches the | |
988 * specified path. This bundle's classloader is not used to search for | |
989 * entries. Only the contents of this bundle are searched. | |
990 * <p> | |
991 * The specified path is always relative to the root of this bundle and may | |
992 * begin with a "/". A path value of "/" indicates the | |
993 * root of this bundle. | |
994 * <p> | |
995 * Returned paths indicating subdirectory paths end with a "/". | |
996 * The returned paths are all relative to the root of this bundle and must | |
997 * not begin with "/". | |
998 * | |
999 * @param path The path name for which to return entry paths. | |
1000 * @return An Enumeration of the entry paths (<code>String</code> | |
1001 * objects) or <code>null</code> if no entry could be found or if | |
1002 * the caller does not have the appropriate | |
1003 * <code>AdminPermission[this,RESOURCE]</code> and the Java | |
1004 * Runtime Environment supports permissions. | |
1005 * @throws java.lang.IllegalStateException If this bundle has been | |
1006 * uninstalled. | |
1007 * @since 1.3 | |
1008 */ | |
1009 public Enumeration getEntryPaths(String path); | |
1010 | |
1011 /** | |
1012 * Returns a URL to the entry at the specified path in this bundle. This | |
1013 * bundle's classloader is not used to search for the entry. Only the | |
1014 * contents of this bundle are searched for the entry. | |
1015 * <p> | |
1016 * The specified path is always relative to the root of this bundle and may | |
1017 * begin with "/". A path value of "/" indicates the | |
1018 * root of this bundle. | |
1019 * | |
1020 * @param path The path name of the entry. | |
1021 * @return A URL to the entry, or <code>null</code> if no entry could be | |
1022 * found or if the caller does not have the appropriate | |
1023 * <code>AdminPermission[this,RESOURCE]</code> and the Java | |
1024 * Runtime Environment supports permissions. | |
1025 * | |
1026 * @throws java.lang.IllegalStateException If this bundle has been | |
1027 * uninstalled. | |
1028 * @since 1.3 | |
1029 */ | |
1030 public URL getEntry(String path); | |
1031 | |
1032 /** | |
1033 * Returns the time when this bundle was last modified. A bundle is | |
1034 * considered to be modified when it is installed, updated or uninstalled. | |
1035 * | |
1036 * <p> | |
1037 * The time value is the number of milliseconds since January 1, 1970, | |
1038 * 00:00:00 GMT. | |
1039 * | |
1040 * @return The time when this bundle was last modified. | |
1041 * @since 1.3 | |
1042 */ | |
1043 public long getLastModified(); | |
1044 | |
1045 /** | |
1046 * Returns entries in this bundle and its attached fragments. This bundle's | |
1047 * classloader is not used to search for entries. Only the contents of this | |
1048 * bundle and its attached fragments are searched for the specified entries. | |
1049 * | |
1050 * If this bundle's state is <code>INSTALLED</code>, this method must | |
1051 * attempt to resolve this bundle before attempting to find entries. | |
1052 * | |
1053 * <p> | |
1054 * This method is intended to be used to obtain configuration, setup, | |
1055 * localization and other information from this bundle. This method takes | |
1056 * into account that the "contents" of this bundle can be extended | |
1057 * with fragments. This "bundle space" is not a namespace with | |
1058 * unique members; the same entry name can be present multiple times. This | |
1059 * method therefore returns an enumeration of URL objects. These URLs can | |
1060 * come from different JARs but have the same path name. This method can | |
1061 * either return only entries in the specified path or recurse into | |
1062 * subdirectories returning entries in the directory tree beginning at the | |
1063 * specified path. Fragments can be attached after this bundle is resolved, | |
1064 * possibly changing the set of URLs returned by this method. If this bundle | |
1065 * is not resolved, only the entries in the JAR file of this bundle are | |
1066 * returned. | |
1067 * <p> | |
1068 * Examples: | |
1069 * | |
1070 * <pre> | |
1071 * // List all XML files in the OSGI-INF directory and below | |
1072 * Enumeration e = b.findEntries("OSGI-INF", "*.xml", true); | |
1073 * | |
1074 * // Find a specific localization file | |
1075 * Enumeration e = b.findEntries("OSGI-INF/l10n", | |
1076 * "bundle_nl_DU.properties", | |
1077 * false); | |
1078 * if (e.hasMoreElements()) | |
1079 * return (URL) e.nextElement(); | |
1080 * </pre> | |
1081 * | |
1082 * @param path The path name in which to look. The path is always relative | |
1083 * to the root of this bundle and may begin with "/". A | |
1084 * path value of "/" indicates the root of this bundle. | |
1085 * @param filePattern The file name pattern for selecting entries in the | |
1086 * specified path. The pattern is only matched against the last | |
1087 * element of the entry path and it supports substring matching, as | |
1088 * specified in the Filter specification, using the wildcard | |
1089 * character ("*"). If null is specified, this is | |
1090 * equivalent to "*" and matches all files. | |
1091 * @param recurse If <code>true</code>, recurse into subdirectories. | |
1092 * Otherwise only return entries from the specified path. | |
1093 * @return An enumeration of URL objects for each matching entry, or | |
1094 * <code>null</code> if an entry could not be found or if the | |
1095 * caller does not have the appropriate | |
1096 * <code>AdminPermission[this,RESOURCE]</code>, and the Java | |
1097 * Runtime Environment supports permissions. The URLs are sorted | |
1098 * such that entries from this bundle are returned first followed by | |
1099 * the entries from attached fragments in ascending bundle id order. | |
1100 * If this bundle is a fragment, then only matching entries in this | |
1101 * fragment are returned. | |
1102 * @since 1.3 | |
1103 */ | |
1104 public Enumeration findEntries(String path, String filePattern, | |
1105 bool recurse); | |
1106 | |
1107 /** | |
1108 * Returns this bundle's {@link BundleContext}. The returned | |
1109 * <code>BundleContext</code> can be used by the caller to act on behalf | |
1110 * of this bundle. | |
1111 * | |
1112 * <p> | |
1113 * If this bundle is not in the {@link #STARTING}, {@link #ACTIVE}, or | |
1114 * {@link #STOPPING} states or this bundle is a fragment bundle, then this | |
1115 * bundle has no valid <code>BundleContext</code>. This method will | |
1116 * return <code>null</code> if this bundle has no valid | |
1117 * <code>BundleContext</code>. | |
1118 * | |
1119 * @return A <code>BundleContext</code> for this bundle or | |
1120 * <code>null</code> if this bundle has no valid | |
1121 * <code>BundleContext</code>. | |
1122 * @throws java.lang.SecurityException If the caller does not have the | |
1123 * appropriate <code>AdminPermission[this,CONTEXT]</code>, and | |
1124 * the Java Runtime Environment supports permissions. | |
1125 * @since 1.4 | |
1126 */ | |
1127 public BundleContext getBundleContext(); | |
12
bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1128 } |