Removes a service from the gateway.

        @param service: Either the name or t of the service to remove from the
                        gateway, or .
        @type service: C{callable} or a class instance
        @raise NameError: Service not found.
510375
def removeService(self, service):
        
        for name, wrapper in self.services.iteritems():
            if service in (name, wrapper.service):
                del self.services[name]
                return

        raise NameError("Service %r not found" % (service,))
789307
def _delete_service(self, service_only=False):
        
        logging.debug('_delete_service()')
        return self.service.delete_service(self.service_name)
1366028
def add_service(self, service):
        
        if service.protocol in self._services:
            existing = self._services[service.protocol]
            if not existing.superseeded_by(service):
                return

        self._services[service.protocol] = service
1102272
def remove_existing_container(engine_obj, service_name, remove_volumes=False):
    
    conductor_container_id = engine_obj.get_container_id_for_service(service_name)
    if engine_obj.service_is_running(service_name):
        engine_obj.stop_container(conductor_container_id, forcefully=True)
    if conductor_container_id:
        engine_obj.delete_container(conductor_container_id, remove_volumes=remove_volumes)
247518
public Result<T> remove(ServiceInfo.Key key)
    {
        T previous = null;

        lock();
        try
        {
            ServiceType serviceType = keysToServiceTypes.remove(key);
            if (serviceType == null) return new Result<T>(null, null);
            previous = keysToServiceInfos.remove(key);
            previous.setRegistered(false);
        }
        finally
        {
            unlock();
        }

        notifyServiceRemoved(previous, null);
        return new Result<T>(previous, null);
    }
38934
@Override
    public boolean deleteService(Service service) throws ServiceException {
        if (super.deleteService(service)) {
            // Update cache
            this.removeServiceFromCache(service.getUri());
            return true;
        }

        return false;
    }
981622
def delete_service(self, service_name, params=None):
        
        if not self.space.has_service_with_name(service_name):
            logging.warning("Service not found so... succeeded?")
            return True

        guid = self.get_instance_guid(service_name)
        logging.info("Deleting service %s with guid %s" % (service_name, guid))

        # MAINT: this endpoint changes in newer version of api
        return self.api.delete("/v2/service_instances/%s?accepts_incomplete=true" %
            (guid), params=params)
1094890
public void unbindService() {
        Log.v(TAG, "Trying to unbind the service");
        Context context = this.context.get();
        if (isBound && context != null) {
            context.unbindService(this);
            isBound = false;
        }
    }
136853
@Override
    public void removeEndPoint(String name) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Deleting endpoint: " + name);
        }

        synchronized (this.endpoints) {
            if (this.endpoints.remove(name) != null) {
                unregisterMBeanInService(name);
            }
        }
    }
409339
def unregister(self, alias):
        
        if alias not in self._service_objects:
            raise Error(self._device,
                        'No service is registered with alias "%s".' % alias)
        service_obj = self._service_objects.pop(alias)
        if service_obj.is_alive:
            with expects.expect_no_raises(
                    'Failed to stop service instance "%s".' % alias):
                service_obj.stop()
42915
def delete(self):
        # type: () -> None
        
        response = self._client._request('DELETE', self._client._build_url('service', service_id=self.id))

        if response.status_code != requests.codes.no_content:  # pragma: no cover
            raise APIError("Could not delete service: {} with id {}".format(self.name, self.id))
797037
def unregister_service(service, service_api)
      code, message, val = @proxy.unregisterService(@caller_id,
                                                    service,
                                                    service_api)
      if code == 1
        return true
      elsif code == 0
        puts message
        return true
      else
        raise message
      end
    end
470220
private static void destroyService() {
        Thread thread = DESTROY_THREAD;
        if (thread == null) {
            thread = new Thread() {
                @Override
                public void run() {
                    try {
                        // we wait 5000ms, because the service maybe can use
                        Thread.sleep(5000);
                        dispose();
                    } catch (InterruptedException e) {
                        //e.printStackTrace();
                    }
                    DESTROY_THREAD = null;
                }
            };
            thread.setDaemon(true);
            DESTROY_THREAD = thread;
            thread.start();
        }
    }
708784
def delete_service(resource_root, name, cluster_name="default"):
  
  return call(resource_root.delete,
      "%s/%s" % (SERVICES_PATH % (cluster_name,), name),
      ApiService)
961510
public static void removeJ2CIdentityService(J2CIdentityService j2cIdentityService) {
        if (j2cIdentityService != null) {
            j2cIdentityServices.remove(j2cIdentityService);
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "A J2CIdentityService implementation was removed.", j2cIdentityService.getClass().getName());
            }
        }
    }
191008
@Override
    public void unregisterService(ServiceInstance<T> service) throws Exception
    {
        Entry<T> entry = services.remove(service.getId());
        internalUnregisterService(entry);
    }
1329689
def delete_service_key(self, service_name, key_name):
        
        key = self.get_service_key(service_name, key_name)
        logging.info("Deleting service key %s for service %s" % (key, service_name))
        return self.api.delete(key['metadata']['url'])