In this tutorial( Karaf Tutorial Part 4)
<http://www.liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi>
Cschneider use maven.
The code source in this topic send a message to the bundle helloService
using OSGi Service.
Where i can add this source to send a message when I have add someone in the
"Karaf Tutorial Part 4"?
There is a problem to run a manifest.mf inside maven ?It is good ?
Thank you for your advice.
******************
MANIFEST.MF
******************
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: HelloWorld
Bundle-SymbolicName: com.javaworld.sample.HelloWorld
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.javaworld.sample.helloworld.Activator
Bundle-Vendor: JAVAWORLD
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Import-Package: com.javaworld.sample.service,
org.osgi.framework;version="1.3.0"
***************
activator.java
****************
package com.javaworld.sample.helloworld;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import com.javaworld.sample.service.HelloService;
public class Activator implements BundleActivator {
ServiceReference helloServiceReference;
public void start(BundleContext context) throws Exception {
System.out.println("Hello World!!");
helloServiceReference=
context.getServiceReference(HelloService.class.getName());
HelloService helloService
=(HelloService)context.getService(helloServiceReference);
System.out.println(helloService.sayHello("*** exemple message sent
**** "));
}
public void stop(BundleContext context) throws Exception {
System.out.println("Goodbye World!!");
context.ungetService(helloServiceReference);
}
}
--
View this message in context:
http://karaf.922171.n3.nabble.com/Karaf-Tutorial-Part-4-CXF-Services-in-OSGi-How-to-add-a-project-with-a-manifest-inside-this-tuturial-tp4033839.html
Sent from the Karaf - User mailing list archive at Nabble.com.