1
Managing an
OSGi Framework with
Apache Felix Web Console
Felix Meschberger
Adobe
ApacheCon NA 10
2
About
• Senior Developer at Adobe
• fmeschbe@apache.org
• http://blog.meschberger.ch
• Apache Projects:
– Sling
– Felix
...
3
Contents
• Problem / Solutions
• History
• Features
• Install
• Use
• Extend
• Questions
4
Problem
• Manage an OSGi Framework
• Remote Access
• Ease of Use
• Extensibility
• Offline Support
5
Solutions
• Text
– Apache Felix Shell
– Apache Felix Gogo
– Knopflerfish Shell
– Equinox Console (built-in)
– OSGi RFC 1...
6
Contents
• Problem / Solutions
• History
• Features
• Install
• Use
• Extend
• Questions
7
History
2006/09/17 Initial Commit of a
Web Management Bundle
2007/06/18 First Release
2007/09/10 Incubating Sling
2008/0...
8
Day Web Manager 1.0.0
9
Felix Web Console 1.0.0
10
Felix Web Console 3.1.6
11
Contents
• Problem / Solutions
• History
• Features
• Install
• Use
• Extend
• Questions
12
Features
• Rich Set of Core Functionality
• JQuery UI based GUI
• REST API
• Pluggable Authentication
• Extensible
• Li...
13
Features (cont.)
• Manage Bundles
• List Services
• Manage DS Components
• Shell
• System Information
• Configuration S...
14
Contents
• Problem / Solutions
• History
• Features
• Install
• Use
• Extend
• Questions
15
Installation
• Requirement: OSGi Http Service
• Download, Install and Start Bundle
• Requirement: OSGi Http Service
• D...
16
Contents
• Problem / Solutions
• History
• Features
• Use
• Extend
• Questions
17
Use - Demo
• Sling Trunk Build
• Access
• Default Page: Bundles
• Configuration
• System Status
• …
18
Contents
• Problem / Solutions
• History
• Features
• Install
• Use
• Extend
• Questions
19
Extension Points
• Plugins
• Configuration Printer
• Branding
• Security Provider
• Translations
20
Plugins
• javax.servlet.Servlet services
• Service Properties
– felix.webconsole.label
– felix.webconsole.title
• Exten...
21
Plugin Rendering Area
22
Simple Plugin (1)
@Component
@Service(Servlet.class)
@Properties({
@Property(name="felix.webconsole.label",
value="samp...
23
Simple Plugin (2)
public class Sample2 extends SimpleWebConsolePlugin {
public Sample2(BundleContext ctx) {
super("samp...
24
Configuration Printer
• Information Dump for Offline Use
• Selective Destination
– Screen Only
– All-in-one Text
– ZIP ...
25
Interfaces
• ConfigurationPrinter
– Service Name
– Simply print plain text
• ModeAwareConfigurationPrinter
– Extends Co...
26
Branding
• BrandingPlugin
– Service interface
• DefaultBrandingPlugin
– Default Branding
• Branding Fragment
– /META-IN...
27
Sling Branding Properties
webconsole.brand.name = 
Apache Sling Web Console
webconsole.product.name = 
Apache Sling
web...
28
Security Provider
• WebConsoleSecurityProvider
–Service interface
–Validate Username / Password
–HTTP Basic Authenticat...
29
Security Provider
• Default
– Single configurable User
• Karaf
– JAAS based authentication
• Sling
– Authenticates agai...
30
Translations
• Out-of-the-box
– Bulgarian, English, German, Russian
• Extensible
– Fragment to the Web Console
– Based ...
31
Maven Sling Plugin
• install
– Install a Bundle after a build
– Similar to deploy:deploy
• install-file
– Install a Bun...
32
Contents
• Problem / Solutions
• History
• Features
• Install
• Use
• Extend
• Questions
Upcoming SlideShare
Loading in …5
×

Managing an OSGi Framework with Apache Felix Web Console

8,391 views

Published on

Initially created to aid in the simple maintenance of the OSGi framework and the application during the early development of Apache Sling, the Web Console soon attracted interest from the OSGi community. Three years later, the Apache Felix Web Console 3.0 has just been released and provides an extensible console for Web based management of an OSGi framework. This talk will introduce the functionality of the core Web Console as well as some of its existing plugins and the extension points of the Web Console where developers might want to hook up to. To round it up a simple Web Console plugin will be developed and deployed.

Published in: Technology, Education
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
8,391
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
0
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Managing an OSGi Framework with Apache Felix Web Console

  1. 1. 1 Managing an OSGi Framework with Apache Felix Web Console Felix Meschberger Adobe ApacheCon NA 10
  2. 2. 2 About • Senior Developer at Adobe • fmeschbe@apache.org • http://blog.meschberger.ch • Apache Projects: – Sling – Felix – Jackrabbit
  3. 3. 3 Contents • Problem / Solutions • History • Features • Install • Use • Extend • Questions
  4. 4. 4 Problem • Manage an OSGi Framework • Remote Access • Ease of Use • Extensibility • Offline Support
  5. 5. 5 Solutions • Text – Apache Felix Shell – Apache Felix Gogo – Knopflerfish Shell – Equinox Console (built-in) – OSGi RFC 147 (Command Line Interface) • GUI – Apache Felix Web Console – Knopflerfish Desktop (Swing)
  6. 6. 6 Contents • Problem / Solutions • History • Features • Install • Use • Extend • Questions
  7. 7. 7 History 2006/09/17 Initial Commit of a Web Management Bundle 2007/06/18 First Release 2007/09/10 Incubating Sling 2008/05/16 Move to Apache Felix 2008/05/20 First Apache Felix Release 2010/11/06 Latest Release 3.1.6
  8. 8. 8 Day Web Manager 1.0.0
  9. 9. 9 Felix Web Console 1.0.0
  10. 10. 10 Felix Web Console 3.1.6
  11. 11. 11 Contents • Problem / Solutions • History • Features • Install • Use • Extend • Questions
  12. 12. 12 Features • Rich Set of Core Functionality • JQuery UI based GUI • REST API • Pluggable Authentication • Extensible • Light-weight
  13. 13. 13 Features (cont.) • Manage Bundles • List Services • Manage DS Components • Shell • System Information • Configuration Status
  14. 14. 14 Contents • Problem / Solutions • History • Features • Install • Use • Extend • Questions
  15. 15. 15 Installation • Requirement: OSGi Http Service • Download, Install and Start Bundle • Requirement: OSGi Http Service • Download, Install and Start Bundle $ java -Dorg.apache.felix.http.jettyEnabled=true -Dorg.osgi.service.http.port=9999 -jar org.eclipse.osgi_3.6.1.R36x_v20100806.jar -console osgi> install http://apache.multihomed.net/felix/org.apache.felix.log-1.0.0.jar Bundle id is 1 osgi> install http://apache.multihomed.net/felix/org.apache.felix.http.bundle-2.0.4.jar Bundle id is 2 osgi> install http://apache.multihomed.net/felix/org.apache.felix.configadmin-1.2.8.jar Bundle id is 3 osgi> install http://apache.multihomed.net/felix/org.apache.felix.metatype-1.0.4.jar Bundle id is 4 osgi> install http://apache.multihomed.net/felix/org.apache.felix.webconsole-3.1.2.jar Bundle id is 5 osgi> start 1 2 3 4 5
  16. 16. 16 Contents • Problem / Solutions • History • Features • Use • Extend • Questions
  17. 17. 17 Use - Demo • Sling Trunk Build • Access • Default Page: Bundles • Configuration • System Status • …
  18. 18. 18 Contents • Problem / Solutions • History • Features • Install • Use • Extend • Questions
  19. 19. 19 Extension Points • Plugins • Configuration Printer • Branding • Security Provider • Translations
  20. 20. 20 Plugins • javax.servlet.Servlet services • Service Properties – felix.webconsole.label – felix.webconsole.title • Extend AbstractWebConsolePlugin (optional) • Navigation, etc. taken care of
  21. 21. 21 Plugin Rendering Area
  22. 22. 22 Simple Plugin (1) @Component @Service(Servlet.class) @Properties({ @Property(name="felix.webconsole.label", value="sample"), @Property(name="felix.webconsole.label", value="Sample Plugin #1") }) public class Sample extends HttpServlet { public void service(HttpServletRequest req, HttpServletResponse res) throws IOException { res.getWriter().println("Hi There"); } }
  23. 23. 23 Simple Plugin (2) public class Sample2 extends SimpleWebConsolePlugin { public Sample2(BundleContext ctx) { super("sample2", "Sample Plugin #2", null); register(ctx); } protected void renderContent( HttpServletRequest req, HttpServletResponse res) throws IOException { res.getWriter().println("Hi There") } }
  24. 24. 24 Configuration Printer • Information Dump for Offline Use • Selective Destination – Screen Only – All-in-one Text – ZIP File • Optional Attachements
  25. 25. 25 Interfaces • ConfigurationPrinter – Service Name – Simply print plain text • ModeAwareConfigurationPrinter – Extends ConfigurationPrinter – Selective Output • AttachmentProvider – Additional Data for ZIP File
  26. 26. 26 Branding • BrandingPlugin – Service interface • DefaultBrandingPlugin – Default Branding • Branding Fragment – /META-INF/webconsole.properties • Sample – Sling Web Console Branding Plugin
  27. 27. 27 Sling Branding Properties webconsole.brand.name = Apache Sling Web Console webconsole.product.name = Apache Sling webconsole.product.url = http://sling.apache.org webconsole.product.image = /res/sling/logo.png webconsole.favicon = /res/sling/favicon.ico
  28. 28. 28 Security Provider • WebConsoleSecurityProvider –Service interface –Validate Username / Password –HTTP Basic Authentication Based –Access Control (hook only) • WebConsoleSecurityProvider2 –Extends WebConsoleSecurityProvider –Flexible Authentication
  29. 29. 29 Security Provider • Default – Single configurable User • Karaf – JAAS based authentication • Sling – Authenticates against JCR Repository – Supports Sling Authentication Setup
  30. 30. 30 Translations • Out-of-the-box – Bulgarian, English, German, Russian • Extensible – Fragment to the Web Console – Based on Standard Bundle Localization – OSGI-INF/l10n/bundle*.properties
  31. 31. 31 Maven Sling Plugin • install – Install a Bundle after a build – Similar to deploy:deploy • install-file – Install a Bundle independent of a build – Similar to deploy:deploy-file • uninstall – Uninstall a Bundle • See: http://s.apache.org/yo
  32. 32. 32 Contents • Problem / Solutions • History • Features • Install • Use • Extend • Questions

×