public Object addingService(ServiceReference reference) { BundleContext context = _context; if (context == null) return null; // really should never happen since we close the tracker before nulling out context Object service = null; EclipseAppContainer startContainer = null; synchronized (this) { if (container != null) return null; // container is already started; do nothing service = context.getService(reference); if (registry == null && service instanceof IExtensionRegistry) { registry = (IExtensionRegistry) service; // create and start the app container container = new EclipseAppContainer(context, registry); startContainer = container; } } // must not start the container while holding a lock because this will register additional services if (startContainer != null) { startContainer.start(); return service; } // this means there is more than one registry; we don't need a second one if (service != null) context.ungetService(reference); return null; }
public Object addingService(ServiceReference reference) { BundleContext context = _context; if (context == null) return null; // really should never happen since we close the tracker before nulling out context Object service = null; EclipseAppContainer startContainer = null; synchronized (this) { if (container != null) return null; // container is already started; do nothing service = context.getService(reference); if (registry == null && service instanceof IExtensionRegistry) { registry = (IExtensionRegistry) service; // create and start the app container container = new EclipseAppContainer(context, registry); startContainer = container; } } // must not start the container while holding a lock because this will register additional services if (startContainer != null) { startContainer.start(); return service; } // this means there is more than one registry; we don't need a second one if (service != null) context.ungetService(reference); return null; }
@Override public Object addingService(ServiceReference reference) { BundleContext context = _context; if (context == null) return null; // really should never happen since we close the tracker before nulling out context Object service = null; EclipseAppContainer startContainer = null; synchronized (this) { if (container != null) return null; // container is already started; do nothing service = context.getService(reference); if (registry == null && service instanceof IExtensionRegistry) { registry = (IExtensionRegistry) service; // create and start the app container container = new EclipseAppContainer(context, registry); startContainer = container; } } // must not start the container while holding a lock because this will register additional services if (startContainer != null) { startContainer.start(); return service; } // this means there is more than one registry; we don't need a second one if (service != null) context.ungetService(reference); return null; }