In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
What is the meaning of OSGi, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
What is OSGi?
OSGi, also known as the dynamic module system of Java language, defines an infrastructure for the development of modular applications. There are several open source implementations of the OSGi container, such as Knoflerfish, Equinox, and Apache's Felix. You can split your application into multiple module units through these containers, so that you can more easily manage the cross-dependencies between these module units.
The OSGi specification is similar to the Servlet specification and the EJB specification, which defines two kinds of objects, one is the service object provided by the container, and the other is the contract that must be followed between the container and your application, where the service object is to be implemented by the container. If you want to develop on the OSGi platform, you must first use OSGi API to create your application, and then deploy it to an OSGi container. From the developer's point of view, OSGi has the following advantages:
A) you can dynamically install, uninstall, start, and stop different modules in your application without restarting the container
B) for a particular module in your application, the container can run multiple versions of that module simultaneously
C) OSGi provides an excellent infrastructure for the development of embedded applications, mobile applications, and rich Internet applications (RIA)
If you use Servlet containers to develop your web applications and EJB containers to develop transactional applications, you might ask, why do we need another container? The short answer to this question is that the OSIG container is specially prepared for the development of complex Java applications, and in the process of developing these applications, you very much need to divide these applications into modules. In future articles in this series, I will expand on this question and answer it in depth.
1. The application of OSGi in enterprise development.
The OSGi Alliance (OSGiAlliance) began to develop the OSGi specification in March 1999. its main purpose is to develop a set of open standards to provide manageable services to the local area network and the devices in it. The basic idea is that once you use the OSGi services platform on network devices, such as servers and embedded devices, you can manage the lifecycle of software components running on those devices anywhere on the network, and you can install, upgrade, or uninstall them in the background without interrupting the normal operation of the device.
In recent years, OSGi technology has been widely used in embedded system and network equipment market. Now, due to the success of Eclipse, OSGi has gradually become a feasible and valuable technology in enterprise development.
1.1. Industry support for OSGi is on the rise
In 2003, the Eclipse development team began to find ways to improve the modularity of the Eclipse toolset to make it a more dynamic rich client platform. The Eclipse team finally chose the OSGi framework as the run-time model for its components, and Eclipse3.0 released in June 2004 is * a version based on the OSGi platform. Almost all enterprise application servers now support OSGi,Spring and OSGi through a project called "Spring dynamic Model on OSGi Services platform (also known as OSGiSpring)". This project provides the OSGi infrastructure to make it easier for us to use OSGi in the enterprise development of Spring.
two。 Open source OSGi container
From the perspective of enterprise developers, the requirements of OSGi container are very low, and you can easily embed it into enterprise applications. For example, when we develop Web applications, we can divide the Web application into multiple modules, one module is responsible for the view layer, the other module is responsible for the DAO layer, and the third module is responsible for the data access layer. If we use the OSGi container to manage the cross-dependencies between these modules We can upgrade the DAO layer from slower to faster DAO without restarting the Web application.
As long as your application is compatible with the OSGi specification, your application should be able to run in any OSGi container. There are three popular open source OSGi containers:
A) the Equinox container is implemented with reference to version 4 of the OSGi specification, which constitutes the core of Eclipse IDE-the modular Java runtime; it implements the mandatory functions specified in OSGi specification 4, and at the same time, it also implements most of the optional functions in the OSGi specification
B) Knoflerfish is an open source implementation of versions 3 and 4 of the OSGi specification, which implements the required functions and some optional functions specified in the OSGi specification
C) Apache's Felix is an open source OSGi container implemented by the Apache Software Foundation, and as of this writing, the container is not fully compatible with the OSGi specification. In this article, we will use Equinox as our OSGi container.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.