Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.infinispan.commons.util.concurrent;
 
 import java.util.Set;

Author(s):
Mircea Markus
Since:
5.2
public abstract class BaseNotifyingFuture<T> implements NotifyingFuture<T> {
   volatile boolean callCompleted = false;
   public final NotifyingFuture<T> attachListener(FutureListener<T> objectFutureListener) {
      .readLock().lock();
      try {
         if (!.add(objectFutureListener);
         if (objectFutureListener.futureDone(this);
         return this;
      } finally {
         .readLock().unlock();
      }
   }
   protected void fireListeners() {
      .writeLock().lock();
      try {
         if () {
            throw new IllegalStateException("Already fired listeners.");
         }
          = true;
         for (FutureListener<T> l : l.futureDone(this);
      } finally {
         .writeLock().unlock();
      }
   }
New to GrepCode? Check out our FAQ X