ServiceEndpoint[] endpoints = (ServiceEndpoint[]) componentConnector.getActiveEndpoints().toArray(new ServiceEndpoint[0]); for (int i = 0; i < endpoints.length; i++) { try { componentConnector.getContext().deactivateEndpoint(endpoints[i]); } catch (JBIException e) { log.error("Error deactivating endpoint", e); } }
    public void close() throws MessagingException {        if (this.closed.compareAndSet(false, true)) {            List pending = queue.closeAndFlush();            for (Iterator iter = pending.iterator(); iter.hasNext();) {                MessageExchangeImpl messageExchange = (MessageExchangeImpl) iter.next();                if (messageExchange.getTransactionContext() != null && messageExchange.getMirror().getSyncState() == MessageExchangeImpl.SYNC_STATE_SYNC_SENT) {                    synchronized (messageExchange.getMirror()) {                        if (log.isDebugEnabled()) {                            log.debug("Notifying: " + messageExchange.getExchangeId());                        }                        messageExchange.getMirror().notify();                    }                }            }            // Interrupt all blocked thread            Object[] threads = waiters.keySet().toArray();            for (int i = 0; i < threads.length; i++) {                ((Thread) threads[i]).interrupt();            }            // TODO: deactivate all endpoints from this component            // TODO: Cause all accepts to return null            // TODO: Abort all pending exchanges        }    }