Code example for AtomicInteger

Methods: incrementAndGet

0
    private JMXClient(String hostName, int port) throws JMXClientException {
        this(hostName, port, null, null);
    } 
 
    private int increaseReferece(){ 
        return this.referenceCount.incrementAndGet();
    } 
 
    private int decreaseReferece(){ 
 
        int count = this.referenceCount.decrementAndGet();
        if(count<0){
            this.referenceCount.set(0);
        } 
        log.debug("=============referenceCount:" + this.referenceCount.get());
        return this.referenceCount.get();
    } 
 
    private JMXClient(String hostName, int port, String userName, String password) throws JMXClientException {
        this.hostName = hostName;
        this.port = port;