Richard S. Hall | 2cd5bed | 2007-07-16 20:32:41 +0000 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
Karl Pauls | 44987e5 | 2007-09-16 20:54:55 +0000 | [diff] [blame^] | 2 | <html><head><title>Apache Felix - Apache Felix Usage Documentation</title> |
Richard S. Hall | 2cd5bed | 2007-07-16 20:32:41 +0000 | [diff] [blame] | 3 | |
| 4 | |
| 5 | |
| 6 | |
Karl Pauls | 44987e5 | 2007-09-16 20:54:55 +0000 | [diff] [blame^] | 7 | <link rel="stylesheet" href="apache-felix-usage-documentation_files/site.css" type="text/css" media="all"> |
| 8 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"></head><body> |
| 9 | <div class="title"><div class="logo"><a href="http://felix.apache.org/site/index.html"><img alt="Apache Felix" src="apache-felix-usage-documentation_files/logo.png" border="0"></a></div><div class="header"><a href="http://www.apache.org/"><img alt="Apache" src="apache-felix-usage-documentation_files/apache.png" border="0"></a></div></div> |
Richard S. Hall | 2cd5bed | 2007-07-16 20:32:41 +0000 | [diff] [blame] | 10 | <div class="menu"> |
Karl Pauls | 44987e5 | 2007-09-16 20:54:55 +0000 | [diff] [blame^] | 11 | <ul> |
| 12 | <li><a href="http://felix.apache.org/site/index.html" title="Index">home</a></li> |
| 13 | <li><a href="http://felix.apache.org/site/news.html" title="news">news</a></li> |
| 14 | <li><a href="http://felix.apache.org/site/status.html" title="status">status</a></li> |
| 15 | <li><a href="http://felix.apache.org/site/license.html" title="license">license</a></li> |
| 16 | <li><span class="nobr"><a href="http://felix.apache.org/site/downloads.cgi" title="Visit page outside Confluence" rel="nofollow">downloads<sup><img class="rendericon" src="apache-felix-usage-documentation_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span></li> |
| 17 | <li><a href="http://felix.apache.org/site/documentation.html" title="documentation">documentation</a></li> |
| 18 | <li><a href="http://felix.apache.org/site/mailinglists.html" title="mailinglists">mailing lists</a></li> |
| 19 | <li><span class="nobr"><a href="http://cwiki.apache.org/confluence/x/O-" title="Visit page outside Confluence" rel="nofollow">wiki<sup><img class="rendericon" src="apache-felix-usage-documentation_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span></li> |
| 20 | <li><a href="http://felix.apache.org/site/committers.html" title="committers">committers</a></li> |
| 21 | <li><a href="http://felix.apache.org/site/faq.html" title="faq">faq</a></li> |
| 22 | <li><a href="http://felix.apache.org/site/roadmap.html" title="roadmap">roadmap</a></li> |
| 23 | <li><a href="http://felix.apache.org/site/sourcecode.html" title="sourcecode">source code</a></li> |
| 24 | <li><a href="http://felix.apache.org/site/codingstandards.html" title="codingstandards">coding standards</a></li> |
| 25 | <li><a href="http://felix.apache.org/site/issuetracking.html" title="issuetracking">issue tracking</a></li> |
| 26 | <li><a href="http://felix.apache.org/site/dependencies.html" title="dependencies">dependencies</a></li> |
| 27 | </ul> </div> |
Richard S. Hall | 2cd5bed | 2007-07-16 20:32:41 +0000 | [diff] [blame] | 28 | <div class="main"> |
| 29 | <h1><a name="ApacheFelixUsageDocumentation-ApacheFelixUsageDocumentation"></a>Apache Felix Usage Documentation</h1> |
| 30 | |
| 31 | <ul> |
| 32 | <li><a href="#ApacheFelixUsageDocumentation-startingfelix" title="starting-felix on Apache Felix Usage Documentation">Starting Felix</a></li> |
| 33 | <li><a href="#ApacheFelixUsageDocumentation-felixshell" title="felix-shell on Apache Felix Usage Documentation">Felix Shell</a> |
| 34 | <ul> |
| 35 | <li><a href="#ApacheFelixUsageDocumentation-installingbundles" title="installing-bundles on Apache Felix Usage Documentation">Installing Bundles</a></li> |
| 36 | <li><a href="#ApacheFelixUsageDocumentation-installingbundlesproxies" title="installing-bundles-proxies on Apache Felix Usage Documentation">Web Proxy Issues when Installing Bundles</a></li> |
| 37 | </ul> |
| 38 | </li> |
| 39 | <li><a href="#ApacheFelixUsageDocumentation-configuringfelix" title="configuring-felix on Apache Felix Usage Documentation">Configuring Felix</a> |
| 40 | <ul> |
| 41 | <li><a href="#ApacheFelixUsageDocumentation-propertysubstitution" title="property-substitution on Apache Felix Usage Documentation">System Property Substitution</a></li> |
| 42 | <li><a href="#ApacheFelixUsageDocumentation-defaultshell" title="default-shell on Apache Felix Usage Documentation">Changing the Command Shell User Interface</a></li> |
| 43 | </ul> |
| 44 | </li> |
| 45 | <li><a href="#ApacheFelixUsageDocumentation-configuringbundles" title="configuring-bundles on Apache Felix Usage Documentation">Configuring Bundles</a></li> |
| 46 | <li><a href="#ApacheFelixUsageDocumentation-feedback" title="feedback on Apache Felix Usage Documentation">Feedback</a></li> |
| 47 | </ul> |
| 48 | |
| 49 | |
| 50 | <p><a name="ApacheFelixUsageDocumentation-startingfelix"></a></p> |
| 51 | |
| 52 | <h2><a name="ApacheFelixUsageDocumentation-StartingFelix"></a>Starting Felix</h2> |
| 53 | <p>Start Felix from the installation directory by typing:</p> |
| 54 | <div class="preformatted"><div class="preformattedContent"> |
| 55 | <pre>java -jar bin/felix.jar |
| 56 | </pre> |
| 57 | </div></div> |
| 58 | <p>After executing the above command, you will be prompted to enter a |
| 59 | profile name; a profile is a simple way to organize sets of installed |
| 60 | bundles and any arbitrary name will suffice. Entering the same profile |
| 61 | name for subsequent executions of Felix will restore the installed |
| 62 | bundles associated with that profile. By default, Felix creates a |
| 63 | directory, called <tt>.felix</tt>, in your home directory and inside |
| 64 | of this directory Felix creates a separate sub-directory for each |
Karl Pauls | 44987e5 | 2007-09-16 20:54:55 +0000 | [diff] [blame^] | 65 | profile; this behavior is configurable, see the <a href="http://felix.apache.org/site/apache-felix-bundle-cache.html" title="Apache Felix Bundle Cache">Apache Felix Bundle Cache</a> |
Richard S. Hall | 2cd5bed | 2007-07-16 20:32:41 +0000 | [diff] [blame] | 66 | document for more details. After you have specified a profile name, the |
| 67 | text-based shell interface is started. It is possible to <a href="#ApacheFelixUsageDocumentation-defaultshell" title="default-shell on Apache Felix Usage Documentation">change your default shell user interface</a>.</p> |
| 68 | |
| 69 | <p><a name="ApacheFelixUsageDocumentation-felixshell"></a></p> |
| 70 | |
| 71 | <h2><a name="ApacheFelixUsageDocumentation-FelixShell"></a>Felix Shell</h2> |
| 72 | <p>The main way to interact with Felix is via its shell service. Felix' |
| 73 | shell service is implemented as an OSGi service that, be default, uses |
| 74 | a simple text-based user interface. After starting Felix, type <tt>help</tt> into the shell to see the list of the available commands; these are the default commands:</p> |
| 75 | <div class="preformatted"><div class="preformattedContent"> |
| 76 | <pre>bundlelevel <level> <id> ... | <id> - set or get bundle start level. |
| 77 | cd [<base-URL>] - change or display base URL. |
| 78 | headers [<id> ...] - display bundle header properties. |
| 79 | help - display shell commands. |
| 80 | install <URL> [<URL> ...] - install bundle(s). |
| 81 | obr help - OSGi bundle repository. |
| 82 | packages [<id> ...] - list exported packages. |
| 83 | ps [-l | -u] - list installed bundles. |
| 84 | refresh - refresh packages. |
| 85 | services [-u] [-a] [<id> ...] - list registered or used services. |
| 86 | shutdown - shutdown Felix. |
| 87 | start <id> [<id> <URL> ...] - start bundle(s). |
| 88 | startlevel [<level>] - get or set framework start level. |
| 89 | stop <id> [<id> ...] - stop bundle(s). |
| 90 | uninstall <id> [<id> ...] - uninstall bundle(s). |
| 91 | update <id> [<URL>] - update bundle. |
| 92 | version - display version of framework. |
| 93 | </pre> |
| 94 | </div></div> |
| 95 | <p>For a detailed description of how to install bundles into Felix refer to the next <a href="#ApacheFelixUsageDocumentation-installingbundles" title="installing-bundles on Apache Felix Usage Documentation">sub-section</a>; the remainder of this section briefly describes shell behavior.</p> |
| 96 | |
| 97 | <p>Despite the fact that the Felix shell tries to mimic a typical Unix-like shell, it is actually quite limited. The notion of <tt>cd</tt>, |
| 98 | for example, is only used to specify a default base URL in order to |
| 99 | save typing. To illustrate, assume that you want to install several |
| 100 | bundles from a directory on your disk, you could type:</p> |
| 101 | <div class="preformatted"><div class="preformattedContent"> |
| 102 | <pre>cd file:/c:/projects/felix/bundle/ |
| 103 | </pre> |
| 104 | </div></div> |
| 105 | <p>After issuing this <tt>cd</tt> command, you no longer need to type |
| 106 | the complete URL for bundles located in the above directory, only the |
| 107 | name of the bundle JAR file is necessary. It is not possible to perform |
| 108 | an equivalent <tt>ls</tt> command to list the contents of the current |
| 109 | base URL, since this operation is not possible with URLs. To view all |
| 110 | currently installed bundles, use the <tt>ps</tt> command.</p> |
| 111 | |
| 112 | <p>To exit the Felix shell, simply type <tt>shutdown</tt>; any bundles |
| 113 | that are loaded will automatically be reloaded the next time you start |
| 114 | the associated profile. Additionally, any bundles that are active, will |
| 115 | be reactivated the next time you start the associated profile.</p> |
| 116 | |
| 117 | <p><a name="ApacheFelixUsageDocumentation-installingbundles"></a></p> |
| 118 | |
| 119 | <h3><a name="ApacheFelixUsageDocumentation-InstallingBundles"></a>Installing Bundles</h3> |
| 120 | <p>A bundle is the OSGi term for a component for the OSGi framework. A |
| 121 | bundle is simply a JAR file containing a manifest and some combination |
| 122 | of Java classes, embedded JAR files, native code, and resources. A |
| 123 | bundle may provide some specific functionality for the user or it may |
| 124 | implement a service that other bundles can use; bundles can only use |
| 125 | functionality from other bundles through shared services and packages.</p> |
| 126 | |
| 127 | <p>Felix is packaged with four bundles, which are located in the <tt>bundle/</tt> |
| 128 | directory of the Felix installation directory. There are bundles for |
| 129 | the Felix shell service, a text-based shell service user interface, a |
| 130 | bundle repository service, and a simple example bundle. In addition to |
| 131 | these bundles, the bundle repository services provides access to many |
| 132 | other bundles for easy installation. The bundle repository service |
Karl Pauls | 44987e5 | 2007-09-16 20:54:55 +0000 | [diff] [blame^] | 133 | provides a shell command, named <tt>obr</tt>, to access available bundles; refer to the <a href="http://felix.apache.org/site/apache-felix-osgi-bundle-repository-obr.html" title="Apache Felix OSGi Bundle Repository (OBR)">Apache Felix OSGi Bundle Repository (OBR)</a> for more information.</p> |
Richard S. Hall | 2cd5bed | 2007-07-16 20:32:41 +0000 | [diff] [blame] | 134 | |
| 135 | <p>Before installing any bundles, it is important to understand how |
| 136 | bundles are manually deployed into the framework. Bundles are deployed |
| 137 | in two stages; first they are installed, then they are started. To |
| 138 | install a bundle use the <tt>install</tt> shell command followed by a bundle URL. For example, to install the <tt>simple.jar</tt> bundle included with Felix you type (assuming you have started Felix from its installation directory):</p> |
| 139 | <div class="preformatted"><div class="preformattedContent"> |
| 140 | <pre>install file:bundle/simple.jar |
| 141 | </pre> |
| 142 | </div></div> |
| 143 | <p>Once a bundle is installed, it can then be started by using the <tt>start</tt> command and the bundle identifier of the desired bundle. The <tt>ps</tt> |
| 144 | shell command is used to list all installed bundles and to obtain the |
| 145 | bundle's identifier. The following Oscar shell session capture |
| 146 | illustrates how to start the <tt>simple.jar</tt> bundle:</p> |
| 147 | <div class="preformatted"><div class="preformattedContent"> |
| 148 | <pre>-> install [file:bundle/simple] |
| 149 | -> ps |
| 150 | START LEVEL 1 |
| 151 | ID State Level Name |
| 152 | [ 0] [Active ] [ 0] System Bundle (0.8.0) |
| 153 | [ 1] [Active ] [ 1] Shell Service (0.8.0) |
| 154 | [ 2] [Active ] [ 1] Shell TUI (0.8.0) |
| 155 | [ 3] [Active ] [ 1] Bundle Repository (0.8.0) |
| 156 | [ 4] [Installed ] [ 1] Simple (0.8.0) |
| 157 | -> start 4 |
| 158 | Simple bundle 4 has started. |
| 159 | From native: Hello! |
| 160 | From embedded JAR: Hello! |
| 161 | Entry: META-INF/ |
| 162 | Entry: org/ |
| 163 | Entry: libfoo.so |
| 164 | The 'javax.servlet.http' package is not available. |
| 165 | The 'javax.servlet' package is not available. |
| 166 | -> |
| 167 | </pre> |
| 168 | </div></div> |
| 169 | <p>The <tt>stop</tt> command is used to stop a bundle and the <tt>uninstall</tt> command is used to remove a bundle from the Felix profile. As an alternative to using the <tt>install</tt> and <tt>start</tt> commands explicitly, it is also possible to install and start a bundle in one step by using the <tt>start</tt> command with a bundle URL.</p> |
| 170 | |
| 171 | <p>Bundles can be updated using the <tt>update</tt> command. The update |
| 172 | command allows you to specify an URL from which to retrieve the updated |
| 173 | bundle, but if one is not specified it will try to update the bundle |
| 174 | from the bundle's <tt>Bundle-UpdateLocation</tt> manifest attribute, if present, or the bundle's original location URL.</p> |
| 175 | |
| 176 | <p><b>Important:</b> When you <tt>update</tt> or <tt>uninstall</tt> a |
| 177 | bundle, the changes appear to take effect immediately, but in reality |
| 178 | the changes are only partially enacted. If a bundle is updated or |
| 179 | uninstalled and it was exporting packages, these packages are not |
| 180 | removed until the framework is refreshed using the <tt>PackageAdmin</tt> service. The Felix shell offers a convenient <tt>refresh</tt> command for this purpose.</p> |
| 181 | |
| 182 | <p>For an introduction to writing bundles and services, refer to the Felix bundle tutorial.</p> |
| 183 | |
| 184 | <p><a name="ApacheFelixUsageDocumentation-installingbundlesproxies"></a></p> |
| 185 | |
| 186 | <h3><a name="ApacheFelixUsageDocumentation-WebProxyIssueswhenInstallingBundles"></a>Web Proxy Issues when Installing Bundles</h3> |
| 187 | <p>If you use a proxy for Web access, then you may run into difficulty |
| 188 | using the Felix shell to install bundles from a remote URL. To remedy |
| 189 | this situation, certain system properties must be set to make Felix |
| 190 | work with your proxy. These properties are:</p> |
| 191 | <ul> |
| 192 | <li><tt>http.proxyHost</tt> - the name of the proxy host.</li> |
| 193 | <li><tt>http.proxyPort</tt> - the port of the proxy host.</li> |
| 194 | <li><tt>http.proxyAuth</tt> |
| 195 | - the user name and password to use when connecting to the proxy; this |
| 196 | string should be the user name and password separated by a colon (e.g., |
| 197 | <tt>rickhall:mypassword</tt>).</li> |
| 198 | </ul> |
| 199 | |
| 200 | |
| 201 | <p>These system properties can be set directly on the command line when starting the JVM using the standard "<tt>-D<prop>=<value></tt>" syntax or you can put them in the <tt>lib/system.properties</tt> file of your Felix installation; see the next section on <a href="#ApacheFelixUsageDocumentation-configuringfelix" title="configuring-felix on Apache Felix Usage Documentation">configuring Felix</a> for more information.</p> |
| 202 | |
| 203 | <p><a name="ApacheFelixUsageDocumentation-configuringfelix"></a></p> |
| 204 | |
| 205 | <h2><a name="ApacheFelixUsageDocumentation-ConfiguringFelix"></a>Configuring Felix</h2> |
| 206 | <p>Felix uses properties to configure certain aspects of its behavior. When you execute Felix using <tt>bin/felix.jar</tt> there are two property files that are consulted, they are <tt>conf/system.properties</tt> and <tt>conf/config.properties</tt> in the Felix installation directory. Both files use standard Java property file syntax.</p> |
| 207 | |
| 208 | <p>The <tt>conf/system.properties</tt> file provides a convenient |
| 209 | mechanism for defining Java system properties, but it is largely |
| 210 | ignored by Felix, since Felix does not use system properties for |
| 211 | configuration purposes. Any properties placed in the <tt>conf/system.properties</tt> file are available at run time via <tt>System.getProperty()</tt> and <tt>BundleContext.getProperty()</tt>. It is also possible to specify a different location for the system properties file by using the <tt>felix.system.properties</tt> system property when executing Felix. For example:</p> |
| 212 | <div class="preformatted"><div class="preformattedContent"> |
| 213 | <pre>java -Dfelix.system.properties=file:/home/rickhall/system.properties -jar bin/felix.jar |
| 214 | </pre> |
| 215 | </div></div> |
| 216 | <p>When executing Felix, nearly configuration occurs using properties in the <tt>conf/config.properties</tt> file. It is possible to change the location of the configuration properties file by specifying a new location value using the <tt>felix.config.properties</tt> |
| 217 | system property. It is necessary to use a system property here since |
| 218 | Felix needs this value to start execution. As an example, the following |
| 219 | command could be used to specify a custom location for the |
| 220 | configuration properties file:</p> |
| 221 | <div class="preformatted"><div class="preformattedContent"> |
| 222 | <pre>java -Dfelix.config.properties=file:/home/rickhall/config.properties -jar bin/felix.jar |
| 223 | </pre> |
| 224 | </div></div> |
| 225 | <p>In this example the configuration properties will be read from the |
| 226 | specified URL. All remaining configuration properties should be defined |
| 227 | in the <tt>config.properties</tt> file itself. All configuration properties are accessible at run time via <tt>BundleContext.getProperty()</tt>.</p> |
| 228 | |
| 229 | <p>Felix does provide one other way to specify configuration |
| 230 | properties, but to do so you must manually instantiate an instance of |
| 231 | Felix, rather than executing Felix' JAR file. When you create your own |
| 232 | instance of Felix, it is possible to pass in precise configuration |
| 233 | properties to the <tt>Felix.start()</tt> method. If this approach is used, then no property files are consulted.</p> |
| 234 | |
| 235 | <p>The following properties describes the purpose of each Felix configuration property:</p> |
| 236 | <ul> |
| 237 | <li><tt>felix.log.level</tt> - An integer value indicating the |
| 238 | degree of logging reported by the framework; a higher value results in |
| 239 | more logging. If zero ('0') is specified, then logging is turned off |
| 240 | completely. The log levels match those specified in the OSGi Log |
| 241 | Service (i.e., 1 = error, 2 = warning, 3 = information, and 4 = debug). |
| 242 | The default value is 1.</li> |
| 243 | <li><tt>felix.auto.install.<n></tt> - Space-delimited list of bundle URLs to automatically install when Felix is started, where <tt><n></tt> is the start level into which the bundle will be installed (e.g., <tt>felix.auto.install.2</tt>).</li> |
| 244 | <li><tt>felix.auto.start</tt> - Space-delimited list of bundle URLs to automatically install and start when Oscar is started, where <tt><n></tt> is the start level into which the bundle will be installed (e.g., <tt>felix.auto.start.2</tt>).</li> |
| 245 | <li><tt>felix.startlevel.framework</tt> - The initial start level of the framework once it starts execution; the default value is 1.</li> |
| 246 | <li><tt>felix.startlevel.bundle</tt> - The default start level for newly installed bundles; the default value is 1.</li> |
| 247 | <li><tt>felix.service.urlhandlers</tt> - Flag to indicate whether Felix should enable the URL Handlers service, which will result in calls to <tt>URL.setURLStreamHandlerFactory()</tt> and <tt>URLConnection.setContentHandlerFactory()</tt>. The default value is "<tt>true</tt>" to enable the URL Handlers service.</li> |
| 248 | <li><tt>felix.embedded.execution</tt> - Flag to indicate whether Felix is embedded into a host application; the default value is "<tt>false</tt>". If this flag is "<tt>true</tt>" then Felix will not call <tt>System.exit()</tt> upon termination.</li> |
| 249 | <li><tt>felix.strict.osgi</tt> - Flag to indicate whether Felix is running in strict OSGi mode; the default value is "<tt>true</tt>". If this flag is "<tt>false</tt>" it currently enables a single non-OSGi-compliant feature: persisting <tt>BundleActivator</tt>s that implement <tt>Serializable</tt>. This feature is not recommended since it is non-compliant.</li> |
| 250 | <li><tt>felix.cache.bufsize</tt> |
| 251 | - Sets the buffer size to be used by the bundle cache when copying JAR |
| 252 | files and input streams; the default value is 4096 bytes. The integer |
| 253 | value of this string provides control over the size of the internal |
| 254 | buffer of the disk cache for performance reasons.</li> |
| 255 | <li><tt>felix.cache.dir</tt> |
| 256 | - Sets the directory to be used by the bundle cache as its cache |
| 257 | directory. The cache directory is where all profile directories are |
| 258 | stored and a profile directory is where a set of installed bundles are |
| 259 | stored. By default, the cache directory is <tt>.felix</tt> in the user's home directory. If this property is specified, then its value will be used as the cache directory instead of <tt>.felix</tt>. This directory will be created if it does not exist.</li> |
| 260 | <li><tt>felix.cache.profile</tt> |
| 261 | - Sets the profile name that will be used to create a profile directory |
| 262 | inside of the bundle cache directory. The created directory will |
| 263 | contain all installed bundles associated with the profile.</li> |
| 264 | <li><tt>felix.cache.profiledir</tt> |
| 265 | - Sets the directory to use as the profile directory for the bundle |
| 266 | cache; by default the profile name is used to create a directory in the |
| 267 | <tt>.felix</tt> bundle cache directory (more precisely <tt>${felix.cache.dir}/${felix.cache.profile</tt>}). If the <tt>felix.cache.profiledir</tt> |
| 268 | property is specified, then the cache directory and profile name |
| 269 | properties are ignored since they are only used to calculate the |
| 270 | profile directory. The specified value of the profile directory |
| 271 | property is used directly as the directory to contain all cached |
| 272 | bundles. This directory will be created if it does not exist.</li> |
| 273 | </ul> |
| 274 | |
| 275 | |
| 276 | <p>The Felix installation contains a default <tt>conf/config.properties</tt> file for automatically starting the shell-related bundles.</p> |
| 277 | |
| 278 | <p><a name="ApacheFelixUsageDocumentation-propertysubstitution"></a></p> |
| 279 | |
| 280 | <h3><a name="ApacheFelixUsageDocumentation-SystemPropertySubstituion"></a>System Property Substituion</h3> |
| 281 | <p>It is possible to use system properties to specify the values of properties in the <tt>conf/config.properties</tt> file. This is achieved through system property substitution, which is instigated by using <tt>${<property></tt>} syntax, where <tt><property></tt> |
| 282 | is the name of a system property to substitute. When such a property |
| 283 | value is retrieved by a bundle, the system property value will be |
| 284 | substituted into the bundle property value as appropriate.</p> |
| 285 | |
| 286 | <p><a name="ApacheFelixUsageDocumentation-defaultshell"></a></p> |
| 287 | |
| 288 | <h3><a name="ApacheFelixUsageDocumentation-ChangingtheCommandShellUserInterface"></a>Changing the Command Shell User Interface</h3> |
| 289 | <p>Felix' shell service supports multiple user interface |
| 290 | implementations; the default shell user interface is text-based, but a |
| 291 | simple graphical shell is also available. To change the default shell |
| 292 | user interface, you must download the Shell GUI and Shell GUI Plugin |
| 293 | bundles. Then you must modify the <tt>felix.auto.start</tt> property in the <tt>conf/config.properties</tt> file of your Felix installation. For the text-based user interface, the property value should look like this:</p> |
| 294 | <div class="preformatted"><div class="preformattedContent"> |
| 295 | <pre>felix.auto.start.1=file:bundle/shell.jar file:bundle/shelltui.jar \ |
| 296 | file:bundle/bundlerepository.jar |
| 297 | </pre> |
| 298 | </div></div> |
| 299 | <p>This property value instructs Felix to automatically start the shell |
| 300 | service, the shell textual user interface, and the bundle repository. (<em>Note: |
| 301 | The "\" character at the end of the above line indicates that the |
| 302 | property value continues on the next line; it is also possible to |
| 303 | specify the property value on one line.</em>) For the GUI-based shell user interface, the property value should look something like this:</p> |
| 304 | <div class="preformatted"><div class="preformattedContent"> |
| 305 | <pre>felix.auto.start.1=file:bundle/shell.jar file:bundle/bundlerepository.jar \ |
| 306 | file:bundle/shellgui.jar file:bundle/shellplugin.jar |
| 307 | </pre> |
| 308 | </div></div> |
| 309 | <p>This property value instructs Felix to automatically start the shell |
| 310 | service, the bundle repository, the shell GUI, and the shell GUI |
| 311 | plugins.</p> |
| 312 | |
| 313 | <p><a name="ApacheFelixUsageDocumentation-configuringbundles"></a></p> |
| 314 | |
| 315 | <h2><a name="ApacheFelixUsageDocumentation-ConfiguringBundles"></a>Configuring Bundles</h2> |
| 316 | <p>Some bundles use properties to configure certain aspects of their behavior. As an example, the default URL for the <tt>cd</tt> command of the shell service can be specified using the property <tt>felix.shell.baseurl</tt>. |
| 317 | It is a good idea, when implementing bundles, to parameterize them with |
| 318 | properties where appropriate. To learn about the configuration options |
| 319 | for specific bundles, refer to the documentation that accompanies them.</p> |
| 320 | |
| 321 | <p>Bundle properties are also defined in the <tt>conf/config.properties</tt> property file. Any property placed in this file will be accessible via <tt>BundleContext.getProperty()</tt> |
| 322 | at run time. The property file uses the standard Java property file |
| 323 | syntax (i.e., attribute-value pairs). For information on changing the |
| 324 | default location of this file, refer to the section on <a href="#ApacheFelixUsageDocumentation-configuringfelix" title="configuring-felix on Apache Felix Usage Documentation">configuring Felix</a>.</p> |
| 325 | |
| 326 | <p><a name="ApacheFelixUsageDocumentation-feedback"></a></p> |
| 327 | |
| 328 | <h2><a name="ApacheFelixUsageDocumentation-Feedback"></a>Feedback</h2> |
| 329 | |
Karl Pauls | 44987e5 | 2007-09-16 20:54:55 +0000 | [diff] [blame^] | 330 | <p>Subscribe to the Felix users mailing list by sending a message to <span class="nobr"><a href="mailto:users-subscribe@felix.apache.org" title="Send mail to users-subscribe@felix.apache.org" rel="nofollow">users-subscribe@felix.apache.org<sup><img class="rendericon" src="apache-felix-usage-documentation_files/mail_small.gif" alt="" align="absmiddle" border="0" height="12" width="13"></sup></a></span>; after subscribing, email questions or feedback to <span class="nobr"><a href="mailto:users@felix.apache.org" title="Send mail to users@felix.apache.org" rel="nofollow">users@felix.apache.org<sup><img class="rendericon" src="apache-felix-usage-documentation_files/mail_small.gif" alt="" align="absmiddle" border="0" height="12" width="13"></sup></a></span>.</p> |
Richard S. Hall | 2cd5bed | 2007-07-16 20:32:41 +0000 | [diff] [blame] | 331 | </div> |
Karl Pauls | 44987e5 | 2007-09-16 20:54:55 +0000 | [diff] [blame^] | 332 | |
| 333 | </body></html> |