Chapter 12. The Web Management Console

So far, we've used the command-line Text UI to administer our Felix instance. It's a good interface when the administrator has direct access to the host where Felix is running.

However, in many situations, especially on production platforms, the backend servers and their OS processes are managed by monitoring systems that ensure they are running and restart them when they fail. In those cases, it's hard to have and keep a command-line interface such as the one provided by default.

There are services that provide the same kind of command-line shell access remotely, through Telnet, if a command-line operation is necessary or a graphical interface is not possible.

However, when possible, it's easier to manage a set of services graphically. Using a graphical interface improves the readability of the provided content by structuring it and displaying it with a nice style. The Web Management Console is an extension that registers itself with the Http Service and provides a Graphical User Interface (GUI) for the management of the instance.

In this chapter, you will:

  • Install the Felix Web Management Console
  • Learn how to transform a regular JAR for use in an OSGi framework
  • Take a brief walk around it, going through some of its menu tabs
  • Extend it with the iPOJO WebConsole Plugins, which extend the Web Console with the iPOJO inspection functionality

Getting started

The Web Management console provides a visual representation of operations we've already seen when using the Shell TUI commands.

Let's start by installing it. Later, we'll go over its pages and describe a few of them.

Installing the Web Console

The Web Management Console has a few mandatory and optional dependencies. The mandatory dependencies are:

  • OSGi Http Service: Provides the web container functionality
  • Apache Commons IO: Library that provides common I/O functionality
  • Apache Commons FileUpload: For file upload functionality
  • JSON: For JavaScript Object Notation, a library that implements this simple data interchange format

We've already installed the Felix Http Service implementation of the OSGi Http Service in Chapter 11, How about a Graphical Interface?, so this one's covered.

The last three dependencies are to be installed manually. To simplify this process, the Web Console comes in two flavors the full bundle, which also contains those last three dependencies, and the bare bundle, which doesn't.

Note

Personally, I find it useful to keep a very close check on dependency versions. This allows updating one of those dependencies if a bug fix comes out. Therefore, I'll take you through the steps to install the bare bundle. If you're not interested, then you'll want to get the link to the full bundle and install it.

The optional dependencies are used if they are found. They are as follows:

  • OSGi Log Service: If installed, the console provides access to the log entries
  • OSGi Configuration Admin Service and OSGi Metatype Service: If installed, the console provides configuration administration functionality
  • Apache Felix Declarative Services: If installed, the console provides functionality to inspect declared components

In our case, we have the log service installed, so this functionality will be enabled.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.237.194