Xmm....Today was an OSGi day. I try several hours now to get along with
SAT usage and I think I am getting along with it up until now. One
little query though. Using the toolkit of SAT package, I try to import
services through the Bundle Activator Wizard, but I cannot-it does not
show me my project's packages. How does this works? I have a project
with multiple packages (manifest files are constructed with ant
directives and saved at a resource directory at project's root). I have
scanned through SAT's documents but I didn't find a solution.
Thank you,
Aggelos Mpimpoudis
Simon J Archer wrote:
Seriously, SAT is easier than the ServiceTracker. I encourage you to
try both and find out for yourself.
I'm happy to help where I can,
Simon
*Aggelos Mpimpoudis <[EMAIL PROTECTED]>*
07/26/2007 05:17 PM
To
Simon J Archer/Raleigh/[EMAIL PROTECTED]
cc
Subject
Re: [osgi-dev] Service Tracking Matter
Mr Archer in the past we have spoked in private about SAT and eclipsecon
that took place in March ;-) (remember me?)
I find ServiceTracker a bit easier....Well. I will reconsider it
tonight, after a little time with me vs SAT (again)
I have all the appropriate material.
I will answer at this mail, prividing my final decision. Thank u all!!!
Thx,
Aggelos Mpimpoudis
Simon J Archer wrote:
>
> Hello Agellos
>
> When you say, "only when 3 other services are added" I presume you
> mean 3 distinct services, right. This is EASY to do with SAT....
> Here's what you'd need:
>
> *public* *class* Activator *extends* BaseBundleActivator {
> *protected* *void* activate() {
> ConfigurationAdmin cm = getConfigurationAdmin();
> LogService ls = getLogService();
> PackageAdmin pa = getPackageAdmin();
>
> FooService service = *new* Foo(cm, ls, pa);
> addExportedService(FooService.*class*.getName(),
> service, *null*);
> }
>
> *private* ConfigurationAdmin getConfigurationAdmin() {
> *return* (ConfigurationAdmin)
> getImportedService(ConfigurationAdmin.*class*.getName());
> }
>
> *protected* String[] getImportedServiceNames() {
> *return* *new* String[] {
> ConfigurationAdmin.*class*.getName(),
> LogService.*class*.getName(),
> PackageAdmin.*class*.getName()
> };
> }
>
> *private* LogService getLogService() {
> *return* (LogService)
> getImportedService(LogService.*class*.getName());
> }
>
> *private* PackageAdmin getPackageAdmin() {
> *return* (PackageAdmin)
> getImportedService(PackageAdmin.*class*.getName());
> }
> }
>
> I am assuming that you need three distinct services:
> ConfigurationAdmin, LogService and PackageAdmin service. When, and
> ONLY WHEN, you have all three will activate() execute. When you lose
> ANY ONE of the three services then deactivate() gets called. In this
> case deactivate() is the inherited no-op implementation from the
> superclass. When and ONLY WHEN, you have re-acquired all three
> services activate() will re-execute.
>
> Easy.
>
> Simon
>
> http://eclipse-sat.blogspot.com/
>
>
>
> *Aggelos Mpimpoudis <[EMAIL PROTECTED]>*
> Sent by: [EMAIL PROTECTED]
>
> 07/26/2007 02:30 PM
> Please respond to
> OSGi Developer Mail List <[email protected]>
>
>
>
> To
> OSGi Developer Mail List <[email protected]>
> cc
>
> Subject
> [osgi-dev] Service Tracking Matter
>
>
>
>
>
>
>
>
>
> Hello, OSGi community.
>
> Here is my question. I have an OSGi service, that I want to initialize
> it's facilities only when 3 other services are added to the framework. I
> construct 3 service trackers (each one for every needed service). How
> can I proceed after obtaining the knowledge that the 3 services are
> ready? I am thinking of keeping a map maintained and at every add and
> remove of service to check map's size and only if it is of size 3, to
> proceed with the thread's execution. Is this practice very naive? Is
> there something more obvious that I am missing?
>
> Thank you!
>
> My Best Regards,
> Aggelos Mpimpoudis
> --
> 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
>
--
Dept. of Informatics & Telecommunications, University of Athens
Athens, Greece
Gsm: +306942075153 / Skype: aggelos.mpimpoudis
email: a.mpimpoydhs [at] di.uoa.gr
--
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