/*
(non-Javadoc)
@see net.timewalker.ffmq4.local.destination.AbstractLocalDestination#close()
420669
@Override
	public final void close() throws JMSException
    {
    	synchronized (closeLock)
		{
	    	if (closed)
	    		return;
	    	closed = true;
		}
    	
    	ActivityWatchdog.getInstance().unregister(this);
    	
    	synchronized (storeLock)
		{
	        if (volatileStore != null)
	        {
	            volatileStore.close();
	            
	            // Delete message store if the queue was temporary
	            if (queueDef.isTemporary())
	                volatileStore.delete();
	        }
	        if (persistentStore != null)
	        {
	            persistentStore.close();
	            
	            // Delete message store if the queue was temporary
	            if (queueDef.isTemporary())
	                persistentStore.delete();
	        }
		}
    	
    	// Create a snapshot to avoid concurrent modification
    	List<LocalMessageConsumer> consumers;
    	consumersLock.readLock().lock();
    	try
    	{
    		if (localConsumers.isEmpty())
    			return;
    		
    		consumers = new ArrayList<>(localConsumers);
    	}
    	finally
    	{
    		consumersLock.readLock().unlock();
    	}	
    		
    	// Close all consumers
    	for (int n=0;n<consumers.size();n++)
        {
	        LocalMessageConsumer consumer = consumers.get(n);
	        try
	        {
	            consumer.close();
	        }
	        catch (JMSException e)
	        {
	            ErrorTools.log(e, log);
	        }
        }
    }
784484
@Override
	public void close() {
		synchronized (this) {
			if (object != null) {
				T object_ = object;
				object = null;
				try {
					finalizer.accept(object_);
				} catch (Exception e) {
					// Ignored
				}
			}
		}
	}
33269
@Override
    public void close() throws IOException
    {
        if (out != null)
        {
            out.close();
            out = null;
        }
        if (in != null)
        {
            in.close();
            in = null;
        }
    }
84410
@Override
	public synchronized void close() throws IOException {
		// cancel synchronization
		try {
			if (syncTask != null) {
				syncTask.cancel();
			}
			sync();
			unmapFile();
		} finally {
			super.close();
		}
	}
62081
public void close() {
        Iterator<SocketDestination> it = getStatsMap().keySet().iterator();
        while(it.hasNext()) {
            try {
                SocketDestination destination = it.next();
                JmxUtils.unregisterMbean(JmxUtils.createObjectName(JmxUtils.getPackageName(ClientRequestExecutor.class),
                                                                   "stats_"
                                                                           + destination.toString()
                                                                                        .replace(':',
                                                                                                 '_')
                                                                           + identifierString));
            } catch(Exception e) {}
        }
    }
557242
public void close() {

        if (this.xaConnection != null) {
            this.xaConnection.doClose();
        }
        this.closed = true;
        this.notifyClosed();

        if (LOG.isDebugEnabled()) {
            LOG.debug("PhynixxXAResource[" + this.getId() + "]:closed ");
        }
    }
109478
@Override
	public void close() {
		IOUtils.closeQuietly(defaultColumnFamilyHandle);
		IOUtils.closeQuietly(nativeMetricMonitor);
		IOUtils.closeQuietly(db);
		// Making sure the already created column family options will be closed
		columnFamilyDescriptors.forEach((cfd) -> IOUtils.closeQuietly(cfd.getOptions()));
	}
855089
public void close()
  {
    if (TraceComponent.isAnyTracingEnabled() && CoreSPIBrowserSession.tc.isEntryEnabled())
      SibTr.entry(CoreSPIBrowserSession.tc, "close", this);

    synchronized (this)
    {
      if (!_closed)
        //if we're closed already, don't bother doing anything.
      {
        //dereference from the parent connection
        _conn.removeBrowserSession(this);

        _close();
      }
    }
    if (TraceComponent.isAnyTracingEnabled() && CoreSPIBrowserSession.tc.isEntryEnabled())
      SibTr.exit(CoreSPIBrowserSession.tc, "close");
  }
1292821
@Override
	public void close() {
		if (leaf != null) {
			leaf.close();
			leaf = null;
		}
		dirsMayBeUpdated = null;
	}
1233781
public synchronized void close() throws IOException {
        if(getStatus().equals(ConnectionStatus.CLOSED)){
            return ;
        }
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Closing client for session: 0x"
                      + getSessionId());
        }
        connectRun.set(false);

        try{
            clientSocket.cleanup();
        }catch(Exception e){
            LOGGER.warn("Close the WSDirectorySocket get error.", e);
        }

        try {
            setStatus(ConnectionStatus.CLOSED);
            sendCloseSession();
            closeSession();
            eventThread.queueEventOfDeath();
        } catch (ServiceException e) {
            LOGGER.warn("Execute the CloseSession Protocol failed when close", e);
        }
    }
18553
@Override
    public void close()
    {
        isOpen.set(false);
        Iterator<Future<?>> iterator = futures.iterator();
        while ( iterator.hasNext() )
        {
            Future<?> future = iterator.next();
            iterator.remove();
            if ( !future.isDone() && !future.isCancelled() && !future.cancel(true) )
            {
                log.warn("Could not cancel " + future);
            }
        }
        if (shutdownOnClose) {
            executorService.shutdownNow();
        }
    }
419683
@Override
    public void close() {
        if (!this.closed.getAndSet(true)) {
            if (state() == State.RUNNING) {
                Futures.await(Services.stopAsync(this, this.executorService));
            }

            synchronized (this.clients) {
                this.clients.clear();
            }

            this.metrics.close();
            log.info("{} Closed.", TRACE_OBJECT_ID);
        }
    }
1084748
public final void close()
    {
        try
        {
            if (!isClosed)
            {
                isRunning = false;
                isClosed = true;
                agent.onClose();
            }
        }
        catch (final Throwable throwable)
        {
            errorHandler.onError(throwable);
        }
    }
815487
@Override @DefinedBy(Api.COMPILER)
    public void close() throws IOException {
        if (deferredCloseTimeout > 0) {
            deferredClose();
            return;
        }

        locations.close();
        for (Container container: containers.values()) {
            container.close();
        }
        containers.clear();
        contentCache.clear();
    }
187169
public void close()
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "close");
      synchronized(this)
      {
         if (closed)
         {
            idToProxyQueueMap.clear();
            factory.groupCloseNotification(conversation, this);
         } 
      }      
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "close");
   }
377309
@Override
  public void close() throws IOException {
    try {
      this.unlock();
    } catch (JobLockException e) {
      throw new IOException(e);
    } finally {
      lockEventListeners.remove(this.lockPath);
    }
  }
1139309
@Override
	public void close() {
		executor.shutdown();
		for (SelectionKey key : selector.keys()) {
			((Attachment) key.attachment()).finishClose();
		}
		try {
			selector.close();
		} catch (IOException e) {/**/}
	}