Hello,

i wonder how OSGi is supposed to handle the following situation. I
have an EventHander that needs to unregister itself when a specific
topic is reported.
Can the OSGi service registry handle such cases?

class MyEventHandler implements EventHandler {

  private ServiceRegistration reg;

  void handleEvent(Event e) {
    if (e.getTopic.equals("TOPIC")) {
      reg.unregister();
    }
  }
}

Would that disturb the list of EventHandler services?

How is that handled generally in the service registry where you
iterate over a list of services (references) and modify the list of
services during the calls into the services?

Thanks!
Phil
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to