Code example for AtomicReference

Methods: getAndSet

0
    } 
 
    @Override 
    protected void doCloseCommunicationLink() 
    { 
        FtpClient idle = idleClient.getAndSet(null);
        // Clean up the connection 
        if (idle != null)
        { 
            closeConnection(idle);
        } 
    } 
 
    /** 
     * Adds the capabilities of this file system. 
     */ 
    @Override 
    protected void addCapabilities(final Collection<Capability> caps)
    { 
        caps.addAll(FtpFileProvider.capabilities);
    }