Code example for AtomicBoolean

Methods: compareAndSet

0
    public String getAddressAsString() {
        return this.address.toString();
    } 
 
    synchronized private void tryReconnect() throws JMXClientException{ 
        if(this.closed.compareAndSet(true, false)){
            this.connect();
        } 
    } 
 
    private void connect() throws JMXClientException { 
        try { 
            if (this.stub == null) {
                this.checkSslConfig();
            } 
            this.jmxConnector = new RMIConnector(this.stub, null);
            if (this.userName == null && this.password == null) {
                // this.jmxConnector = 
                // JMXConnectorFactory.connect(this.address); 
                this.jmxConnector.connect();