8 mins
Oct 20, 2021
There have been various developments in the field of Java since its evolution. It has provided a robust programming platform for the developers. Additionally, Java has also served as a true source to various other programing interfaces. Liferay has been the one which has enabled multiple organizations to work on same platform. Having not so much time of its release, Liferay has been well accredited by the users.
Apparently, known to all the developers, Liferay has also been created into various versions so far. The beta version of Liferay 7 has been released recently for the developers. This newer version allows the old plugins to run swiftly. However, at some places the APIs have been modified, which would have to be adapted for the new version. Apart from all these, Liferay has come with various changes; the one noticeable among which is working with OSGI.
Open Source Gateway Initiated or OSGI as it is mostly abbreviated, is a framework. This is used to develop modular Java applications. The components also referred to as the bundles could be easily installed, uninstalled, started or stopped and that too remotely. The current version of Liferay i.e. Liferay 6.2, includes OSGI runtime which could run OSGI bundles encapsulated with Liferay plugins.
OSGI is basically an open standards organization which has been maintaining its OSGI standard since March 1999. It comes up as a modular system and a service platform for Java programming language. The service registry of OSGI also helps the bundles to determine the inclusion or exclusion of the service. It has various illustrious members like that of IBM, Oracle, Red Hat, Adobe, Siemens, TIBCO, France Telecom, Deutsche Telekom, Technicolor and many more.
Generally distributed as JAR files, OSGI web bundles are similar to standard web application archives in terms of their architecture. OSGI specification doesn’t need any file extension for web application bundles. Further, in order to create an OSGI plugin for Liferay, the user will need a Liferay Plugin SDK. The plugins could also be downloaded from the link.
After the Plugins SDK are extracted and navigated to the shared folder, the user must create a folder for OSGI plugin project in the shared folder. A project made in such a format must end with “–shared”.
OSGI has come up with better scopes and opportunities for the developers. Take a look at its benefits that developers will have while using this platform-
Apart from providing programming convenience to the developers, OSGI also benefits to the businesses. It helps to reduce the operational costs by integrating multiple devices through a single network. This allows it to deal effectively with the costly application development along with remote service management.
While implementing OSGI into regular coding, you need to use classes normally from the point of Java. Consider the following code snippet-
package org.acme.package1; import org.acme.package2.MyClass; — MyClass ax = new MyClass(); ax.foo()
Further when it comes to the OSGI Module Metadata in Manifest.MF then the utilization of packages would be like:
Export-Package: org.acme.package1; version=1.2 Import-Package: org.acme.package2; version=(1.1, 2)
From the services, modularity and results, it could be certainly mentioned that implementation of OSGI with software product development has truly brought a favorable change to the programming techniques and resultant outputs not only for the developers but also for the campaigns.