Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. SUN JDK 6.0+(J2SE 1.6)
  2. Eclipse IDS for Java EE Developers, which is platform specific
  3. Apache Geronimo Eclipse Plugin 3v3.*0
  4. OSGi Application Development Tools
  5. Apache Geronimo Server 3v3.*0

Details on installing Eclipse are provided in the Development environment section. This tutorial is organized in the following sections:

...

  1. Modify the code of HelloWorldServiceImpl as follows.
    Code Block
    java
    java
    titleHelloWorldServiceImpl.java
    package com.sample.blueprint.helloworld.server;
    import com.sample.blueprint.helloworld.api.*;
    
    public class HelloWorldServiceImpl implements HelloWorldService {	
    
        public void hello() {
                System.out.println("======>>> A message from the server: Hello World!");
        }
    
        public void startUp() {
                System.out.println("======>>> Starting HelloWorld Server");
        }
    }
    
  2. Right-click the project name and create a Blueprint file, then modify the xml file as follows. The blueprint file is placed under OSGI-INF\blueprint directory automatically.
    Code Block
    xmlblueprint.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
    
          <bean id="helloservice" 
                class="com.sample.blueprint.helloworld.server.HelloWorldServiceImpl"
                init-method="startUp">
          </bean>
          
          <service ref="helloservice" 
              interface="com.sample.blueprint.helloworld.api.HelloWorldService"/>
    </blueprint>
    
  3. Modify META-INF\MANIFEST.MF and make sure com.sample.blueprint.helloworld.api is listed under Import-Pakcage.

Creating the client to consume the services

...

  1. Check the console of the server, the messages displays as each bundles initialized sequentially.
    Image Removed Image Added