Aggelos

Your code looks fine to me.  When your bundle has acquired all of its 
imported services, be it at start up or otherwise, the activate() method 
will get called.  Whenever your bundle loses an imported service, for any 
reason, the deactivate() method will get called.  Both activate() and 
deactivate() can get called multiple times as services are gained/lost.

Please double-check that the bundle that you are stopping and re-starting 
is actually re-registering its service correctly.  If you are using 
Equinox then you can query the services registered and in use by each 
bundle by using the "bundle" console command.

Good luck,

Simon




Aggelos Mpimpoudis <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
08/01/2007 07:56 AM
Please respond to
OSGi Developer Mail List <[email protected]>


To
OSGi Developer Mail List <[email protected]>
cc

Subject
Re: [osgi-dev] Service Tracking Matter






Hello again,

Being in the final stage of development, I have one more question. My 
activation/deactivation facilities are the latter as shown:

>     protected void activate() {
>         System.out.println("Bootstrap::Activation...");
>         dataProcessor = getSensorDataProcessorBC();
>         dbwrapper = getDBWrapperBC();
>         fusion = null;
>         commProxy=getCommunicationProxyBC();
>         try {
>             BootstrapCoordinator service = new 
BootstrapCoordinator(dataProcessor, dbwrapper, fusion, commProxy);
>             createExportedServices(service);
>         } catch (BootstrapCoordinatorException e) {
>             e.printStackTrace();
>         }
> 
>     }
>
>     protected void deactivate() {
>         System.out.println("Bootstrap::Deactivation...");
>     }

I use 3 services, each one provided from three separate bundles. After 
activation of all three, my bundle is triggered and my facilities are 
constructed. I deactivate one of the three services. 
Bootstrap::Deactivation is printed on the stdout. Everything is going 
fine. After the reactivation, I expect to see my bundle's 
Bootstrap::Activation... string, but it seems that the activation method 
isn't re-executed.... Is there anything wrong at the above?

Thx,
Aggelos

-- 
Dept. of Informatics & Telecommunications, University of Athens
Athens, Greece
Gsm: +306942075153 / Skype: aggelos.mpimpoudis
email: a.mpimpoydhs [at] di.uoa.gr
_______________________________________________
OSGi Developer Mail List
[email protected]
http://www2.osgi.org/mailman/listinfo/osgi-dev

_______________________________________________
OSGi Developer Mail List
[email protected]
http://www2.osgi.org/mailman/listinfo/osgi-dev

Reply via email to