Welcome!

Machine Learning Authors: William Schmarzo, Kevin Jackson, Stackify Blog, Elizabeth White, Pat Romanski

Related Topics: Java IoT

Java IoT: Article

Adopting OSGi in Java Application Frameworks: A Case Study

Defining reusable software system components

Migration of software systems to the OSGi platform is gaining momentum with wide acceptance of the OSGi technology as the dynamic module system for Java. This transition is of special interest when it comes to popular Java application frameworks, which attract a growing number of Java developers around the world. Although the technical merits of the OSGi platform are broadly recognized, the migration of existing application frameworks is slow due to significant redesign and re-implementation efforts involved. We present an alternative lightweight approach - an adaptation of existing Java application framework for component based OSGi environment. Adaptation, as opposed to migration, eliminates the necessity of modularizing or redesigning the existing framework. This is particularly important when existing software platform and the associated programming model is mature and has already penetrated into the market place. As a general adaptation solution we introduce a thin layer between the OSGi Service Platform and the existing framework. Furthermore, we present the case study of an OSGi adaptation of a popular open source Java platform developed by IBM Research for integration of software analytics. Our results demonstrate that the adaptation approach is not limited to the presented case, but is broadly applicable to a variety of Java application frameworks.

Introduction
The software development and support costs are driven by increase in software complexity, thrust to reduce product cycles and the need to support multiple hardware and operating systems. There is an increasing emphasis on creating modular software solutions to enable reuse of software parts to reduce the cost and increase the quality of software development. In response to this need, OSGi technology is introduced as the dynamic module system for Java - a platform for component-based development of high quality and less costly software solutions. Built on top of the ubiquitous Java the OSGi technology creates a portable modularization platform embraced by many software products (see [4]).

While there is a surge of interest in OSGi technology, in particular after Eclipse adopted OSGi approach with Eclipse 3.2, the problem of migrating existing Java solutions into OSGi is not trivial. In this paper, we focus on Java application frameworks that become increasingly popular among professional application developers (see [15],[16]). In addition to services provided by traditional software libraries, application frameworks also provide structure to applications. In this sense, the problem of OSGi migration for Java application frameworks seems to be more interesting than for traditional libraries.

Typically, existing Java application frameworks do not fully support the fundamental principles of modularity (see [19]). Hence, transforming existing application frameworks into OSGi platform may not be accomplished without changing the programming model or introducing new service interfaces. Before we take on the challenging problem of adopting OSGi technologies in traditional Java application frameworks, we would like to review the fundamental characteristics of a modular system and confront them with the needs of application frameworks. This will further clarify the nature of the challenge.

In a fully modular computing environment, it is expected that "off the shelf" software components can be reused and integrated into the application coherently. Installing, updating and removing components on the fly are the essential functionality of component based systems. Components are capable of dynamically discover and cooperate with each other. More importantly, all this is done with little or no configuration. In a modular system, componentization is enforced with a proper code separation and the isolation level guaranteed by component class loaders. Needless to say that plain Java lacks these core characteristics of a modular platform (see [20]). Traditional Java application frameworks also do not fully support modularity due to their inherent characteristics, such as the utilization of the Inversion of Control (IoC) pattern (see [21]). The IoC pattern implies that the application class loader together with the framework have access to certain resources of third party components, which are used by the application. With the isolation level, established by a modular environment, even providing the IoC based framework with a legitimate access to component resources is a problem by itself.

Once we established that traditional Java application frameworks do not fully support modularity, it is important to understand what it takes to attain modularity, particularly using OSGi technology. Three different types of modularization are possible for Java application frameworks:

•  Framework only migration.
Modularizing the framework architecture/implementation without affecting applications/components (example - WebSphere Application Server [22]). This type is not discussed here, because the modular framework implementation still does not provide real component-based environment for application and component developers.
•  Full migration.
Modularizing the framework architecture/implementation together with applications/components (example - Spring Framework [23]).
•  Adaptation.
Modularizing applications/components without modifying the framework itself. This type of modularization, however, requires extending the framework with an enablement layer that allows the framework to work with modularized components/applications.

In this paper we discuss the latter 2 types of modularization in Java application frameworks. In section 3 we compare the latter 2 approaches, namely migration approach versus adaptation approach. Section 4 introduces the OSGi service adapter solution as a way to adopt OSGi modularization in traditional Java application frameworks. In section 5, UIMA framework is reviewed as an example of a traditional Java application framework to be used for this case study. Section 6 discusses the architecture of the OSGi services adapter as well as its core features. Finally, the findings of this case study are outlined in sections 7 and 8.

Overview of OSGi as Java module system
The OSGi Alliance [1] makes the following statement: "OSGi Technology is the dynamic module system for Java". Today, this technology is widely adopted by both the Java community (see [2], [3]) and the major software vendors (see, for instance, [4]). The main focus of the OSGi Technology lies in the integration of software components based on the OSGi Service Platform. Comprehensive overview of the OSGi Service Platform is given by the OSGi Alliance in [5]. In this section we briefly review several key features of the OSGi Service Platform that are most relevant in the context of this paper.

Bundles and bundle management
In OSGi Service Platform, a bundle is defined as a unit of modularization. OSGi bundles are JAR files comprised of Java classes and other resources without any specific structural constraints. Unlike other JAR files, OSGi bundles always include a manifest file, providing information about the bundle. This file consists of headers, which specify information that the OSGi Framework utilizes to handle a bundle. For example, some manifest headers are used to state dependencies on other resources that must be available before a bundle can be used. Some bundles may also contain the Activator class that is used to start and register bundle services and perform other initial interactions with the OSGi Framework.

The OSGi Framework provides a container for managing bundles and supports full set of bundle lifecycle management operations, such as installing, updating, resolving, starting, stopping and uninstalling. Each bundle can be in one of the following states:

•  installed (bundle is deployed into the container);
•  resolved (bundle dependencies are resolved within the container);
•  active (bundle Activator is called)
•  uninstalled (bundle is uninstalled from the container).

For complete description of bundle states and state transition diagrams see [5].

Modules and class loading
The modularization concept in OSGi Framework is supported by the module-based class loading policy. The OSGi Framework has a powerful and rigidly specified class loading model that allows modules to declare shared and private class space and controls linking between modules. In this model, each bundle has its own class loader, and forms a class loading delegation network with other bundles (see [5], section 3.4). A bundle class space includes imported packages, shared class space of required bundles, private bundle classes and attached fragments. Note, that in order to have a consistent bundle class space, it's not recommended to put two classes with the same fully qualified name into the same class space. Separate class spaces in the OSGi Framework, however, may contain classes with the same fully qualified name. Therefore, the OSGi Framework modularization layer supports a model where multiple versions of the same class are loaded in the same VM. This allows binding two versions of the same component within the same application.

Services and service registry
The OSGi Service Platform defines a dynamic collaborative 'find-and-bind' service model (see [5], chapter 5). A service in OSGi Platform is a normal Java object that is registered under one or more Java interfaces with the service registry. Bundles can register services, search for them, or receive notifications when their registration state changes. The service registry provides a comprehensive model to share objects between bundles.


More Stories By Yurdaer Doganata

Dr. Doganata is the manager of the Information Management Solutions group at the Watson Research Center in Hawthorne, New York. He received B.S. and M.S. degrees from the Middle East Technical University, Ankara, Turkey, and a Ph.D. degree from the California Institute of Technology, Pasadena, California, all in electrical engineering. He joined the Watson Research Center as a research staff member in 1989 and worked on projects in many diverse areas, including high-speed switching systems, multimedia servers, intelligent transportation systems, multimedia collaborative applications, eservices, and information search and retrieval systems for technical support. His current work involves designing and prototyping innovative solutions, applications, tools, and utilities in the area of unstructured information management. Dr. Doganata hold several patents and research awards and is the author of numerous papers. http://yurdaer.doganata.us

More Stories By Lev Kozakov

Dr. Lev Kozakov is a research staff member at IBM T.J. Watson Research Center and is a member of the dBlue project architecture and research teams. He has worked in many areas, including dynamic systems, applied statistics, information management systems, man-machine interface, medical software, computer telephony, and design patterns. Lev holds a number of patents and is the author of several publications.

More Stories By Mirko Jahn

Mirko Jahn worked for several years as an independent software consultant and tutor before joining the Unstructured Information Management Architecture (UIMA) group at IBM Research. At present, his major research areas cover component-based development strategies, component repositories, and migration approaches toward modular applications, along with service-oriented architecture. Mr. Jahn is heavily involved in making use of OSGi component-based developement
standards in UIMA.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


@CloudExpo Stories
"ZeroStack is a startup in Silicon Valley. We're solving a very interesting problem around bringing public cloud convenience with private cloud control for enterprises and mid-size companies," explained Kamesh Pemmaraju, VP of Product Management at ZeroStack, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
In his session at 21st Cloud Expo, Carl J. Levine, Senior Technical Evangelist for NS1, will objectively discuss how DNS is used to solve Digital Transformation challenges in large SaaS applications, CDNs, AdTech platforms, and other demanding use cases. Carl J. Levine is the Senior Technical Evangelist for NS1. A veteran of the Internet Infrastructure space, he has over a decade of experience with startups, networking protocols and Internet infrastructure, combined with the unique ability to it...
"Codigm is based on the cloud and we are here to explore marketing opportunities in America. Our mission is to make an ecosystem of the SW environment that anyone can understand, learn, teach, and develop the SW on the cloud," explained Sung Tae Ryu, CEO of Codigm, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
High-velocity engineering teams are applying not only continuous delivery processes, but also lessons in experimentation from established leaders like Amazon, Netflix, and Facebook. These companies have made experimentation a foundation for their release processes, allowing them to try out major feature releases and redesigns within smaller groups before making them broadly available. In his session at 21st Cloud Expo, Brian Lucas, Senior Staff Engineer at Optimizely, discussed how by using ne...
"There's plenty of bandwidth out there but it's never in the right place. So what Cedexis does is uses data to work out the best pathways to get data from the origin to the person who wants to get it," explained Simon Jones, Evangelist and Head of Marketing at Cedexis, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
"Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offer guided learning experiences on AWS, Azure, Google Cloud and all the surrounding methodologies and technologies that you need to know and your teams need to know in order to leverage the full benefits of the cloud," explained Alex Brower, VP of Marketing at Cloud Academy, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clar...
Large industrial manufacturing organizations are adopting the agile principles of cloud software companies. The industrial manufacturing development process has not scaled over time. Now that design CAD teams are geographically distributed, centralizing their work is key. With large multi-gigabyte projects, outdated tools have stifled industrial team agility, time-to-market milestones, and impacted P&L stakeholders.
Gemini is Yahoo’s native and search advertising platform. To ensure the quality of a complex distributed system that spans multiple products and components and across various desktop websites and mobile app and web experiences – both Yahoo owned and operated and third-party syndication (supply), with complex interaction with more than a billion users and numerous advertisers globally (demand) – it becomes imperative to automate a set of end-to-end tests 24x7 to detect bugs and regression. In th...
Enterprises are moving to the cloud faster than most of us in security expected. CIOs are going from 0 to 100 in cloud adoption and leaving security teams in the dust. Once cloud is part of an enterprise stack, it’s unclear who has responsibility for the protection of applications, services, and data. When cloud breaches occur, whether active compromise or a publicly accessible database, the blame must fall on both service providers and users. In his session at 21st Cloud Expo, Ben Johnson, C...
"Infoblox does DNS, DHCP and IP address management for not only enterprise networks but cloud networks as well. Customers are looking for a single platform that can extend not only in their private enterprise environment but private cloud, public cloud, tracking all the IP space and everything that is going on in that environment," explained Steve Salo, Principal Systems Engineer at Infoblox, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventio...
Data scientists must access high-performance computing resources across a wide-area network. To achieve cloud-based HPC visualization, researchers must transfer datasets and visualization results efficiently. HPC clusters now compute GPU-accelerated visualization in the cloud cluster. To efficiently display results remotely, a high-performance, low-latency protocol transfers the display from the cluster to a remote desktop. Further, tools to easily mount remote datasets and efficiently transfer...
"MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
"We're developing a software that is based on the cloud environment and we are providing those services to corporations and the general public," explained Seungmin Kim, CEO/CTO of SM Systems Inc., in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Agile has finally jumped the technology shark, expanding outside the software world. Enterprises are now increasingly adopting Agile practices across their organizations in order to successfully navigate the disruptive waters that threaten to drown them. In our quest for establishing change as a core competency in our organizations, this business-centric notion of Agile is an essential component of Agile Digital Transformation. In the years since the publication of the Agile Manifesto, the conn...
SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
The question before companies today is not whether to become intelligent, it’s a question of how and how fast. The key is to adopt and deploy an intelligent application strategy while simultaneously preparing to scale that intelligence. In her session at 21st Cloud Expo, Sangeeta Chakraborty, Chief Customer Officer at Ayasdi, provided a tactical framework to become a truly intelligent enterprise, including how to identify the right applications for AI, how to build a Center of Excellence to oper...
"IBM is really all in on blockchain. We take a look at sort of the history of blockchain ledger technologies. It started out with bitcoin, Ethereum, and IBM evaluated these particular blockchain technologies and found they were anonymous and permissionless and that many companies were looking for permissioned blockchain," stated René Bostic, Technical VP of the IBM Cloud Unit in North America, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventi...
SYS-CON Events announced today that Telecom Reseller has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
In his session at 21st Cloud Expo, James Henry, Co-CEO/CTO of Calgary Scientific Inc., introduced you to the challenges, solutions and benefits of training AI systems to solve visual problems with an emphasis on improving AIs with continuous training in the field. He explored applications in several industries and discussed technologies that allow the deployment of advanced visualization solutions to the cloud.
While some developers care passionately about how data centers and clouds are architected, for most, it is only the end result that matters. To the majority of companies, technology exists to solve a business problem, and only delivers value when it is solving that problem. 2017 brings the mainstream adoption of containers for production workloads. In his session at 21st Cloud Expo, Ben McCormack, VP of Operations at Evernote, discussed how data centers of the future will be managed, how the p...