Thursday, November 17, 2016

Open Services Gateway Initiative (OSGi) Terminology

OSGi

Open Services Gateway Initiative is an architecture for modular application development and it’s also knowns as Dynamic Module System for java.

Modularity

Modularity is the way of developing or implementing software as number of unique modules rather than entire software as single unit.

Modules are communicating each other through Application Programming Gateway interface and finally it will form unique system.

OSGi responsibility is to make communication among these modules and manage the lifecycle of modules.

Module

Module is an independent small piece of software and it will fulfill defined business requirements and it can be reuse. Module can work independently or it will associate with other module to prepare complex system. Module consist java files and required configuration files.  

Component

Component is same like module. We can call module and component interchangeably. When compare with scope of component is limited and it’s less than module. A module can be collection of components.

Bundle

A bundle is collection of one or more components. According to the OSGi a bundle is smallest unit of modularization. We can say a bundle is packaged JAR file which consist java classes and required configuration files.

Plugin

Plugin and bundle are similar and in eclipse terminology we call it as plugin.

OSGi Container

OSGi container provides the run time environment to bundles its means it manage the lifecycle of bundles. It will responsible to activate and deactivate bundles and make communication among bundles.

MANIFEST

MANIFEST is configuration file for bundles and OSGi container will read bundle information form this file. It’s same like Deployment descriptor in web applications. It will provides the bundle general information and its dependency with other bundles or components.

OSGi Runtime

OSGi Runtime allows us to register services implementation and consume the existing services.

Service Registry

OSGi Runtime achieved through Service Registry. It maintain the information of services implementation and consume the existing services which are deployed in OSGi container.
OSGi services

OSGi Declarative Service

OSGI Declarative Services is a framework that provide the way to define and consume service by configuring details in the xml file without any dependency in source code to OSGi framework.

Service Component Runtime (SCR)

Service Component Runtime (SCR) is implementation of OSGi Declarative Service from Apache Felix.

OSGi Service Tracker

OSGi Service Tracker responsible to track or finding the services which are registered through service registry in the OSGi runtime.

Bundle Activator

Bundle activator is java class that implements the lifecycle of bundle.

Blueprint

Blueprint is framework form apache which provides the dependency injection nature for OSGi. Its design to deal with dynamic nature of OSGi. It’s similar to Declarative Services.

BnD Tools

BnD provide set of tools to develop OSGi bundles. It’s very easy way to develop OSGi bundles. It will manage bundle dependency and other configurations itself by tool rather developer.

enRoute


The OSGi enRoute project provides a programming model of OSGi applications. The OSGi specifications provide a powerful and solid platform for component oriented programming but by their nature lack ease of use, especially for newcomers to get started.

Author

Wednesday, November 16, 2016

Access Felix Gogo Shell in Liferay 7 from PuTTY Terminal

Felix Gogo shell is command line interface to manage bundles in the OSGi container. We have defined commands are available for Felix Gogo shell, form these we can interact with OSGi container and manage the bundles which are deployed in the OSGi container.

We can manage bundles lifecycle like install, start, stop and uninstall bundles from OSGi container.


Liferay 7 also have used Apache Felix Gogo shell to interact with Liferay Portal Module framework. We can deploy Liferay Application bundles and activate and deactivate bundles.
We have following ways to access Felix Gogo Shell

Access from Telnet client
Access from PuTTY Terminal

Access from Telnet client

The following is Article which describe Access Felix Gogo shell from Telnet client


Access from PuTTY Terminal

PuTTY:

PuTTY is open source terminal which support different protocols like SSH and Telnet.
The following are the steps to Access Felix Gogo shell from PuTTY in Liferay 7.

Download PuTTY
Start Liferay Portal
Access Felix Gogo Shell using PuTTY Terminal

Download PuTTY Software

The following is the place where you can download PuTTY software.


For windows download putty.exe file and place it in your desired location in the system.

Start Liferay 7 Portal

Go to Liferay 7 Portal Tomcat bin directory and start the server and it will take several minutes to start the portal.

The following is the article which describe the Install and Starting the Liferay 7 Portal


Access Felix Gogo Shell using PuTTY Terminal

Now go to the location where you place the putty.exe


Double click on the putty file then it will open run alert then click on run.


Once click on Run the it will open Window there we need to provide the following information of Felix Gogo shell


Host Name : 127.0.0.1
Port : 11311
Connection Type: Telnet




Note:

As we know that Felix Gogo shell running on the port 11311 and localhost that is 127.0.0.1.

Once click on open button then it will open Felix Gogo shell session



Now we can use all Gogo Shell commands to communicate with OSGi container and manage bundles.

List the bundles using lb command


Use help command to see all available Gogo Shell commands



Author

Monday, November 14, 2016

Access Felix Gogo Shell in Liferay 7

Felix Gogo shell is command line interface to manage bundles in the OSGi container. We have defined commands are available for Felix Gogo shell, form these we can interact with OSGi container and manage the bundles which are deployed in the OSGi container.

We can manage bundles lifecycle like install, start, stop and uninstall bundles from OSGi container.


Liferay 7 also have used Apache Felix Gogo shell to interact with Liferay Portal Module framework. We can deploy Liferay Application bundles and activate and deactivate bundles.
To access Felix Gogo shell in Liferay 7 Portal we need telnet client from that we can access Felix Gogo shell.

Windows 7 and 8 Telnet client not enabled in the machine so first we need to enable telnet in our windows machine.

Telnet session on Windows

Click Start > Control Panel.


Click on Programs


Click Programs and Features.



Click Turn Windows features on or off.


In the Windows Features dialog box, check the Telnet Client check box.



Click OK. The system installs the appropriate files. This will take a few seconds to a minute.

Once telnet successfully installed in the machine then we can open the telnet session by using windows command prompt.

Open a Telnet session

Open windows command prompt and Type “telnet” and press ENTER.



The Telnet> prompt is displayed


Access Felix Gogo shell

To access Felix Gogo shell in Liferay portal we need to start Liferay portal. Based on your operating system go to tomcat bin directory and use server start-up command.


Windows

startup.bat

Linux

/startup.sh


Open Windows command prompt go to Liferay Tomcat bin directory then use above commands to start Liferay 7 portal server. When Liferay Portal Started then OSGi container also started and required bundles are installed and started in the OSGi container. Liferay 7 have used Equinox OSGi implementation container.



Apache Felix Gogo shell implemented as there bundles


org.apache.felix.gogo.command_0.12.0
org.apache.felix.gogo.runtime_0.10.0
org.apache.felix.gogo.shell_0.10.0


When Liferay 7 Portal started then three bundles are installed in the Equinox OSGi container and it will be started automatically.

All the information we can find in the Liferay Logs as info messages



Liferay 7 Portal have portal configuration in the “portal.properties” from these properties Portal Module frame work will start, required bundles will install and started automatically. Apart from Felix Gogo shell there are many bundles are installed and started while starting Liferay portal server.

The following are the important Liferay 7 portal properties related to Felix Gogo shell.

               
module.framework.enabled=true

module.framework.initial.bundles=\
    felix-fileinstall.jar@start,\
    ${extra.bundles}/org.apache.felix.gogo.command-0.12.0.jar@start,\
    ${extra.bundles}/org.apache.felix.gogo.runtime-0.10.0.jar@start,\
    ${extra.bundles}/org.apache.felix.gogo.shell-0.10.0.jar@start,\
    ${extra.bundles}/org.eclipse.equinox.console_1.0.0.v20120522-1841.jar@start

module.framework.properties.osgi.console=localhost:11311


Access Felix Gogo shell

Open windows command prompt and use following command to access Felix Gogo shell. Gogo shell running on 11311 port.


telnet localhost 11311




Issue the above command and press the enter then Felix Gogo shell session will open



Now we can use all Felix Gogo shell defied commands to manage bundles in the OSGi container.

Use lb command to see list of bundles available in the OSGi container


Author

                             

Recent Posts

Recent Posts Widget

Popular Posts