Remove transport service from accounting collection and notify of complete shutdown if
necessary.

@param transport service to remove
436553
private void transportClosed(ServerTransport transport) {
    synchronized (lock) {
      if (!transports.remove(transport)) {
        throw new AssertionError("Transport already removed");
      }
      channelz.removeServerSocket(ServerImpl.this, transport);
      checkForTermination();
    }
  }
263748
@Override
    public void removedService(ServiceReference<ManagedServiceFactory> reference, ManagedServiceFactory service) {
        String[] factoryPids = getServicePid(reference);

        if (factoryPids == null) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "removedService(): Invalid service.pid type: " + reference);
            }
            return;
        }

        synchronized (caFactory.getConfigurationStore()) {
            for (String pid : factoryPids) {
                remove(reference, pid);
            }
        }

        context.ungetService(reference);
    }
535376
private void remove(PollController conn)
  {
    if (conn == null) {
      return;
    }

    if (_lifecycle.isDestroyed()) {
      return;
    }

    _activeCount.incrementAndGet();

    if (_activeCount.decrementAndGet() == 0 && _lifecycle.isDestroyed()) {
      destroy();
    }
  }
487390
private void deregisterServices() {
	Iterator<ServiceRegistration<?>> serviceIterator = serviceRegistrations.iterator();
	while (serviceIterator.hasNext()) {
	    ServiceRegistration<?> serviceReference = serviceIterator.next();
	    serviceReference.unregister();
	    serviceIterator.remove();
	}
    }
488045
@Override
    protected void onStop()
    {
        if( m_serviceCollection != null )
        {
            m_serviceCollection.stop();
            m_serviceCollection = null;
        }
        setService( null );
    }
994480
def delete_collection(self, collection):
        
        uri = str.join('/', [self.uri, collection])
        return self.service._delete(uri)
279214
private void stopServices() {
        // Stop services in reverse order of starting.
        m_logger.debug("Stopping all services");
        ListIterator<Service> iter = m_startedServices.listIterator(m_startedServices.size());
        while (iter.hasPrevious()) {
            Service service = iter.previous();
            m_logger.debug("Stopping service: " + service.getClass().getSimpleName());
            service.stop();
            iter.remove();
        }
        m_initializedServices.clear();
        m_storageServices.clear();
    }
3613
public void removeCounter(String serviceName, String dataStructureName) {
        for (WanPublisherEventCounters publisherWanCounterContainer : eventCounterMap.values()) {
            publisherWanCounterContainer.removeCounter(serviceName, dataStructureName);
        }
    }
362728
public function removeTransport(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Transport\Transport $transport)
    {
        return $this->transports->removeElement($transport);
    }
813192
public void serviceChanged(ServiceEvent evt) {
        if (evt.getServiceReference() == logSR
                && evt.getType() == ServiceEvent.UNREGISTERING) {
            ungetLogService();
        }
    }
1188563
public void unregisterService(String serviceName, String providerId) {
        getServiceDirectoryClient().unregisterServiceInstance(serviceName, providerId);
        getCacheServiceInstances().remove(new ServiceInstanceToken(serviceName, providerId));
    }
324301
public void transportClosed() {
        boolean changed=false;

        lock.lock();
        try {
            for(Map.Entry<Address, Rsp<T>> entry: rsps.entrySet()) {
                Rsp<T> rsp=entry.getValue();
                if(rsp != null && !(rsp.wasReceived() || rsp.wasSuspected() || rsp.wasUnreachable())) {
                    rsp.setException(new IllegalStateException("transport was closed"));
                    num_received++;
                    changed=true;
                }
            }
            if(changed && responsesComplete()) {
                complete(this.rsps);
                corrDone();
            }
        }
        finally {
            lock.unlock();
        }
    }
315671
def _offload_service_containers(self, service):
        
        if not isinstance(service, Service):
            raise TypeError("service must be an instance of Service")

        if service.containers:
            for key in list(service.containers.keys()):
                if key in service.containers:
                    del service.containers[key]
936646
def close(self):
        
        if self._closed:
            return
        if self._autoclose:
            self._transport.close()
            self._transport._closed.wait()
        self._transport = None
        self._closed = True
413951
def clear(self, transport):
        """"""
        logger.debug('IEC60488 clear')
        with transport:
            try:
                transport.clear()
            except AttributeError:
                clear_msg = self.create_message('*CLS')
                transport.write(clear_msg)
472235
def shutdown(self, service_thread_map):
    """"""
    with self._services.lifecycle_lock:
      for service, service_thread in service_thread_map.items():
        self._logger.info('terminating pantsd service: {}'.format(service))
        service.terminate()
        service_thread.join(self.JOIN_TIMEOUT_SECONDS)
      self._logger.info('terminating pantsd')
      self._kill_switch.set()
1349896
public void unregisterService() {

		try {
			if( this.serviceReg != null ) {
				this.logger.finer( "Running in an OSGi environment. Trying to unregister a MBean for the messaging." );
				this.serviceReg.unregister();
				this.logger.finer( "Running in an OSGi environment. The MBean was unregistered." );
			}

		} catch( Exception e ) {
			this.logger.severe( "A MBean could not be unregistered for the messaging." );
			Utils.logException( this.logger, e );

		} finally {
			this.serviceReg = null;
		}
	}