THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
- SUN JDK 6.0+(J2SE 1.6)
- Eclipse IDS for Java EE Developers, which is platform specific
- Apache Geronimo Eclipse Plugin 3v3.*0
- OSGi Application Development Tools
- Apache Geronimo Server 3v3.*0
Details on installing Eclipse are provided in the Development environment section. This tutorial is organized in the following sections:
...
- Modify the code of
HelloWorldServiceImpl
as follows.Code Block java java title HelloWorldServiceImpl.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"); } }
- 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 xml blueprint.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>
- Modify
META-INF\MANIFEST.MF
and make surecom.sample.blueprint.helloworld.api
is listed under Import-Pakcage.
Creating the client to consume the services
...
- Check the console of the server, the messages displays as each bundles initialized sequentially.