Hi Madhav,

The entry point for using the OSGi API is the BundleContext interface.
runtime will provide an instance of BundleContext at a specific point in
the component lifecycle.
Activator is an Entity registered on a per-bundle and
notified when its bundle starts and stops.
Activators implement the BundleActivator interface.

public class ExampleActivator implements BundleActivator {

public void start(BundleContext bcontext) {
        registerServices(bcontext);
}

.
.
.
}

In your manifest you need specifies

Bundle-Activator: it.example.ExampleActivator

To do this job is better IMHO use framework type bluprint
http://aries.apache.org/modules/blueprint.html

I hope I answered
if you need other info tell me

Regards

--Filippo



2012/9/26 Madhav <bhamidipatimad...@gmail.com>:
> Hi All,
>
> I have question here in OSGi fying an existing JAR file. I have all the
> class files, also I have
> META-INF/MANIFEST.MF, here in this file how do I specify the bundle
> activator. How does the service registration happens? I am looking for a
> possibility of changing an existing JAR file to OSGI bundle by simply
> changing the MANIFEST.MF file, is it really the right approach OR do I need
> to do some other g
> round work like writing and attaching an activator within which I need to do
> service registration and other stuff... any guidance or references are
> highly appreciated.
>
> Thanks in advance,
> Madhav
>
>
>
> --
> View this message in context: 
> http://karaf.922171.n3.nabble.com/Osgi-fying-an-existing-JAR-tp4026151.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.

Reply via email to