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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
19 // Port to the D programming language:
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
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
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
25 import org.osgi.framework.BundleException; // packageimport
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
26 import org.osgi.framework.ServiceReference; // packageimport
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
27 import org.osgi.framework.BundleContext; // packageimport
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
28
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
29 import java.io.IOException;
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
30 import java.io.InputStream;
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
31 import java.net.URL;
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
32 import java.util.Dictionary;
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
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
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
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
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
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
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
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
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
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
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
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
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
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
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
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
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
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
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
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
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
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
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
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
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
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
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
561 public void update() ;
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
562
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
563 /**
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
564 * Updates this bundle from an <code>InputStream</code>.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
565 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
566 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
567 * This method performs all the steps listed in <code>Bundle.update()</code>,
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
568 * except the new version of this bundle must be read from the supplied
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
569 * <code>InputStream</code>, rather than a <code>URL</code>.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
570 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
571 * This method must always close the <code>InputStream</code> when it is
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
572 * done, even if an exception is thrown.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
573 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
574 * @param in The <code>InputStream</code> from which to read the new
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
575 * bundle.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
576 * @throws BundleException If the provided stream cannot be read or the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
577 * update fails.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
578 * @throws java.lang.IllegalStateException If this bundle has been
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
579 * uninstalled or this bundle tries to change its own state.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
580 * @throws java.lang.SecurityException If the caller does not have the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
581 * appropriate <code>AdminPermission[this,LIFECYCLE]</code> for
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
582 * both the current bundle and the updated bundle, and the Java
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
583 * Runtime Environment supports permissions.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
584 * @see #update()
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
585 */
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
586 public void update(InputStream in_) ;
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
587
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
588 /**
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
589 * Uninstalls this bundle.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
590 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
591 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
592 * This method causes the Framework to notify other bundles that this bundle
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
593 * is being uninstalled, and then puts this bundle into the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
594 * <code>UNINSTALLED</code> state. The Framework must remove any resources
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
595 * related to this bundle that it is able to remove.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
596 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
597 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
598 * If this bundle has exported any packages, the Framework must continue to
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
599 * make these packages available to their importing bundles until the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
600 * <code>PackageAdmin.refreshPackages</code> method has been called or the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
601 * Framework is relaunched.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
602 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
603 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
604 * The following steps are required to uninstall a bundle:
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
605 * <ol>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
606 * <li>If this bundle's state is <code>UNINSTALLED</code> then an
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
607 * <code>IllegalStateException</code> is thrown.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
608 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
609 * <li>If this bundle's state is <code>ACTIVE</code>,
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
610 * <code>STARTING</code> or <code>STOPPING</code>, this bundle is
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
611 * stopped as described in the <code>Bundle.stop</code> method. If
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
612 * <code>Bundle.stop</code> throws an exception, a Framework event of type
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
613 * {@link FrameworkEvent#ERROR} is fired containing the exception.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
614 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
615 * <li>This bundle's state is set to <code>UNINSTALLED</code>.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
616 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
617 * <li>A bundle event of type {@link BundleEvent#UNINSTALLED} is fired.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
618 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
619 * <li>This bundle and any persistent storage area provided for this bundle
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
620 * by the Framework are removed.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
621 * </ol>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
622 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
623 * <b>Preconditions </b>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
624 * <ul>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
625 * <li><code>getState()</code> not in {<code>UNINSTALLED</code>}.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
626 * </ul>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
627 * <b>Postconditions, no exceptions thrown </b>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
628 * <ul>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
629 * <li><code>getState()</code> in {<code>UNINSTALLED</code>}.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
630 * <li>This bundle has been uninstalled.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
631 * </ul>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
632 * <b>Postconditions, when an exception is thrown </b>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
633 * <ul>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
634 * <li><code>getState()</code> not in {<code>UNINSTALLED</code>}.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
635 * <li>This Bundle has not been uninstalled.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
636 * </ul>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
637 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
638 * @throws BundleException If the uninstall failed. This can occur if
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
639 * another thread is attempting to change this bundle's state and
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
640 * does not complete in a timely manner.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
641 * @throws java.lang.IllegalStateException If this bundle has been
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
642 * uninstalled or this bundle tries to change its own state.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
643 * @throws java.lang.SecurityException If the caller does not have the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
644 * appropriate <code>AdminPermission[this,LIFECYCLE]</code>, and
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
645 * the Java Runtime Environment supports permissions.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
646 * @see #stop()
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
647 */
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
648 public void uninstall() ;
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
649
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
650 /**
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
651 * Returns this bundle's Manifest headers and values. This method returns
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
652 * all the Manifest headers and values from the main section of this
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
653 * bundle's Manifest file; that is, all lines prior to the first blank line.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
654 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
655 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
656 * Manifest header names are case-insensitive. The methods of the returned
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
657 * <code>Dictionary</code> object must operate on header names in a
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
658 * case-insensitive manner.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
659 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
660 * If a Manifest header value starts with &quot;%&quot;, it must be
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
661 * localized according to the default locale.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
662 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
663 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
664 * For example, the following Manifest headers and values are included if
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
665 * they are present in the Manifest file:
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
666 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
667 * <pre>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
668 * Bundle-Name
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
669 * Bundle-Vendor
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
670 * Bundle-Version
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
671 * Bundle-Description
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
672 * Bundle-DocURL
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
673 * Bundle-ContactAddress
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
674 * </pre>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
675 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
676 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
677 * This method must continue to return Manifest header information while
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
678 * this bundle is in the <code>UNINSTALLED</code> state.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
679 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
680 * @return A <code>Dictionary</code> object containing this bundle's
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
681 * Manifest headers and values.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
682 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
683 * @throws java.lang.SecurityException If the caller does not have the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
684 * appropriate <code>AdminPermission[this,METADATA]</code>, and
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
685 * the Java Runtime Environment supports permissions.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
686 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
687 * @see Constants#BUNDLE_LOCALIZATION
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
688 */
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
689 public Dictionary getHeaders();
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
690
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
691 /**
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
692 * Returns this bundle's unique identifier. This bundle is assigned a unique
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
693 * identifier by the Framework when it was installed in the OSGi
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
694 * environment.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
695 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
696 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
697 * A bundle's unique identifier has the following attributes:
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
698 * <ul>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
699 * <li>Is unique and persistent.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
700 * <li>Is a <code>long</code>.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
701 * <li>Its value is not reused for another bundle, even after a bundle is
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
702 * uninstalled.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
703 * <li>Does not change while a bundle remains installed.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
704 * <li>Does not change when a bundle is updated.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
705 * </ul>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
706 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
707 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
708 * This method must continue to return this bundle's unique identifier while
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
709 * this bundle is in the <code>UNINSTALLED</code> state.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
710 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
711 * @return The unique identifier of this bundle.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
712 */
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
713 public long getBundleId();
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
714
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
715 /**
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
716 * Returns this bundle's location identifier.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
717 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
718 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
719 * The location identifier is the location passed to
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
720 * <code>BundleContext.installBundle</code> when a bundle is installed.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
721 * The location identifier does not change while this bundle remains
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
722 * installed, even if this bundle is updated.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
723 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
724 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
725 * This method must continue to return this bundle's location identifier
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
726 * while this bundle is in the <code>UNINSTALLED</code> state.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
727 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
728 * @return The string representation of this bundle's location identifier.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
729 * @throws java.lang.SecurityException If the caller does not have the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
730 * appropriate <code>AdminPermission[this,METADATA]</code>, and
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
731 * the Java Runtime Environment supports permissions.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
732 */
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
733 public String getLocation();
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
734
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
735 /**
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
736 * Returns this bundle's <code>ServiceReference</code> list for all
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
737 * services it has registered or <code>null</code> if this bundle has no
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
738 * registered services.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
739 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
740 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
741 * If the Java runtime supports permissions, a <code>ServiceReference</code>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
742 * object to a service is included in the returned list only if the caller
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
743 * has the <code>ServicePermission</code> to get the service using at
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
744 * least one of the named classes the service was registered under.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
745 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
746 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
747 * The list is valid at the time of the call to this method, however, as the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
748 * Framework is a very dynamic environment, services can be modified or
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
749 * unregistered at anytime.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
750 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
751 * @return An array of <code>ServiceReference</code> objects or
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
752 * <code>null</code>.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
753 * @throws java.lang.IllegalStateException If this bundle has been
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
754 * uninstalled.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
755 * @see ServiceRegistration
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
756 * @see ServiceReference
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
757 * @see ServicePermission
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
758 */
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
759 public ServiceReference[] getRegisteredServices();
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
760
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
761 /**
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
762 * Returns this bundle's <code>ServiceReference</code> list for all
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
763 * services it is using or returns <code>null</code> if this bundle is not
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
764 * using any services. A bundle is considered to be using a service if its
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
765 * use count for that service is greater than zero.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
766 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
767 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
768 * If the Java Runtime Environment supports permissions, a
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
769 * <code>ServiceReference</code> object to a service is included in the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
770 * returned list only if the caller has the <code>ServicePermission</code>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
771 * to get the service using at least one of the named classes the service
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
772 * was registered under.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
773 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
774 * The list is valid at the time of the call to this method, however, as the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
775 * Framework is a very dynamic environment, services can be modified or
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
776 * unregistered at anytime.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
777 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
778 * @return An array of <code>ServiceReference</code> objects or
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
779 * <code>null</code>.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
780 * @throws java.lang.IllegalStateException If this bundle has been
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
781 * uninstalled.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
782 * @see ServiceReference
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
783 * @see ServicePermission
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
784 */
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
785 public ServiceReference[] getServicesInUse();
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
786
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
787 /**
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
788 * Determines if this bundle has the specified permissions.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
789 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
790 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
791 * If the Java Runtime Environment does not support permissions, this method
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
792 * always returns <code>true</code>.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
793 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
794 * <code>permission</code> is of type <code>Object</code> to avoid
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
795 * referencing the <code>java.security.Permission</code> class directly.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
796 * This is to allow the Framework to be implemented in Java environments
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
797 * which do not support permissions.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
798 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
799 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
800 * If the Java Runtime Environment does support permissions, this bundle and
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
801 * all its resources including embedded JAR files, belong to the same
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
802 * <code>java.security.ProtectionDomain</code>; that is, they must share
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
803 * the same set of permissions.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
804 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
805 * @param permission The permission to verify.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
806 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
807 * @return <code>true</code> if this bundle has the specified permission
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
808 * or the permissions possessed by this bundle imply the specified
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
809 * permission; <code>false</code> if this bundle does not have the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
810 * specified permission or <code>permission</code> is not an
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
811 * <code>instanceof</code> <code>java.security.Permission</code>.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
812 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
813 * @throws java.lang.IllegalStateException If this bundle has been
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
814 * uninstalled.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
815 */
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
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
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
818 /**
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
819 * Find the specified resource from this bundle.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
820 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
821 * This bundle's class loader is called to search for the specified
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
822 * resource. If this bundle's state is <code>INSTALLED</code>, this
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
823 * method must attempt to resolve this bundle before attempting to get the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
824 * specified resource. If this bundle cannot be resolved, then only this
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
825 * bundle must be searched for the specified resource. Imported packages
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
826 * cannot be searched when this bundle has not been resolved. If this bundle
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
827 * is a fragment bundle then <code>null</code> is returned.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
828 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
829 * @param name The name of the resource. See
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
830 * <code>java.lang.ClassLoader.getResource</code> for a description
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
831 * of the format of a resource name.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
832 * @return A URL to the named resource, or <code>null</code> if the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
833 * resource could not be found or if this bundle is a fragment
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
834 * bundle or if the caller does not have the appropriate
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
835 * <code>AdminPermission[this,RESOURCE]</code>, and the Java
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
836 * Runtime Environment supports permissions.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
837 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
838 * @since 1.1
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
839 * @throws java.lang.IllegalStateException If this bundle has been
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
840 * uninstalled.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
841 * @see #getEntry
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
842 * @see #findEntries
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
843 */
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
844 public URL getResource(String name);
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
845
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
846 /**
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
847 * Returns this bundle's Manifest headers and values localized to the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
848 * specified locale.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
849 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
850 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
851 * This method performs the same function as
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
852 * <code>Bundle.getHeaders()</code> except the manifest header values are
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
853 * localized to the specified locale.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
854 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
855 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
856 * If a Manifest header value starts with &quot;%&quot;, it must be
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
857 * localized according to the specified locale. If a locale is specified and
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
858 * cannot be found, then the header values must be returned using the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
859 * default locale. Localizations are searched for in the following order:
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
860 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
861 * <pre>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
862 * bn + "_" + Ls + "_" + Cs + "_" + Vs
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
863 * bn + "_" + Ls + "_" + Cs
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
864 * bn + "_" + Ls
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
865 * bn + "_" + Ld + "_" + Cd + "_" + Vd
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
866 * bn + "_" + Ld + "_" + Cd
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
867 * bn + "_" + Ld
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
868 * bn
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
869 * </pre>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
870 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
871 * Where <code>bn</code> is this bundle's localization basename,
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
872 * <code>Ls</code>, <code>Cs</code> and <code>Vs</code> are the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
873 * specified locale (language, country, variant) and <code>Ld</code>,
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
874 * <code>Cd</code> and <code>Vd</code> are the default locale (language,
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
875 * country, variant).
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
876 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
877 * If <code>null</code> is specified as the locale string, the header
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
878 * values must be localized using the default locale. If the empty string
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
879 * (&quot;&quot;) is specified as the locale string, the header values must
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
880 * not be localized and the raw (unlocalized) header values, including any
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
881 * leading &quot;%&quot;, must be returned.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
882 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
883 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
884 * This method must continue to return Manifest header information while
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
885 * this bundle is in the <code>UNINSTALLED</code> state, however the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
886 * header values must only be available in the raw and default locale
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
887 * values.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
888 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
889 * @param locale The locale name into which the header values are to be
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
890 * localized. If the specified locale is <code>null</code> then the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
891 * locale returned by <code>java.util.Locale.getDefault</code> is
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
892 * used. If the specified locale is the empty string, this method
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
893 * will return the raw (unlocalized) manifest headers including any
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
894 * leading &quot;%&quot;.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
895 * @return A <code>Dictionary</code> object containing this bundle's
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
896 * Manifest headers and values.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
897 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
898 * @throws java.lang.SecurityException If the caller does not have the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
899 * appropriate <code>AdminPermission[this,METADATA]</code>, and
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
900 * the Java Runtime Environment supports permissions.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
901 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
902 * @see #getHeaders()
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
903 * @see Constants#BUNDLE_LOCALIZATION
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
904 * @since 1.3
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
905 */
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
906 public Dictionary getHeaders(String locale);
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
907
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
908 /**
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
909 * Returns the symbolic name of this bundle as specified by its
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
910 * <code>Bundle-SymbolicName</code> manifest header. The name must be
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
911 * unique, it is recommended to use a reverse domain name naming convention
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
912 * like that used for java packages. If this bundle does not have a
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
913 * specified symbolic name then <code>null</code> is returned.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
914 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
915 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
916 * This method must continue to return this bundle's symbolic name while
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
917 * this bundle is in the <code>UNINSTALLED</code> state.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
918 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
919 * @return The symbolic name of this bundle.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
920 * @since 1.3
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
921 */
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
922 public String getSymbolicName();
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
923
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
924 /**
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
925 * Loads the specified class using this bundle's classloader.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
926 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
927 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
928 * If this bundle is a fragment bundle then this method must throw a
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
929 * <code>ClassNotFoundException</code>.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
930 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
931 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
932 * If this bundle's state is <code>INSTALLED</code>, this method must
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
933 * attempt to resolve this bundle before attempting to load the class.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
934 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
935 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
936 * If this bundle cannot be resolved, a Framework event of type
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
937 * {@link FrameworkEvent#ERROR} is fired containing a
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
938 * <code>BundleException</code> with details of the reason this bundle
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
939 * could not be resolved. This method must then throw a
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
940 * <code>ClassNotFoundException</code>.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
941 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
942 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
943 * If this bundle's state is <code>UNINSTALLED</code>, then an
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
944 * <code>IllegalStateException</code> is thrown.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
945 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
946 * @param name The name of the class to load.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
947 * @return The Class object for the requested class.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
948 * @throws java.lang.ClassNotFoundException If no such class can be found or
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
949 * if this bundle is a fragment bundle or if the caller does not
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
950 * have the appropriate <code>AdminPermission[this,CLASS]</code>,
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
951 * and the Java Runtime Environment supports permissions.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
952 * @throws java.lang.IllegalStateException If this bundle has been
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
953 * uninstalled.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
954 * @since 1.3
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
955 */
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
956 public Class loadClass(String name) ;
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
957
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
958 /**
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
959 * Find the specified resources from this bundle.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
960 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
961 * This bundle's class loader is called to search for the specified
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
962 * resources. If this bundle's state is <code>INSTALLED</code>, this
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
963 * method must attempt to resolve this bundle before attempting to get the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
964 * specified resources. If this bundle cannot be resolved, then only this
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
965 * bundle must be searched for the specified resources. Imported packages
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
966 * cannot be searched when a bundle has not been resolved. If this bundle is
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
967 * a fragment bundle then <code>null</code> is returned.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
968 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
969 * @param name The name of the resource. See
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
970 * <code>java.lang.ClassLoader.getResources</code> for a
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
971 * description of the format of a resource name.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
972 * @return An enumeration of URLs to the named resources, or
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
973 * <code>null</code> if the resource could not be found or if this
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
974 * bundle is a fragment bundle or if the caller does not have the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
975 * appropriate <code>AdminPermission[this,RESOURCE]</code>, and
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
976 * the Java Runtime Environment supports permissions.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
977 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
978 * @since 1.3
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
979 * @throws java.lang.IllegalStateException If this bundle has been
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
980 * uninstalled.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
981 * @throws java.io.IOException If there is an I/O error.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
982 */
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
983 public Enumeration getResources(String name) ;
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
984
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
985 /**
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
986 * Returns an Enumeration of all the paths (<code>String</code> objects)
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
987 * to entries within this bundle whose longest sub-path matches the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
988 * specified path. This bundle's classloader is not used to search for
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
989 * entries. Only the contents of this bundle are searched.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
990 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
991 * The specified path is always relative to the root of this bundle and may
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
992 * begin with a &quot;/&quot;. A path value of &quot;/&quot; indicates the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
993 * root of this bundle.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
994 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
995 * Returned paths indicating subdirectory paths end with a &quot;/&quot;.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
996 * The returned paths are all relative to the root of this bundle and must
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
997 * not begin with &quot;/&quot;.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
998 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
999 * @param path The path name for which to return entry paths.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1000 * @return An Enumeration of the entry paths (<code>String</code>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1001 * objects) or <code>null</code> if no entry could be found or if
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1002 * the caller does not have the appropriate
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1003 * <code>AdminPermission[this,RESOURCE]</code> and the Java
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1004 * Runtime Environment supports permissions.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1005 * @throws java.lang.IllegalStateException If this bundle has been
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1006 * uninstalled.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1007 * @since 1.3
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1008 */
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1009 public Enumeration getEntryPaths(String path);
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1010
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1011 /**
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1012 * Returns a URL to the entry at the specified path in this bundle. This
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1013 * bundle's classloader is not used to search for the entry. Only the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1014 * contents of this bundle are searched for the entry.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1015 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1016 * The specified path is always relative to the root of this bundle and may
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1017 * begin with &quot;/&quot;. A path value of &quot;/&quot; indicates the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1018 * root of this bundle.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1019 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1020 * @param path The path name of the entry.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1021 * @return A URL to the entry, or <code>null</code> if no entry could be
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1022 * found or if the caller does not have the appropriate
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1023 * <code>AdminPermission[this,RESOURCE]</code> and the Java
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1024 * Runtime Environment supports permissions.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1025 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1026 * @throws java.lang.IllegalStateException If this bundle has been
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1027 * uninstalled.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1028 * @since 1.3
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1029 */
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1030 public URL getEntry(String path);
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1031
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1032 /**
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1033 * Returns the time when this bundle was last modified. A bundle is
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1034 * considered to be modified when it is installed, updated or uninstalled.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1035 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1036 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1037 * The time value is the number of milliseconds since January 1, 1970,
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1038 * 00:00:00 GMT.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1039 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1040 * @return The time when this bundle was last modified.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1041 * @since 1.3
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1042 */
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1043 public long getLastModified();
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1044
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1045 /**
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1046 * Returns entries in this bundle and its attached fragments. This bundle's
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1047 * classloader is not used to search for entries. Only the contents of this
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1048 * bundle and its attached fragments are searched for the specified entries.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1049 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1050 * If this bundle's state is <code>INSTALLED</code>, this method must
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1051 * attempt to resolve this bundle before attempting to find entries.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1052 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1053 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1054 * This method is intended to be used to obtain configuration, setup,
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1055 * localization and other information from this bundle. This method takes
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1056 * into account that the &quot;contents&quot; of this bundle can be extended
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1057 * with fragments. This &quot;bundle space&quot; is not a namespace with
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1058 * unique members; the same entry name can be present multiple times. This
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1059 * method therefore returns an enumeration of URL objects. These URLs can
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1060 * come from different JARs but have the same path name. This method can
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1061 * either return only entries in the specified path or recurse into
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1062 * subdirectories returning entries in the directory tree beginning at the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1063 * specified path. Fragments can be attached after this bundle is resolved,
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1064 * possibly changing the set of URLs returned by this method. If this bundle
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1065 * is not resolved, only the entries in the JAR file of this bundle are
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1066 * returned.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1067 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1068 * Examples:
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1069 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1070 * <pre>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1071 * // List all XML files in the OSGI-INF directory and below
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1072 * Enumeration e = b.findEntries(&quot;OSGI-INF&quot;, &quot;*.xml&quot;, true);
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1073 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1074 * // Find a specific localization file
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1075 * Enumeration e = b.findEntries(&quot;OSGI-INF/l10n&quot;,
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1076 * &quot;bundle_nl_DU.properties&quot;,
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1077 * false);
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1078 * if (e.hasMoreElements())
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1079 * return (URL) e.nextElement();
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1080 * </pre>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1081 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1082 * @param path The path name in which to look. The path is always relative
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1083 * to the root of this bundle and may begin with &quot;/&quot;. A
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1084 * path value of &quot;/&quot; indicates the root of this bundle.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1085 * @param filePattern The file name pattern for selecting entries in the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1086 * specified path. The pattern is only matched against the last
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1087 * element of the entry path and it supports substring matching, as
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1088 * specified in the Filter specification, using the wildcard
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1089 * character (&quot;*&quot;). If null is specified, this is
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1090 * equivalent to &quot;*&quot; and matches all files.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1091 * @param recurse If <code>true</code>, recurse into subdirectories.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1092 * Otherwise only return entries from the specified path.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1093 * @return An enumeration of URL objects for each matching entry, or
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1094 * <code>null</code> if an entry could not be found or if the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1095 * caller does not have the appropriate
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1096 * <code>AdminPermission[this,RESOURCE]</code>, and the Java
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1097 * Runtime Environment supports permissions. The URLs are sorted
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1098 * such that entries from this bundle are returned first followed by
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1099 * the entries from attached fragments in ascending bundle id order.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1100 * If this bundle is a fragment, then only matching entries in this
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1101 * fragment are returned.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1102 * @since 1.3
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1103 */
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1104 public Enumeration findEntries(String path, String filePattern,
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1105 bool recurse);
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1106
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1107 /**
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1108 * Returns this bundle's {@link BundleContext}. The returned
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1109 * <code>BundleContext</code> can be used by the caller to act on behalf
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1110 * of this bundle.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1111 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1112 * <p>
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1113 * If this bundle is not in the {@link #STARTING}, {@link #ACTIVE}, or
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1114 * {@link #STOPPING} states or this bundle is a fragment bundle, then this
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1115 * bundle has no valid <code>BundleContext</code>. This method will
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1116 * return <code>null</code> if this bundle has no valid
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1117 * <code>BundleContext</code>.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1118 *
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1119 * @return A <code>BundleContext</code> for this bundle or
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1120 * <code>null</code> if this bundle has no valid
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1121 * <code>BundleContext</code>.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1122 * @throws java.lang.SecurityException If the caller does not have the
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1123 * appropriate <code>AdminPermission[this,CONTEXT]</code>, and
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1124 * the Java Runtime Environment supports permissions.
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1125 * @since 1.4
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
1126 */
Frank Benoit <benoit@tionex.de>
parents: 83
diff changeset
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 }