Code example for AtomicReference

Methods: getAndSet

  public final URI getClusterUri() throws WeaveException {
    return getClusterUri(true); 
  public final URI setClusterUri(URI clusterUri) {
    return m_clusterUri.getAndSet(clusterUri);
  public final URI getClusterUri(boolean useCache) throws WeaveException {
    URI cached = null;
    if (useCache && ((cached = m_clusterUri.get()) != null))
      return cached;
    URI retval = getClusterUriSafe();
    m_clusterUri.compareAndSet(cached, retval);
    return retval;
  public boolean checkUsernameAvailable() throws WeaveException { 
    try { 
Connect your IDE to all the code out there  Get Codota for Java