Karl Pauls | c6eda45 | 2010-02-14 22:52:56 +0000 | [diff] [blame^] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 | <html><head> |
| 3 | |
| 4 | |
| 5 | |
| 6 | <title>Apache Felix - Apache Felix OSGi Bundle Repository</title> |
| 7 | <link rel="stylesheet" href="apache-felix-osgi-bundle-repository_files/site.css" type="text/css" media="all"> |
| 8 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 9 | </head><body> |
| 10 | <div class="title"><div class="logo"><a href="http://felix.apache.org/site/index.html"><img alt="Apache Felix" src="apache-felix-osgi-bundle-repository_files/logo.png" border="0"></a></div><div class="header"><a href="http://www.apache.org/"><img alt="Apache" src="apache-felix-osgi-bundle-repository_files/apache.png" border="0"></a></div></div> |
| 11 | <div class="menu"> |
| 12 | <ul> |
| 13 | <li><a href="http://cwiki.apache.org/FELIX/news.html" title="news">news</a></li> |
| 14 | <li><a href="http://cwiki.apache.org/FELIX/license.html" title="license">license</a></li> |
| 15 | <li><a href="http://felix.apache.org/site/downloads.cgi" rel="nofollow">downloads</a></li> |
| 16 | <li><a href="http://cwiki.apache.org/FELIX/documentation.html" title="documentation">documentation</a></li> |
| 17 | <li><a href="http://cwiki.apache.org/FELIX/mailinglists.html" title="mailinglists">mailing lists</a></li> |
| 18 | <li><a href="http://cwiki.apache.org/FELIX/contributing.html" title="Contributing">contributing</a></li> |
| 19 | <li><a href="http://www.apache.org/" rel="nofollow">asf</a></li> |
| 20 | <li><a href="http://www.apache.org/foundation/sponsorship.html" rel="nofollow">sponsorship</a></li> |
| 21 | <li><a href="http://www.apache.org/foundation/thanks.html" rel="nofollow">sponsors</a> |
| 22 | <!-- ApacheCon Ad --> |
| 23 | <iframe src="apache-felix-osgi-bundle-repository_files/button.html" style="border-width: 0pt; float: left;" frameborder="0" height="135" scrolling="no" width="135"></iframe> |
| 24 | <p style="height: 100px;"> |
| 25 | <!-- ApacheCon Ad --> |
| 26 | </p></li></ul> </div> |
| 27 | <div class="main"> |
| 28 | <h1><a name="ApacheFelixOSGiBundleRepository-ApacheFelixOSGiBundleRepository(OBR)"></a>Apache Felix OSGi Bundle Repository (OBR)</h1> |
| 29 | |
| 30 | <div> |
| 31 | <ul> |
| 32 | <li><a href="#ApacheFelixOSGiBundleRepository-Motivation">Motivation</a></li> |
| 33 | <li><a href="#ApacheFelixOSGiBundleRepository-Overview">Overview</a></li> |
| 34 | <li><a href="#ApacheFelixOSGiBundleRepository-OBRRepositoryFile">OBR Repository File</a></li> |
| 35 | <li><a href="#ApacheFelixOSGiBundleRepository-OBRServiceAPI">OBR Service API</a></li> |
| 36 | <li><a href="#ApacheFelixOSGiBundleRepository-OBRShellCommand">OBR Shell Command</a></li> |
| 37 | <ul> |
| 38 | <li><a href="#ApacheFelixOSGiBundleRepository-obrhelp">obr help</a></li> |
| 39 | <li><a href="#ApacheFelixOSGiBundleRepository-obrlisturl">obr list-url</a></li> |
| 40 | <li><a href="#ApacheFelixOSGiBundleRepository-obraddurl">obr add-url</a></li> |
| 41 | <li><a href="#ApacheFelixOSGiBundleRepository-obrremoveurl">obr remove-url</a></li> |
| 42 | <li><a href="#ApacheFelixOSGiBundleRepository-obrlist">obr list</a></li> |
| 43 | <li><a href="#ApacheFelixOSGiBundleRepository-obrinfo">obr info</a></li> |
| 44 | <li><a href="#ApacheFelixOSGiBundleRepository-obrdeploy">obr deploy</a></li> |
| 45 | <li><a href="#ApacheFelixOSGiBundleRepository-obrstart">obr start</a></li> |
| 46 | <li><a href="#ApacheFelixOSGiBundleRepository-obrsource">obr source</a></li> |
| 47 | <li><a href="#ApacheFelixOSGiBundleRepository-obrjavadoc">obr javadoc</a></li> |
| 48 | </ul> |
| 49 | <li><a href="#ApacheFelixOSGiBundleRepository-UsingOBRwithaProxy">Using OBR with a Proxy</a></li> |
| 50 | <li><a href="#ApacheFelixOSGiBundleRepository-BundleSourcePackaging">Bundle Source Packaging</a></li> |
| 51 | <li><a href="#ApacheFelixOSGiBundleRepository-NoteonOSGiR3Bundles">Note on OSGi R3 Bundles</a></li> |
| 52 | <li><a href="#ApacheFelixOSGiBundleRepository-Feedback">Feedback</a></li> |
| 53 | </ul></div> |
| 54 | |
| 55 | <p><a name="ApacheFelixOSGiBundleRepository-motivation"></a></p> |
| 56 | |
| 57 | <h2><a name="ApacheFelixOSGiBundleRepository-Motivation"></a>Motivation</h2> |
| 58 | |
| 59 | <p>The goal of the Apache Felix OSGi Bundle Repository (OBR) is two-fold:</p> |
| 60 | |
| 61 | <ol> |
| 62 | <li>To simplify deploying and using available bundles with Felix.</li> |
| 63 | <li>To encourage independent bundle development so that communities of interest can grow.</li> |
| 64 | </ol> |
| 65 | |
| 66 | |
| 67 | <p>OBR achieves the first goal by providing a service that can |
| 68 | automatically install a bundle, with its deployment dependencies, from |
| 69 | a bundle repository. This makes it easier for people to experiment with |
| 70 | existing bundles. The second goal is achieved by raising the visibility |
| 71 | of the available bundles and providing access to both the executable |
| 72 | bundle and its source code. Hopefully, by making OBR and the bundles |
| 73 | themselves more visible, community members will be encouraged to |
| 74 | provide or improve service implementations.</p> |
| 75 | |
| 76 | <p>Note: OBR provides access to the Felix' default bundle repository, |
| 77 | but you can also use it to deploy your own bundles by creating a bundle |
| 78 | repository meta-data file for your local bundles; see the <tt>obr list-url</tt>, <tt>obr add-url</tt>, and <tt>obr remove-url</tt> commands for more details.</p> |
| 79 | |
| 80 | <p><a name="ApacheFelixOSGiBundleRepository-overview"></a></p> |
| 81 | |
| 82 | <h2><a name="ApacheFelixOSGiBundleRepository-Overview"></a>Overview</h2> |
| 83 | |
| 84 | <p>For the most part, OBR is quite simple. An OBR "repository server" |
| 85 | is not necessary, since all functionality may reside on the client |
| 86 | side. OBR is able to provide its functionality by reading an XML-based |
| 87 | meta-data file that describes the bundles available to it. The |
| 88 | meta-data file essentially contains an XML encoding of the bundles' |
| 89 | manifest information. From the meta-data, OBR is able to construct |
| 90 | dependency information for deploying (i.e., installing and updating) |
| 91 | bundles.</p> |
| 92 | |
| 93 | <p>OBR defines the following entities:</p> |
| 94 | |
| 95 | <ul> |
| 96 | <li><em><b>Repository Admin</b></em> - a service to access a federation of repositories.</li> |
| 97 | <li><em><b>Repository</b></em> - provides access to a set of resources.</li> |
| 98 | <li><em><b>Resource</b></em> - a description of an artifact to be installed on a device.</li> |
| 99 | <li><em><b>Capability</b></em> - a named set of properties.</li> |
| 100 | <li><em><b>Requirement</b></em> - an assertion on a capability.</li> |
| 101 | <li><em><b>Resolver</b></em> - an object to resolve resource dependencies and to deploy them.</li> |
| 102 | <li><em><b>Repository file</b></em> - XML file containing resource meta-data.</li> |
| 103 | </ul> |
| 104 | |
| 105 | |
| 106 | <p>The following diagram illustrates the relationships among these entities:</p> |
| 107 | |
| 108 | <p><img src="apache-felix-osgi-bundle-repository_files/obr-entities.png" align="absmiddle" border="0"></p> |
| 109 | |
| 110 | <p>The client has access to a federated set of repositories via the Repository Admin service; such as depicted in this view:</p> |
| 111 | |
| 112 | <p><img src="apache-felix-osgi-bundle-repository_files/obr-high-level.png" align="absmiddle" border="0"></p> |
| 113 | |
| 114 | <p><a name="ApacheFelixOSGiBundleRepository-repositoryfile"></a></p> |
| 115 | |
| 116 | <h2><a name="ApacheFelixOSGiBundleRepository-OBRRepositoryFile"></a>OBR Repository File</h2> |
| 117 | |
| 118 | <p>The OBR repository file is an XML-based representation of bundle |
| 119 | meta-data. The goal is provide a generic model for describing |
| 120 | dependencies among resources; as such, the term <em><b>resource</b></em> is used instead of <em><b>bundle</b></em> in the OBR repository syntax; a detailed description of the OBR meta-data format is available in the <a href="http://www2.osgi.org/download/rfc-0112_BundleRepository.pdf" rel="nofollow">OSGi RFC 112</a> |
| 121 | document; this document is not completely in sync with the |
| 122 | implementation, but the concepts are still correct. The following XML |
| 123 | snippet depicts the overall structure of a repository file:</p> |
| 124 | |
| 125 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
| 126 | <pre><repository presentationname="..." symbolicname="..." ... > |
| 127 | <resource> |
| 128 | <description>...</description> |
| 129 | <size>...</size> |
| 130 | <documentation>...</documentation> |
| 131 | <source>...</source> |
| 132 | <category id="..."/> |
| 133 | <capability>...</capability> |
| 134 | ... |
| 135 | <requirement>...</requirement> |
| 136 | ... |
| 137 | </resource> |
| 138 | ... |
| 139 | </repository> |
| 140 | </pre> |
| 141 | </div></div> |
| 142 | |
| 143 | <p>The above repository defines a set of available resources, each |
| 144 | described by a set of meta-data. Some resource meta-data is purely |
| 145 | intended for human consumption; the most important aspects relate to |
| 146 | the generic capability/requirement model.</p> |
| 147 | |
| 148 | <p>A resource can provide any number of capabilities. A capability is a |
| 149 | typed set of properties. For example, the following is an exported |
| 150 | package capability:</p> |
| 151 | |
| 152 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
| 153 | <pre><capability name='package'> |
| 154 | <p n='package' v='org.foo.bar'/> |
| 155 | <p n='version' t='version' v='1.0.0'/> |
| 156 | </capability> |
| 157 | </pre> |
| 158 | </div></div> |
| 159 | |
| 160 | <p>This capability is of type 'package' and exports 'org.foo.bar' at |
| 161 | version '1.0.0'. Conversely, a requirement is a typed LDAP query over a |
| 162 | set of capability properties. For example, the following is an imported |
| 163 | package requirement:</p> |
| 164 | |
| 165 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
| 166 | <pre><require name='package' extend='false' |
| 167 | multiple='false' optional='false' |
| 168 | filter='(&amp;(package=org.foo.bar)(version&gt;=1.0.0))'> |
| 169 | Import package org.foo.bar |
| 170 | </require> |
| 171 | </pre> |
| 172 | </div></div> |
| 173 | |
| 174 | <p>This requirement is of type 'package' and imports 'org.foo.bar' at |
| 175 | versions greater than '1.0.0'. Although this syntax looks rather |
| 176 | complicated with the '\&' and '\>=' syntax, it is simply the |
| 177 | standard OSGi LDAP query syntax in XML form (additionally, Peter Kriens |
| 178 | has created a tool called <tt>bindex</tt> to generate this meta-data from a bundle's manifest).</p> |
| 179 | |
| 180 | <p>With this generic dependency model, OBR is able to provide mappings |
| 181 | for the various OSGi bundle dependencies; e.g., import/export package, |
| 182 | provide/require bundle, host/fragment, import/export service, execution |
| 183 | environment, and native code. In addition, it is possible for bundles |
| 184 | to introduce arbitrary dependencies for custom purposes.</p> |
| 185 | |
| 186 | <p>Two other important pieces of meta-data are <tt>Bundle-SymbolicName</tt> and <tt>Bundle-Version</tt>; |
| 187 | these are standard OSGi bundle manifest attributes that OBR uses to |
| 188 | uniquely identify a bundle. For example, if you want to use OBR to |
| 189 | update a locally installed bundle, OBR gets its symbolic name and |
| 190 | version and searches the repository metadata for a matching symbolic |
| 191 | name. If the matching symbolic name is found, then OBR checks if there |
| 192 | is a newer version than the local copy using the bundle version number. |
| 193 | Thus, the symbolic name plus bundle version forms a unique key to match |
| 194 | locally installed bundles to remotely available bundles.</p> |
| 195 | |
| 196 | <p><a name="ApacheFelixOSGiBundleRepository-serviceapi"></a></p> |
| 197 | |
| 198 | <h2><a name="ApacheFelixOSGiBundleRepository-OBRServiceAPI"></a>OBR Service API</h2> |
| 199 | |
| 200 | <p>Typically, OBR service clients only need to interact with the |
| 201 | Repository Admin service, which provides the mechanisms necessary to |
| 202 | discover available resources. The Repository Admin interface is defined |
| 203 | as follows:</p> |
| 204 | |
| 205 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
| 206 | <pre class="code-java"><span class="code-keyword">public</span> <span class="code-keyword">interface</span> RepositoryAdmin |
| 207 | { |
| 208 | <span class="code-keyword">public</span> Resource[] discoverResources(<span class="code-object">String</span> filterExpr); |
| 209 | <span class="code-keyword">public</span> Resolver resolver(); |
| 210 | <span class="code-keyword">public</span> Repository addRepository(URL repository)? |
| 211 | <span class="code-keyword">throws</span> Exception; |
| 212 | <span class="code-keyword">public</span> <span class="code-object">boolean</span> removeRepository(URL repository); |
| 213 | <span class="code-keyword">public</span> Repository[] listRepositories(); |
| 214 | <span class="code-keyword">public</span> Resource getResource(<span class="code-object">String</span> respositoryId); |
| 215 | } |
| 216 | </pre> |
| 217 | </div></div> |
| 218 | |
| 219 | <p>In order to resolve and deploy available resources, the Repository |
| 220 | Admin provides Resolver instances, which are defined as follows:</p> |
| 221 | |
| 222 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
| 223 | <pre class="code-java"><span class="code-keyword">public</span> <span class="code-keyword">interface</span> Resolver |
| 224 | { |
| 225 | <span class="code-keyword">public</span> void add(Resource resource); |
| 226 | <span class="code-keyword">public</span> Requirement[] getUnsatisfiedRequirements(); |
| 227 | <span class="code-keyword">public</span> Resource[] getOptionalResources(); |
| 228 | <span class="code-keyword">public</span> Requirement[] getReason(Resource resource); |
| 229 | <span class="code-keyword">public</span> Resource[] getResources(Requirement requirement); |
| 230 | <span class="code-keyword">public</span> Resource[] getRequiredResources(); |
| 231 | <span class="code-keyword">public</span> Resource[] getAddedResources(); |
| 232 | <span class="code-keyword">public</span> <span class="code-object">boolean</span> resolve(); |
| 233 | <span class="code-keyword">public</span> void deploy(<span class="code-object">boolean</span> start); |
| 234 | } |
| 235 | </pre> |
| 236 | </div></div> |
| 237 | |
| 238 | <p>When desired resources are discovered via the query mechanisms of |
| 239 | the Repository Admin, they are added to a Resolver instance which will |
| 240 | can be used to resolve all transitive dependencies and to reflect on |
| 241 | any resolution result. The following code snippet depicts a typical |
| 242 | usage scenario:</p> |
| 243 | |
| 244 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
| 245 | <pre class="code-java">RepositoryAdmin repoAdmin = ... <span class="code-comment">// Get repo admin service |
| 246 | </span>Resolver resolver = repoAdmin.resolver(); |
| 247 | Resource resource = repoAdmin.discoverResources(filterStr); |
| 248 | resolver.add(resource); |
| 249 | <span class="code-keyword">if</span> (resolver.resolve()) |
| 250 | { |
| 251 | resolver.deploy(<span class="code-keyword">true</span>); |
| 252 | } |
| 253 | <span class="code-keyword">else</span> |
| 254 | { |
| 255 | Requirement[] reqs = resolver.getUnsatisfiedRequirements(); |
| 256 | <span class="code-keyword">for</span> (<span class="code-object">int</span> i = 0; i < reqs.length; i++) |
| 257 | { |
| 258 | <span class="code-object">System</span>.out.println(<span class="code-quote">"Unable to resolve: "</span> + reqs[i]); |
| 259 | } |
| 260 | } |
| 261 | </pre> |
| 262 | </div></div> |
| 263 | |
| 264 | <p>This code gets the Repository Admin service and then gets a Resolver |
| 265 | instance from it. It then discovers an available resource and adds it |
| 266 | to the resolver. Then it tries to resolve the resources dependencies. |
| 267 | If successful it deploys the resource to the local framework instance; |
| 268 | if not successful it prints the unsatisfied requirements.</p> |
| 269 | |
| 270 | <p>OBR's deployment algorithm appears simple at first glance, but it is |
| 271 | actually somewhat complex due to the nature of deploying independently |
| 272 | developed bundles. For example, in an ideal world, if an update for a |
| 273 | bundle is made available, then updates for all of the bundles |
| 274 | satisfying its dependencies are also made available. Unfortunately, |
| 275 | this may not be the case, thus the deployment algorithm might have to |
| 276 | install new bundles during an update to satisfy either new dependencies |
| 277 | or updated dependencies that can no longer be satisfied by existing |
| 278 | local bundles. In response to this type of scenario, the OBR deployment |
| 279 | algorithm tries to favor updating existing bundles, if possible, as |
| 280 | opposed to installing new bundles to satisfy dependencies.</p> |
| 281 | |
| 282 | <p>In the general case, OBR user's will not use the OBR API directly, |
| 283 | but will use its functionality indirectly from another tool or user |
| 284 | interface. For example, interactive access to OBR is available via a |
| 285 | command for Felix' <a href="http://cwiki.apache.org/confluence/display/FELIX/Apache%20Felix%20Shell%20Service" title="Apache Felix Shell Service">shell service</a>. The OBR shell command is discussed in the next section.</p> |
| 286 | |
| 287 | <p><a name="ApacheFelixOSGiBundleRepository-shellcommand"></a></p> |
| 288 | |
| 289 | <h2><a name="ApacheFelixOSGiBundleRepository-OBRShellCommand"></a>OBR Shell Command</h2> |
| 290 | |
| 291 | <p>Besides providing a service API, OBR implements a Felix shell |
| 292 | command for accessing its functionality. For the end user, the OBR |
| 293 | shell command is accessed using the text-based or GUI-based user |
| 294 | interfaces for Felix' shell service. This section describes the syntax |
| 295 | for the OBR shell command.</p> |
| 296 | |
| 297 | <p><a name="ApacheFelixOSGiBundleRepository-obrhelp"></a></p> |
| 298 | |
| 299 | <h3><a name="ApacheFelixOSGiBundleRepository-obrhelp"></a>obr help</h3> |
| 300 | |
| 301 | <p>Syntax:</p> |
| 302 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
| 303 | <pre>obr help [add-url | remove-url | list-url | list | info | deploy | start | source | javadoc] |
| 304 | </pre> |
| 305 | </div></div> |
| 306 | <p>This command is used to display additional information about the other OBR commands.</p> |
| 307 | |
| 308 | <p><a name="ApacheFelixOSGiBundleRepository-obrlisturl"></a></p> |
| 309 | |
| 310 | <h3><a name="ApacheFelixOSGiBundleRepository-obrlisturl"></a>obr list-url</h3> |
| 311 | |
| 312 | <p>Syntax:</p> |
| 313 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
| 314 | <pre>obr list-url |
| 315 | </pre> |
| 316 | </div></div> |
| 317 | <p>This command gets the URLs to the repository files used by the Repository Admin.</p> |
| 318 | |
| 319 | <p><a name="ApacheFelixOSGiBundleRepository-obraddurl"></a></p> |
| 320 | |
| 321 | <h3><a name="ApacheFelixOSGiBundleRepository-obraddurl"></a>obr add-url</h3> |
| 322 | |
| 323 | <p>Syntax:</p> |
| 324 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
| 325 | <pre>obr add-url [<repository-file-url> ...] |
| 326 | </pre> |
| 327 | </div></div> |
| 328 | <p>This command adds a repository file to the set of repository files |
| 329 | for which the Repository Admin service provides access. The repository |
| 330 | file is represented as a URL. If the repository file URL is already in |
| 331 | the Repository Admin's set of repository files, the request is treated |
| 332 | like a reload operation.</p> |
| 333 | |
| 334 | <p><a name="ApacheFelixOSGiBundleRepository-obrremoveurl"></a></p> |
| 335 | |
| 336 | <h3><a name="ApacheFelixOSGiBundleRepository-obrremoveurl"></a>obr remove-url</h3> |
| 337 | |
| 338 | <p>Syntax:</p> |
| 339 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
| 340 | <pre>obr remove-url [<repository-file-url> ...] |
| 341 | </pre> |
| 342 | </div></div> |
| 343 | <p>This command removes a repository file to the set of repository |
| 344 | files for which the Repository Admin service provides access. The |
| 345 | repository file is represented as a URL.</p> |
| 346 | |
| 347 | <p><a name="ApacheFelixOSGiBundleRepository-obrlist"></a></p> |
| 348 | |
| 349 | <h3><a name="ApacheFelixOSGiBundleRepository-obrlist"></a>obr list</h3> |
| 350 | |
| 351 | <p>Syntax:</p> |
| 352 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
| 353 | <pre>obr list [<string> ...] |
| 354 | </pre> |
| 355 | </div></div> |
| 356 | <p>This command lists bundles available in the bundle repository. If no |
| 357 | arguments are specified, then all available bundles are listed, |
| 358 | otherwise any arguments are concatenated with spaces and used as a |
| 359 | substring filter on the bundle names.</p> |
| 360 | |
| 361 | <p><a name="ApacheFelixOSGiBundleRepository-obrinfo"></a></p> |
| 362 | |
| 363 | <h3><a name="ApacheFelixOSGiBundleRepository-obrinfo"></a>obr info</h3> |
| 364 | |
| 365 | <p>Syntax:</p> |
| 366 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
| 367 | <pre>obr info <bundle-name>[;<version>] ... |
| 368 | </pre> |
| 369 | </div></div> |
| 370 | <p>This command displays the meta-data for the specified bundles. If a |
| 371 | bundle's name contains spaces, then it must be surrounded by quotes. It |
| 372 | is also possible to specify a precise version if more than one version |
| 373 | exists, such as:</p> |
| 374 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
| 375 | <pre>obr info "Bundle Repository";1.0.0 |
| 376 | </pre> |
| 377 | </div></div> |
| 378 | <p>The above example retrieves the meta-data for version "1.0.0" of the bundle named "Bundle Repository".</p> |
| 379 | |
| 380 | <p><a name="ApacheFelixOSGiBundleRepository-obrdeploy"></a></p> |
| 381 | |
| 382 | <h3><a name="ApacheFelixOSGiBundleRepository-obrdeploy"></a>obr deploy</h3> |
| 383 | |
| 384 | <p>Syntax:</p> |
| 385 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
| 386 | <pre>obr deploy <bundle-name>[;<version>] ... | <bundle-id> ... |
| 387 | </pre> |
| 388 | </div></div> |
| 389 | <p>This command tries to install or update the specified bundles and |
| 390 | all of their dependencies by default. You can specify either the bundle |
| 391 | name or the bundle identifier. If a bundle's name contains spaces, then |
| 392 | it must be surrounded by quotes. It is also possible to specify a |
| 393 | precise version if more than one version exists, such as:</p> |
| 394 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
| 395 | <pre>obr deploy "Bundle Repository";1.0.0 |
| 396 | </pre> |
| 397 | </div></div> |
| 398 | <p>For the above example, if version "1.0.0" of "Bundle Repository" is |
| 399 | already installed locally, then the command will attempt to update it |
| 400 | and all of its dependencies; otherwise, the command will install it and |
| 401 | all of its dependencies.</p> |
| 402 | |
| 403 | <p><a name="ApacheFelixOSGiBundleRepository-obrstart"></a></p> |
| 404 | |
| 405 | <h3><a name="ApacheFelixOSGiBundleRepository-obrstart"></a>obr start</h3> |
| 406 | |
| 407 | <p>Syntax:</p> |
| 408 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
| 409 | <pre>obr start [-nodeps] <bundle-name>[;<version>] ... |
| 410 | </pre> |
| 411 | </div></div> |
| 412 | <p>This command installs and starts the specified bundles and all of |
| 413 | their dependencies by default; use the "-nodeps" switch to ignore |
| 414 | dependencies. If a bundle's name contains spaces, then it must be |
| 415 | surrounded by quotes. If a specified bundle is already installed, then |
| 416 | this command has no effect. It is also possible to specify a precise |
| 417 | version if more than one version exists, such as:</p> |
| 418 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
| 419 | <pre>obr start "Bundle Repository";1.0.0 |
| 420 | </pre> |
| 421 | </div></div> |
| 422 | <p>The above example installs and starts the "1.0.0" version of the bundle named "Bundle Repository" and its dependencies.</p> |
| 423 | |
| 424 | <p><a name="ApacheFelixOSGiBundleRepository-obrsource"></a></p> |
| 425 | |
| 426 | <h3><a name="ApacheFelixOSGiBundleRepository-obrsource"></a>obr source</h3> |
| 427 | |
| 428 | <p>Syntax:</p> |
| 429 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
| 430 | <pre>obr source [-x] <local-dir> <bundle-name>[;<version>] ... |
| 431 | </pre> |
| 432 | </div></div> |
| 433 | <p>This command retrieves the source archives of the specified bundles |
| 434 | and saves them to the specified local directory; use the "-x" switch to |
| 435 | automatically extract the source archives. If a bundle name contains |
| 436 | spaces, then it must be surrounded by quotes. It is also possible to |
| 437 | specify a precise version if more than one version exists, such as:</p> |
| 438 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
| 439 | <pre>obr source /home/rickhall/tmp "Bundle Repository";1.0.0 |
| 440 | </pre> |
| 441 | </div></div> |
| 442 | <p>The above example retrieves the source archive of version "1.0.0" of |
| 443 | the bundle named "Bundle Repository" and saves it to the specified |
| 444 | local directory.</p> |
| 445 | |
| 446 | <h3><a name="ApacheFelixOSGiBundleRepository-obrjavadoc"></a>obr javadoc</h3> |
| 447 | |
| 448 | <p>Syntax:</p> |
| 449 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
| 450 | <pre>obr javadoc [-x] <local-dir> <bundle-name>[;<version>] ... |
| 451 | </pre> |
| 452 | </div></div> |
| 453 | <p>This command retrieves the javadoc archives of the specified bundles |
| 454 | and saves them to the specified local directory; use the "-x" switch to |
| 455 | automatically extract the javadoc archives. If a bundle name contains |
| 456 | spaces, then it must be surrounded by quotes. It is also possible to |
| 457 | specify a precise version if more than one version exists, such as:</p> |
| 458 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
| 459 | <pre>obr javadoc /home/rickhall/tmp "Bundle Repository";1.0.0 |
| 460 | </pre> |
| 461 | </div></div> |
| 462 | <p>The above example retrieves the javadoc archive of version "1.0.0" |
| 463 | of the bundle named "Bundle Repository" and saves it to the specified |
| 464 | local directory.</p> |
| 465 | |
| 466 | <p><a name="ApacheFelixOSGiBundleRepository-proxy"></a></p> |
| 467 | |
| 468 | <h2><a name="ApacheFelixOSGiBundleRepository-UsingOBRwithaProxy"></a>Using OBR with a Proxy</h2> |
| 469 | |
| 470 | <p>If you use a proxy for Web access, then OBR will not work for you in |
| 471 | its default configuration; certain system properties must be set to |
| 472 | enable OBR to work with a proxy. These properties are:</p> |
| 473 | |
| 474 | <ul> |
| 475 | <li>http.proxyHost - the name of the proxy host.</li> |
| 476 | <li>http.proxyPort - the port of the proxy host.</li> |
| 477 | <li>http.proxyAuth |
| 478 | - the user name and password to use when connecting to the proxy; this |
| 479 | string should be the user name and password separated by a colon (e.g., |
| 480 | rickhall:mypassword).</li> |
| 481 | </ul> |
| 482 | |
| 483 | |
| 484 | <p>These system properties can be set directly on the command line when |
| 485 | starting the JVM using the standard "-D<prop>=<value>" |
| 486 | syntax or you can put them in the lib/system.properties file of your |
| 487 | Felix installation; see documentation on configuring Felix for more |
| 488 | information.</p> |
| 489 | |
| 490 | <p><a name="ApacheFelixOSGiBundleRepository-sourcepackaging"></a></p> |
| 491 | |
| 492 | <h2><a name="ApacheFelixOSGiBundleRepository-BundleSourcePackaging"></a>Bundle Source Packaging</h2> |
| 493 | |
| 494 | <p>Coming soon...</p> |
| 495 | |
| 496 | <p><a name="ApacheFelixOSGiBundleRepository-r3note"></a></p> |
| 497 | |
| 498 | <h2><a name="ApacheFelixOSGiBundleRepository-NoteonOSGiR3Bundles"></a>Note on OSGi R3 Bundles</h2> |
| 499 | |
| 500 | <p>In contrast to OSGi R4 the previous specifications, most notably R3, allowed bundles without the <tt>Bundle-SymbolicName</tt> |
| 501 | header. The Felix OSGi Bundle Repository implementation heavily relies |
| 502 | on the symbolic name being defined in bundles. As a consequence bundles |
| 503 | without a symbolic name are not fully supported by the Bundle |
| 504 | Repository:</p> |
| 505 | |
| 506 | <ul> |
| 507 | <li>Bundles installed in the framework are used by the Bundle |
| 508 | Repository implementation to resolve dependencies regardless of whether |
| 509 | they have a <tt>Bundle-SymbolicName</tt> header or not. Resolution of dependencies against the installed bundles takes place based on the <tt>Export-Package</tt> headers.</li> |
| 510 | <li>Bundles installed in the framework without a <tt>Bundle-SymbolicName</tt> |
| 511 | header cannot be updated by the Bundle Repository implementation |
| 512 | because updates from the bundle repository cannot be correlated to such |
| 513 | "anonymous" bundles.</li> |
| 514 | </ul> |
| 515 | |
| 516 | |
| 517 | |
| 518 | <p><a name="ApacheFelixOSGiBundleRepository-feedback"></a></p> |
| 519 | |
| 520 | <h2><a name="ApacheFelixOSGiBundleRepository-Feedback"></a>Feedback</h2> |
| 521 | |
| 522 | <p>Subscribe to the Felix users mailing list by sending a message to <a href="mailto:users-subscribe@felix.apache.org" rel="nofollow">users-subscribe@felix.apache.org</a>; after subscribing, email questions or feedback to <a href="mailto:users@felix.apache.org" rel="nofollow">users@felix.apache.org</a>.</p> |
| 523 | </div> |
| 524 | </body></html> |