contained in the Application-content header
Using WAB rather than WAR
Use only use-bundle if necessary
Use persistent bundle to share your persistence unit
Take full advantage of the provided component model
Let the container take up the responsibility
Each best practice is described in detail in the following sections.
1. Use of Blueprint
Generally speaking, using Blueprint is a best practice. Some of the Blueprint provided by Blueprint support a simple POJO development and support the
Osgi startlevel explained and using startup level mechanism and usage
Bundle startlevel
In the actual application environment, our bundle is dependent on each other, so there must be a difference in the startup sequence, such as building a building,Start from laying the foundation.In fact, the initial start level of the osgi framework is 0,The startup sequenc
A simple example of developing OSGi based on Eclipse
A. Overview
OSGI SERVICE PLATFORM is a Java-based, open and unified Interface Standard Architecture Framework,
The deployment of all modules in OSGi must be deployed in a bundle manner. Based on this framework, servi
What is service?
It is a Java object registered to osgi.
Service Registration:
Through bundlecontext: registerservice (Java. Lang. String [] clazzes, java. Lang. Object Service, java. util. dictionary properties)
Service search and use:
Through bundlecontext: getservicereference (Java. Lang. String clazz), return servicereference through bundlecontext: getservice (servicereference reference), return the registered service objec
more information, see the API documentation for the agreed object.
Table 37.1. OSGi Method
Method
Return type
Description
OsgiManifest ()
OsgiManifest
Returns an OsgiManifest object.
OsgiManifest (Closure cl)
OsgiManifest
Returns an OsgiManifest object configured through a closure.
The class files under the classes directory are analyzed to determine the dependencies of their packages and the pac
How to debug bundle during development has always been a problem. Today, let's look at how eclipse solves this problem.
I usedEclipse javaee indigo 3.7.2Version.
Step 1: Enable eclipse and addPlug-inProject.
Step 2: Enter the project nameHelloworldbundleNote that you must select the running mode of the plug-in here.An osgi framework.
Step 3: Enter the metadata information related t
What is OSGi? OSGi is a Java modular specification, translated by the Open Service Gateway Protocol (open Services gateways Initiative) OSGi is not an application-level framework, but a specification at the software design levelWhat does it bring to us?1 reusable component accumulation and reuse, functional decoupling.
Meaning:Directly use the editor to edit required osgi services, which is fast and efficient. Osgi container: Select knopflerfish_osgi_5.1.0 (http://www.knopflerfish.org/) to support osgi's latest R5 standard. Method: 1. Compile the activator. Java file in the current directory.(You do not need to create the corresponding package folder-save time), The content is as follows (Refer to the tutorial of Fel
Whether interface-oriented development can be implemented is closely related to the container or framework used by the system. The most important thing for interface-oriented development is to solve the system dependency problem, at this point, the most mature solution is IOC, and the most successful IOC container is spring. Does osgi-based solution bring different perspectives, let's take a look at these e
, but the code structure is messy.
Then, we
2. error-prone class path
To some extent, class path hinders java modularization. Because the class path has no idea about the jar version, it only returns the first version it finds.
3. Lack of deployment and management support
OSGI architecture:
The OSGI service platform consists of the OSGI
Reprint please retain the author information:
Author: 88250
blog:http:/blog.csdn.net/dl88250
MSN Gmail qq:dl88250@gmail.com
SummaryLast time, we analyzed the design of the KF (Knopflerfish) framework and practiced the design of an OSGI based application framework. In this context, we will implement the OSGi specific
First, what is OSGiThe OSGi (Open Service Gateway Initiative) technology is a series of specifications for the dynamic modular system of Java. OSGi, on the one hand, refers to the official OSGi alliance that maintains the OSGi specification and, on the other hand, the Java-language-based Service (business) specificatio
Reprint please retain the author information:
Author: 88250
blog:http:/blog.csdn.net/dl88250
MSN Gmail qq:dl88250@gmail.com
SummaryLast time, we wrote two bundles, one is the service provider, one is the customer who uses the service, the operation is very good:-)This time, let's briefly analyze the design of the KF (Knopflerfish) framework and learn the design of the application framework. Finally, the
Use the Open Services Gateway initiative API to eliminate Eclipse plug-in dependencies
This article describes a plug-in example that uses XML to register extensions for well-defined extension points. By enabling Plug-ins to perceive extention Registry and provide OSGi services, we can complete this complete component decoupling operation.
Plug-ins, extension points, OSGi
As you know, Eclipse's component
1 life cycle management for non-modular applications, the lifecycleApplicationAs a whole, and for modular applications, you canFine Grain sizeThe way to manage an individual part of the application. OSGi Life Cycle ManagementThe OSGi life cycle layer has two different roles:
Outside of the application, the related operations on the bundle lifecycle are defined. The
OSGi framework of Apache Felix Equinox The concept of OSGi bundle is the difference between the PlugIn of the Eclipse of Maven's module .... OSGi and Maven Maven also features a modular system, but it is a compile-time tool, not a runtime framework. MAVEN is not a competi
We'll look at some typical problems with class loading in the order of increased complexity, and develop a small piece of code to solve the most interesting of these problems. Even if you're not going to write a code generation framework right away, this article will give you a more in-depth understanding of low-level operations in the runtime (such as OSGi systems) that statically define dependent modules.
Osgi is currently the most promising technology that can bring javaee into the next golden decade. For a long time,
Developers and enterprise users are not satisfied with the modularization and dynamic capabilities of Java EE, which are the weakness of Java ee. Do
Java EE 6's modular capabilities have been improved a lot, such as the Web fragment introduced by servlet3.0, but it is still not enough.
Complete. On the contrary,
From a code point of view, Equinox are an implementation of the OSGi Core Framework specification, a set of bundles that IM Plement various optional OSGi services and other infrastructure for running osgi-based systems.
Above is the description of Equinox official website, Equinox is an
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.