Code example for AtomicBoolean

Methods: compareAndSet

0
    public void close() { 
        if (this.decreaseReferece()!=0) {
            return; 
        } 
 
        if (this.closed.compareAndSet(false, true)) {
            this.stub = null;
            if (this.jmxConnector != null) {
                try { 
                    this.jmxConnector.close();
 
                } 
                catch (IOException e) {
                    // ignore 
                } 
            } 
            cache.remove(getKey(this.hostName, this.port, this.userName, this.password));
            log.debug("=================jmx closed!");
        } 
 
    }