'3. Implementation/OSGI'에 해당되는 글 5건
- 2014.11.29 Bndtools
- 2014.11.25 Support telnet on OSGI Console
- 2014.11.25 Modularizing existing web applications with OSGi
- 2014.11.24 Target Definition
- 2014.11.22 OSGI Useful commands
Bndtools
It seems to be very helpful when developing the OSGI bundle.
The easy, powerful and productive way to develop with OSGi. Based on bnd and Eclipse.
Support telnet on OSGI Console
Type the following command at the OSGI console.
osgi> telnetd --port 1234 start telnetd is running on 127.0.0.1:1234 osgi>
|
Modularizing existing web applications with OSGi
The following site gives good explanation and examples to show how to modularize existing web applications with OSGI.
http://server.dzone.com/articles/modularizing-existing-web
To make examples to be run, the point is that you should make the new Target definition which loads bundles under [example]/rsp_repository/rsp_target_platform.
and don't forget to copy org.eclipse.pde.http.ui_1.0.0.jar file to the dropins folder under eclipse installed folder.
The following picture shows example.
Target Definition
Target definition can be added by
Windows > Preferences > Plug-in Development > Target Platform menu.
: Reload command is useful when you copied some bundle to plugin folder newly.
: In the case of locations, variables can be used as below
ex) ${project_loc}\lib
ex) ${eclipse_home}
If you specify import packages in the MANIFEST.MF file as below,
Import-Package:
javax.servlet.jsp.jstl.fmt
If no problem is, the specified jar will be added to the Plug-in Dependencies.
If not, check if the jar file including that package is in the target definition folder. This validation can be run at the "Run configuration" dialog as well.
OSGI Useful commands
help
: lists all available commands
ss | grep text
: lists services which matches with text
bundle [bundle id]
: prints detailed information like Id,Status, Data Root and etc.
b [build id]
: prints all meta data related to this bundle
update [bundle id]
: applies newest bundle
diag [bundle id]
: prints diagnose messages
packages [package name]
: lists all the bundles which use the given package. Wild card can be used at package name.
install file:[file path]
: install a bundle into running OSGI environment.
* [bundle symbolic name] also can be sued instead of [bundle id]
* And more useful console
Command | Description |
---|---|
start | Starts a bundle given an ID or symbolic name |
stop | Stops a bundle given an ID or symbolic name |
install | Adds a bundle given a URL for the current instance |
uninstall | Removes a bundle given a URL for the current instance |
update | Updates a bundle given a URL for the current instance |
active | Lists all active bundles in the current instance |
headers | List the headers for a bundle given an ID or symbolic name |
ss | Lists a short status of all the bundles registered in the current instance |
services <filter> | Lists services given the proper filter |
diag | Runs diagnostics on a bundle given an ID or symbolic name |
Refer :
http://www.ibm.com/developerworks/library/os-ecl-osgiconsole/
http://isurues.wordpress.com/2009/01/01/useful-equinox-osgi-commands/