After installing Apache Felix, the following is how to develop my first bundle. The entire process is a referenceApache Felix Tutorial example 1-service event listener bundle.
Open a DOS window and switch to the directory where the bundle is to be stored.D: \ develop \ eclipse-jee-indigo-SR2-win32 \ workspace \ Felix-AnalysisFor example. Create an empty project using Maven.
MVN archetype: Create-dgroupid = Felix. Tutorial-dartifactid = example1-dpackagename = Felix. Tutorial. example1-dve
Now it's all in the HelloWorld. To cover all three levels of the OSGi framework, this HelloWorld may be a little more complicated than the other OSGi HelloWorld programs you see. If you're unfamiliar with some of the APIs in your code, remember to go back to the previous entry to find the corresponding content, which will help you understand the code. The key code inside has been highlighted in yellow. (For
What's 1.1 Equinox?
From a code standpoint, Equinox is actually a complete implementation of the OSGi core standard, and adds some additional functionality on this basis (such as adding a command line and a program execution entry for the framework). All of the things we've been explaining in the previous introductory article are a small part of the OSGi core standard. In fact, its core is a jar package, wh
The basic approach is given in the OSGi principles and best practices book, where a few lines of code are added to the Lin Hao went to complete a usable example:
1 first set up several plug-in projects, and exported into the plug-in package, where the export of the plug-in package is uniformly placed under the G://osgi_prj//system_bundle directory
2 build Java project and write a class with the main method for starting
OSGI (Dynamic model system for Java)The OSGi (Open Service Gateway Initiative) technology is a dynamic model system for Java. The OSGi service platform provides services to Java, which makes Java a preferred environment for software integration and software development. Java provides portability for products that are supported on multiple platforms.
mechanism is difficult to adapt as the application system grows, qualitative changes are generated, and component-oriented development is introduced into the development process. Currently, component-oriented development can still be considered as a kind of exploration, and there is no uniform standard to follow.
From another perspective, history is the basis of today's existence, and today is not the case without history. In the same way, application systems adopt component-oriented developme
(bundlecontext Context) exception; /span> If a class implements this interface, then this class becomes a activator. But it is not enough to have the implementation, you have to let the OSGi framework know the existence of this activator. So you also need to add one of the following attributes to the manifest file (assuming that the Activator class you define is called Org.foo.Activator):Bundle-Activator:org.foo.Activa
the OSGi console The various applications built on OSGi are called OSGi bundles. The OSGi console can perform the actions shown in the following table. Table 4-1 OSGi Console commands
Command
Description
Start
Start bundle
startup levels:?? Getbundlestartlevel (bundle)Obtain the bundle startup level.?? Getinitialbundlestartlevel ()Obtain the default bundle startup level.?? Getstartlevel ()Obtain the system startup level.?? Setbundlestartlevel (bundle, int startlevel)Set the bundle startup level. If the set startup level is higher than the system startup level, the osgi framework will stop the bundle, as shown inThe Set startup level is lower than the system startup lev
startup levels of each bundle.Similarly, to use startlevelservice, first open manifest. MF andImport org. osgi. Service. startlevel,Get startlevelservice through bundlecontext:Servicereference serviceref = BC. getservicereference (startlevel. Class. getname ());Startlevel startlevelsrv = (startlevel) BC. getservice (serviceref );Startlevel provides a management system and APIs for various bundle startup levels:?? Getbundlestartlevel (bundle)Obtain th
2. Integration with popular JAVA B/S Architecture
This paper introduces the basic idea of OSGi system design, and further studies the integration of OSGi with popular framework (spring,struts,hibernate, etc.), and explains the integration principle first.
• solution and Spring Integration
Because spring applications occupy most of the Java applications, solving the integration with spring is a must for
September 21, 2006 the core of the Eclipse Integrated Development Environment (IDE) and Eclipse Rich-Client Platform (RCP) applications is implemented by the Open Services Gateway Initiative (OSGI) specification Driven. This article illustrates the relationship between Eclipse and OSGi by describing what Plug-ins are for the Eclipse platform and tracking the development of Plug-ins from Eclipse V2.1 to toda
IBM and OSGi
OSGi is a dynamic modular system of the Java language. IBM is one of the initial members of the OSGi Consortium, which aims to promote the widespread adoption of the OSGi service platform to ensure interoperability of applications and services delivered and managed over the network. For years, IBM has bee
The first helloworld plug-in project was built according to the book during OSGI learning today. The following error occurs during the running process:
!SESSION 2014-06-09 21:04:49.038 -----------------------------------------------eclipse.buildId=unknownjava.version=1.6.0_35java.vendor=Sun Microsystems Inc.BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_USCommand-line arguments: -dev file:E:/XJTU/.metadata/.plugins/org.eclipse.pde.core
Recently, I have discussed the role of OSGi with other people on cnblogs. Since the people there will only copy the online rhetoric from the Internet over the past n years, and seldom have their own analysis and insights, you cannot start the discussion. I would like to write an article to clarify my point of view and discuss this technology with more people.
OSGi is an open service specification proposed
After having a preliminary understanding of osgi, we are ready to write some code to run and try our best,First, I downloaded a copy of bluedavy's osgi practice.There is code that can be run directly in it. Double-click Run. BAT to run normally, which is cool!Start to practice the user login authentication module in osgi practice, and repeat the code in a row. Th
[51cto] This article is "Hello, osgiSeriesPart 5. Starting from this article, we will introduce the spring dynamic model. Let's take a look at why spring dynamic models are so exciting for developers. These developers haveSpring configurations are very familiar and need to explore osgi's modularity, simple version control, and application Lifecycle Support.
51cto editing recommendations:Osgi introduction and Practice
Use osgi and spring to build servi
What is OSGi?OSGi is also known as the dynamic modular system of the Java language , which defines an infrastructure for the development of modular applications. OSGi containers already have several open source implementations, such as Knoflerfish,Equinox , and Apache Felix. Through these containers, you can split your application into multiple module units so th
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.