public ScheduledExecutorServiceWrapper(BundleContext context, String name, ScheduledExecutorServiceFactory sesf) { _name = name; _factory = sesf; try { _tracked = new SingleServiceTracker<ScheduledExecutorService>(context, ScheduledExecutorService.class, "(aries.blueprint.poolName=" + _name + ")", this); _tracked.open(); } catch (InvalidSyntaxException e) { // Just ignore and stick with the default one. } if (_current.get() == null) { _default.set(_factory.create(name)); if (!!!_current.compareAndSet(null, _default.get())) { _default.getAndSet(null).shutdown(); } } }
public static ProxyManager getProxyManager() { return proxyManager == null ? null : proxyManager.getService(); } }
public void open() { if (open.compareAndSet(false, true)) { try { ctx.addServiceListener(listener, filterString); findMatchingReference(null); } catch (InvalidSyntaxException e) { // this can never happen. (famous last words :) } } }
@Override public void stop(BundleContext context) { proxyManager.close(); AriesFrameworkUtil.safeUnregisterService(osgiUrlReg); AriesFrameworkUtil.safeUnregisterService(blueprintUrlReg); }
public void stop(BundleContext context) { LOGGER.debug("Stopping blueprint extender..."); stopping = true; ServiceUtil.safeUnregisterService(parserServiceReg); ServiceUtil.safeUnregisterService(blueprintServiceReg); ServiceUtil.safeUnregisterService(quiesceParticipantReg); // Orderly shutdown of containers while (!containers.isEmpty()) { for (Bundle bundle : getBundlesToDestroy()) { destroyContainer(bundle); } } if (bt instanceof BundleTracker) { ((BundleTracker) bt).close(); } else if (bt instanceof RecursiveBundleTracker) { ((RecursiveBundleTracker) bt).close(); } proxyManager.close(); this.eventDispatcher.destroy(); this.handlers.destroy(); executors.shutdown(); LOGGER.debug("Blueprint extender stopped"); }
public ScheduledExecutorServiceWrapper(BundleContext context, String name, ScheduledExecutorServiceFactory sesf) { _name = name; _factory = sesf; try { _tracked = new SingleServiceTracker<ScheduledExecutorService>(context, ScheduledExecutorService.class, "(aries.blueprint.poolName=" + _name + ")", this); _tracked.open(); } catch (InvalidSyntaxException e) { // Just ignore and stick with the default one. } if (_current.get() == null) { _default.set(_factory.create(name)); if (!!!_current.compareAndSet(null, _default.get())) { _default.getAndSet(null).shutdown(); } } }
public void serviceReplaced() { _current.set(_tracked.getService()); }
public void stop(BundleContext context) { LOGGER.debug("Stopping blueprint extender..."); stopping = true; ServiceUtil.safeUnregisterService(parserServiceReg); ServiceUtil.safeUnregisterService(blueprintServiceReg); ServiceUtil.safeUnregisterService(quiesceParticipantReg); // Orderly shutdown of containers while (!containers.isEmpty()) { for (Bundle bundle : getBundlesToDestroy()) { destroyContainer(bundle); } } if (bt instanceof BundleTracker) { ((BundleTracker) bt).close(); } else if (bt instanceof RecursiveBundleTracker) { ((RecursiveBundleTracker) bt).close(); } proxyManager.close(); this.eventDispatcher.destroy(); this.handlers.destroy(); executors.shutdown(); LOGGER.debug("Blueprint extender stopped"); }
@Override public void start(BundleContext context) { ctx = context; proxyManager = new SingleServiceTracker<ProxyManager>(context, ProxyManager.class, this); proxyManager.open(); // Blueprint URL scheme requires access to the BlueprintContainer service. // We have an optional import // on org.osgi.service.blueprint.container: only register the blueprint:comp/URL // scheme if it's present try { ctx.getBundle().loadClass("org.osgi.service.blueprint.container.BlueprintContainer"); Hashtable<Object, Object> blueprintURlSchemeProps = new Hashtable<Object, Object>(); blueprintURlSchemeProps.put(JNDIConstants.JNDI_URLSCHEME, new String[] { "blueprint" }); blueprintUrlReg = ctx.registerService(ObjectFactory.class.getName(), new BlueprintURLContextServiceFactory(), (Dictionary) blueprintURlSchemeProps); } catch (ClassNotFoundException cnfe) { // The blueprint packages aren't available, so do nothing. That's fine. Logger logger = Logger.getLogger("org.apache.aries.jndi"); logger.log(Level.INFO, "Blueprint support disabled: " + cnfe); logger.log(Level.FINE, "Blueprint support disabled", cnfe); } }
public void serviceReplaced() { _current.set(_tracked.getService()); }
proxyManager = new SingleServiceTracker<ProxyManager>(ctx, ProxyManager.class, new SingleServiceListener() { public void serviceFound() { LOGGER.debug("Found ProxyManager service, starting to process blueprint bundles"); proxyManager.open();
public void serviceFound() { ScheduledExecutorService s = _default.get(); if (_current.compareAndSet(s, _tracked.getService())) { if (s != null) { if (_default.compareAndSet(s, null)) { s.shutdown(); } } } }
proxyManager = new SingleServiceTracker<ProxyManager>(ctx, ProxyManager.class, new SingleServiceListener() { public void serviceFound() { LOGGER.debug("Found ProxyManager service, starting to process blueprint bundles"); proxyManager.open();
public void serviceFound() { ScheduledExecutorService s = _default.get(); if (_current.compareAndSet(s, _tracked.getService())) { if (s != null) { if (_default.compareAndSet(s, null)) { s.shutdown(); } } } }
ProxyManager pm = proxyManager.getService(); if (pm == null) {
ProxyManager pm = proxyManager.getService(); if (pm == null) {