Time for action - starting Felix

As mentioned a bit earlier, the Felix framework start-up Java class resides in the main bundle, located in the bin directory of the distribution.

To launch Felix from the distribution base directory, in a command-line shell, run:

C:felix>java -jar bin/felix.jar

When Felix launches, it displays a welcome message followed by a command prompt:

_______________
Welcome to Apache Felix Gogo

This means that the Felix user Interface is now ready to accept user commands. Felix Gogo is the default shell environment for the Felix framework. We'll look at it in greater detail in Chapter 3.

Note

You'll need to type this command every time you start Felix, it may be a good idea to create a start-up script. Under Windows, a batch file (for example, run.bat) containing the preceding command will do the trick.

What just happened?

Behind the scenes, the launch of the Felix application had started the system bundle and all the bundles that were placed for auto-deploy.

Felix has performed the following operations:

  1. It has started System Bundle (which is felix.jar).
  2. Installed and then started the auto-deploy bundles (from the bundle directory):
    • Apache Felix Bundle Repository (org.apache.felix.bundlerepository), which provides tools to find, download, install, and manage installed bundles. You will learn about the commands provided by this service in a bit. Later, in Chapter 6, Using the OSGi Bundle Repository, you will also learn some more on bundle repositories
    • Apache Felix Gogo Runtime (org.apache.felix.gogo.runtime), which provides the core command processing functionality
    • Apache Felix Gogo Shell (org.apache.felix.gogo.shell), which provides the text user interface for interaction with the command processing service
    • Apache Felix Gogo Command (org.apache.felix.gogo.command), which provides a set of basic commands for the operation of the framework
  3. When the Gogo Shell bundle is active, it accepts input from the user on the command shell, parses it, and passes it onto the Gogo Runtime service which attempts to map it to a registered command.

The start of the Gogo text user Interface displays the command-line prompt (g! ). It is now ready to accept commands.

Note

As new bundles are started on the framework, their information is kept in the felix-cache directory and they will also be automatically started when the framework is started.

In the next chapter, we will take a closer look at Gogo and understand some of the commands provided by the Gogo Command bundle.

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

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