src/main/java/org/hyperledger/fabric/sdk/Channel.java
/**
     * Shutdown the channel with all resources released.
     *
     * @param force force immediate shutdown.
     */
Shutdown the channel with all resources released.
@param force force immediate shutdown.
Shutdown the channel with all resources released . @param force force immediate shutdown .
public synchronized void shutdown(boolean force) {
        if (shutdown) {
            return;
        }
        initialized = false;
        shutdown = true;
        if (chainCodeListeners != null) {
            chainCodeListeners.clear();
        }
        if (blockListeners != null) {
            blockListeners.clear();
        }
        if (client != null) {
            client.removeChannel(this);
        }
        client = null;
        for (EventHub eh : eventHubs) {
            try {
                eh.shutdown();
            } catch (Exception e) {
            }
        }
        eventHubs.clear();
        for (Peer peer : new ArrayList<>(getPeers())) {
            try {
                removePeerInternal(peer);
                peer.shutdown(force);
            } catch (Exception e) {
            }
        }
        peers.clear(); 
        for (Set<Peer> peerRoleSet : peerRoleSetMap.values()) {
            peerRoleSet.clear();
        }
        for (Orderer orderer : getOrderers()) {
            orderer.shutdown(force);
        }
        orderers.clear();
        if (null != eventQueueThread) {
            if (eventQueueThread != null) {
                eventQueueThread.interrupt();
            }
            eventQueueThread = null;
        }
        ScheduledFuture<?> lsweeper = sweeper;
        sweeper = null;
        if (null != lsweeper) {
            lsweeper.cancel(true);
        }
    }
public synchronized void shutdown ( boolean force ) { if ( shutdown ) { return ; } initialized = false ; shutdown = true ; if ( chainCodeListeners != null ) { chainCodeListeners . clear ( ) ; } if ( blockListeners != null ) { blockListeners . clear ( ) ; } if ( client != null ) { client . removeChannel ( this ) ; } client = null ; for ( EventHub eh : eventHubs ) { try { eh . shutdown ( ) ; } catch ( Exception e ) { } } eventHubs . clear ( ) ; for ( Peer peer : new ArrayList < > ( getPeers ( ) ) ) { try { removePeerInternal ( peer ) ; peer . shutdown ( force ) ; } catch ( Exception e ) { } } peers . clear ( ) ; for ( Set < Peer > peerRoleSet : peerRoleSetMap . values ( ) ) { peerRoleSet . clear ( ) ; } for ( Orderer orderer : getOrderers ( ) ) { orderer . shutdown ( force ) ; } orderers . clear ( ) ; if ( null != eventQueueThread ) { if ( eventQueueThread != null ) { eventQueueThread . interrupt ( ) ; } eventQueueThread = null ; } ScheduledFuture < ? > lsweeper = sweeper ; sweeper = null ; if ( null != lsweeper ) { lsweeper . cancel ( true ) ; } }
Shutdown the channel with all resources released.
Shutdown the channel with all resources released .
// Best effort. // Best effort. // make sure. //Make sure