Hi all,

I am trying to build a mechanism  that is similar to the "Mutex" in OSGI.
 Guarantee only one service is only used by one user(service) at one time.
(well, we could expand this to Semaphore)

I understand OSGI can know which services are referencing to a specific
service. But it looks like we cannot get which services are using a specific
service. (the services must be actually running)


*suppose*.

Service A is running and it is invoking Service B.

Then if Service C wants  to invoke Service B, it needs to wait until Service
A releases Service B.



I am trying to build up a management service to record the current service
usage information. ie. whenever one service wants to use the other service,
it always need to check a management service and see if the other service it
is going to use is available or not.

I did this by offering a Hashmap in a third party service.  The key is the
name of the service(maybe i should pick another property as the name), and
value is the reference to the current service object. Each service checks
this map before it invokes any service.

I dont know if I am doing the right thing. Maybe OSGI already has this
feature?

Thanks,

Leo.

Reply via email to