tracked = null; try { context.removeServiceListener(outgoing); } catch (IllegalStateException e) {
/** * Stops this {@code Activator}. * * @param bundleContext the {@code BundleContext} in which this * {@code Activator} is stopping * @throws Exception error stopping and removing dependent services. */ @Override public void stop(BundleContext bundleContext) throws Exception { bundleContext.removeServiceListener(this); if (serviceRegistration != null) { serviceRegistration.unregister(); serviceRegistration = null; } if (conferenceStatsHandler != null) { conferenceStatsHandler.stop(); conferenceStatsHandler = null; } }
/** * {@inheritDoc} * * Initializes this <tt>StatsTransport</tt> if it has not been initialized * yet. */ @Override protected void bundleContextChanged( BundleContext oldValue, BundleContext newValue) { super.bundleContextChanged(oldValue, newValue); if (oldValue != null) oldValue.removeServiceListener(serviceListener); if (newValue != null) newValue.addServiceListener(serviceListener); initOrDispose(null); }
/** * Disposes of this {@code StatsTransport} so that * {@link #publishStatistics(Statistics)} may not execute successfully any * longer. * * @param bundleContext the {@code BundleContext} in which this * {@code StatsTransport} is to be disposed */ private void dispose(BundleContext bundleContext) { if (serviceListener != null) { bundleContext.removeServiceListener(serviceListener); serviceListener = null; } if (statsService != null) { StatsServiceFactory.getInstance() .stopStatsService(bundleContext, statsService.getId()); statsService = null; } bridgeStatusInfoBuilder = null; }
tracked = null; try { context.removeServiceListener(outgoing);
public void stop(BundleContext context) throws Exception { if (listener != null) { context.removeServiceListener(listener); listener = null; } }
/** * */ public void deactive() { Activator.bc.removeServiceListener(this); }
/** * */ public void deactive() { Activator.context.removeServiceListener(this); }
/** * Stops the event dispatcher. * This method unregisters the {@link ServiceListener}. * This methods must be called only when the iPOJO bundle * stops. */ private void stop() { synchronized (this) { m_context.removeServiceListener(this); m_listeners.clear(); } }
public void destroy(){ context.removeServiceListener(this); upnpListeners.removeAllElements(); } }
private void stopListening(){ try{ myContext.removeServiceListener(this); }catch(IllegalStateException ex){ theLogger.log(Level.WARNING, "BundleContext not valid.", ex); } }
public void dispose() { BundleContext context = FrameworkUtil.getBundle(getClass()).getBundleContext(); context.removeServiceListener(listener); } }
public void close() { if (open.compareAndSet(true, false)) { ctx.removeServiceListener(listener); synchronized (this) { ServiceReference<T> deadRef = ref.getAndSet(null); service.set(null); if (deadRef != null) ctx.ungetService(deadRef); } } }
public void close() { if (open.compareAndSet(true, false)) { ctx.removeServiceListener(listener); synchronized (this) { ServiceReference<T> deadRef = ref.getAndSet(null); service.set(null); if (deadRef != null) ctx.ungetService(deadRef); } } }
private void setSessionId(String sessionId) { try { m_bundleContext.removeServiceListener(this); m_bundleContext.addServiceListener(this, String.format("(&(objectClass=%s)(sessionId=%s))", "org.opennms.features.topology.api.topo.Criteria", sessionId)); } catch (InvalidSyntaxException e) { LoggerFactory.getLogger(getClass()).error("registerServiceListener() failed", e); } }
/** * @see org.osgi.framework.ServiceListener#serviceChanged(org.osgi.framework.ServiceEvent) */ public void serviceChanged(ServiceEvent e) { if(e.getType()==ServiceEvent.UNREGISTERING){ Activator.bc.removeServiceListener(this); } } }
@Override public void dispose() { for (ServiceReference<?> ref : refs.values()) { if (ref != null) bundleContext.ungetService(ref); } refs.clear(); bundleContext.removeServiceListener(this); bundleContext.removeBundleListener(this); super.dispose(); }
@Override public void removeListener(Listener<RegistryEvent> listener) { ServiceListener sl = getWrappedListener(listener); if(sl != null){ myContext.removeServiceListener(sl); } }
public void doStop(BundleContext bc) { LOG.debug("TopologyManager: stop()"); bc.removeServiceListener(exportManager); exportExecutor.shutdown(); importManager.stop(); endpointListenerManager.stop(); rsaTracker.close(); exportManager = null; }
public void stop(BundleContext context) { eventAdminAdapter.stop(); eventAdminAdapter = null; logServiceRegistration.unregister(); logServiceRegistration = null; logReaderServiceRegistration.unregister(); logReaderServiceRegistration = null; logServiceFactory.shutdown(); context.removeFrameworkListener(this); context.removeServiceListener(this); context.removeBundleListener(this); }