Remove the NotificationHandler from the Service.

@param serviceName the service name.
@param handler     the NotificationHandler for the service.
773682
public void removeNotificationHandler(String serviceName, NotificationHandler handler) {

        ServiceInstanceUtils.validateServiceName(serviceName);
        if (handler == null) {
            throw new ServiceException(ErrorCode.SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR,
                    ErrorCode.SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR.getMessageTemplate(),
                    "NotificationHandler");
        }
        List<InstanceChangeListener<ModelServiceInstance>> list = changeListenerMap.get(serviceName);
        if (list != null) {
            boolean found = false;
            for (InstanceChangeListener<ModelServiceInstance> listener : list) {
                if (listener instanceof NotificationHandlerAdapter
                        && ((NotificationHandlerAdapter) listener).getAdapter() == handler) {
                    list.remove(listener);
                    found = true;
                    break;
                }
            }
            if (!found) {
               LOGGER.error(ErrorCode.NOTIFICATION_HANDLER_DOES_NOT_EXIST.getMessageTemplate());
            }
        } else {
            LOGGER.error(String.format(ErrorCode.SERVICE_DOES_NOT_EXIST.getMessageTemplate(), serviceName));
        }

    }
688804
public void unregisterService(String serviceName, String providerId) {
        getServiceDirectoryClient().unregisterInstance(serviceName, providerId, disableOwnerError);
    }
252683
def event_handler(self):
        """"""

        if not self._notify_queue:
            LOG.error('event_handler: no notification queue for %s',
                      self._service_name)
            return

        LOG.debug('calling event handler for %s', self)
        self.start()
        self.wait()
1084790
@Override
    public void removeNotificationHandler(String serviceName, NotificationHandler handler) throws ServiceException {

        ServiceInstanceUtils.validateManagerIsStarted(isStarted.get());
        ServiceInstanceUtils.validateServiceName(serviceName);
        if (handler == null) {
            throw new ServiceException(ErrorCode.SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR,
                    ErrorCode.SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR.getMessageTemplate(),
                    "NotificationHandler");
        }
        
        getLookupService().removeNotificationHandler(serviceName, handler);
    }
668123
private void unregisterMBeanInService(String name) {
        ServiceRegistration<DynamicMBean> existingMBean = endpointMBeans.remove(name);
        if (existingMBean != null) {
            existingMBean.unregister();
        }
    }
630382
synchronized void removeHandler(ServiceReference<?> serviceReference) {
        HandlerHolder holder = serviceReferenceMap.remove(serviceReference);

        if (holder != null) {
            for (String topic : holder.getDiscreteTopics()) {
                removeTopicHandlerFromMap(topic, holder, discreteEventHandlers);
            }
            for (String topic : holder.getWildcardTopics()) {
                removeTopicHandlerFromMap(topic, holder, wildcardEventHandlers);
            }
        }

        // Clear the cache since it's no longer up to date
        clearTopicDataCache();
    }
716132
def remove(self, name):
        
        init = self._get_implementation(name)
        self._assert_service_installed(init, name)
        logger.info('Removing %s service %s...', self.init_system, name)
        init.stop()
        init.uninstall()
        logger.info('Service removed')
709324
def remove_service_listener(self, listener):
        """"""
        for browser in self.browsers:
            if browser.listener == listener:
                browser.cancel()
                del(browser)
531538
@Override
    public void removedService(ServiceReference<SessionDestroyedListener> serviceReference,
            SessionDestroyedListener object) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Listener [" + serviceReference + "] has been removed.");
        }

        final SessionDestroyedListener listener = context.getService(serviceReference);
        handler.removeListener(listener);
    }
240378
def remove_handler(self, handler):
        
        super(Session, self).remove_handler(handler)

        self.promote()
        self.stop_heartbeat()
1188563
public void unregisterService(String serviceName, String providerId) {
        getServiceDirectoryClient().unregisterServiceInstance(serviceName, providerId);
        getCacheServiceInstances().remove(new ServiceInstanceToken(serviceName, providerId));
    }
786679
protected void onRemoveClient(String pUserName, String pId, String pAddress) {
        if (null != mClientFactoryListener) {
            mClientFactoryListener.removeClient(this, new RemoveClientEvent(pUserName, pId, pAddress));
        }
    }
1112638
@Override
  public void removeHandler(Handler handler)
  {
    synchronized (this) {
      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      
      if (loader == null) {
        loader = _systemClassLoader;
      }

      for (int i = _loaders.size() - 1; i >= 0; i--) {
        WeakReference<ClassLoader> ref = _loaders.get(i);
        ClassLoader refLoader = ref.get();

        if (refLoader == null) {
          _loaders.remove(i);
        }

        if (isParentLoader(loader, refLoader)) {
          removeHandler(handler, refLoader);
        }
      }

      HandlerEntry ownHandlers = _ownHandlers.get();
      if (ownHandlers != null)
        ownHandlers.removeHandler(handler);
    }
  }
447183
def removeHandler(self, event_name):
        """"""
        if event_name not in self.handlers:
            raise ValueError('{} is not a valid event'.format(event_name))
        self.handlers[event_name] = None
775130
void removeHandler( Object handlerRegistration )
	{
		// Through object's interface implementation
		if( handlerRegistration instanceof DirectHandlerInfo )
		{
			DirectHandlerInfo info = (DirectHandlerInfo) handlerRegistration;
			info.source.removePropertyChangedHandler( info.registrationObject );
			return;
		}
		
		if( ! ( handlerRegistration instanceof HandlerInfo ) )
			return;
		
		HandlerInfo info = (HandlerInfo) handlerRegistration;
	
		HashMap<String, ArrayList<PropertyChangedHandler>> handlersMap = PlatformSpecificProvider.get().getObjectMetadata( info.source );
		if( handlersMap == null )
			return;
	
		ArrayList<PropertyChangedHandler> handlerList = handlersMap.get( info.propertyName );
		if( handlerList == null )
			return;
	
		handlerList.remove( info.handler );
	
		if( handlerList.isEmpty() )
			handlersMap.remove( info.propertyName );
	
		if( handlersMap.isEmpty() )
			PlatformSpecificProvider.get().setObjectMetadata( info.source, null );
		
		stats.statsRemovedRegistration( info );
	
		info.handler = null;
		info.propertyName = null;
		info.source = null;
	}
687448
void unregisterEntry(ListIterator<PathElement> iterator, ConcreteNotificationHandlerRegistration.NotificationHandlerEntry entry) {
        if (!iterator.hasNext()) {
            // leaf node, unregister the entry here
            entries.remove(entry);
            return;
        }

        PathElement element = iterator.next();
        final NotificationHandlerNodeSubregistry subregistry = children.get(element.getKey());
        if (subregistry == null) {
            return;
        }
        subregistry.unregisterEntry(iterator, element.getValue(), entry);

    }
1171031
public boolean removeNotificationListener(String mbeanName, NotificationListener listener) throws Exception {
        if (isConnected()) {
            ObjectName objectName = new ObjectName(mbeanName);
            mbsc.removeNotificationListener(objectName, listener, null, null);
            jmxc.removeConnectionNotificationListener(listener);
            return true;
        } else {
            return false;
        }
    }