Code example for AtomicReference

Methods: getAndSet

0
  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 {