test_class.declarator: logger = LoggerFactory.getLogger(WindowTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger logger = LoggerFactory.getLogger(WindowTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.file: ch-commons-util/src/test/java/com/cloudhopper/commons/util/windowing/WindowTest.java
test_class.identifier: WindowTest
test_case.body: @Test
      public void simulatedMultithreadedProcessing() throws Exception {
          final Window<Integer,String,String> window = new Window<Integer,String,String>(5);
  
          final int requestThreadCount = 8;
          final int requestsPerThread = 10000;
          final BlockingQueue<Integer> requestQueue = new LinkedBlockingQueue<Integer>();
  
          RequestThread[] requestThreads = new RequestThread[requestThreadCount];
          for (int i = 0; i < requestThreadCount; i++) {
              requestThreads[i] = new RequestThread(window, requestQueue, i, requestsPerThread);
          }
  
          ResponseThread responseThread = new ResponseThread(window, requestQueue, requestThreadCount*requestsPerThread);
  
          // start 'em
          for (RequestThread requestThread : requestThreads) {
              requestThread.start();
          }
          responseThread.start();
  
          // wait for them to finish
          for (RequestThread requestThread : requestThreads) {
              requestThread.join();
          }
          responseThread.join();
  
          
          // make sure everything was successful
          for (int i = 0; i < requestThreadCount; i++) {
              if (requestThreads[i].throwable != null) {
                  logger.error("", requestThreads[i].throwable);
              }
              Assert.assertNull("RequestThread " + i + " throwable wasn't null: " + requestThreads[i].throwable, requestThreads[i].throwable);
          }
  
          if (responseThread.throwable != null) {
              logger.error("", responseThread.throwable);
          }
          Assert.assertNull("ResponseThread throwable wasn't null", responseThread.throwable);
  
          Assert.assertEquals(0, window.getSize());
      }
test_case.class_method_signature: WindowTest.simulatedMultithreadedProcessing()
test_case.full_signature: @Test public void simulatedMultithreadedProcessing()
test_case.identifier: simulatedMultithreadedProcessing
test_case.invocations: start start join join error assertNull error assertNull assertEquals getSize
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void simulatedMultithreadedProcessing()
focal_class.declarator: logger = LoggerFactory.getLogger(Window.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(Window.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: maxSize
focal_class.modifier: private final
focal_class.original_string: private final int maxSize;
focal_class.type: int
focal_class.var_name: maxSize
focal_class.declarator: futures
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentHashMap<K,DefaultWindowFuture<K,R,P>> futures;
focal_class.type: ConcurrentHashMap<K,DefaultWindowFuture<K,R,P>>
focal_class.var_name: futures
focal_class.declarator: lock
focal_class.modifier: private final
focal_class.original_string: private final ReentrantLock lock;
focal_class.type: ReentrantLock
focal_class.var_name: lock
focal_class.declarator: completedCondition
focal_class.modifier: private final
focal_class.original_string: private final Condition completedCondition;
focal_class.type: Condition
focal_class.var_name: completedCondition
focal_class.declarator: pendingOffers
focal_class.modifier: private
focal_class.original_string: private AtomicInteger pendingOffers;
focal_class.type: AtomicInteger
focal_class.var_name: pendingOffers
focal_class.declarator: pendingOffersAborted
focal_class.modifier: private
focal_class.original_string: private AtomicBoolean pendingOffersAborted;
focal_class.type: AtomicBoolean
focal_class.var_name: pendingOffersAborted
focal_class.declarator: executor
focal_class.modifier: private final
focal_class.original_string: private final ScheduledExecutorService executor;
focal_class.type: ScheduledExecutorService
focal_class.var_name: executor
focal_class.declarator: monitorHandle
focal_class.modifier: private
focal_class.original_string: private ScheduledFuture<?> monitorHandle;
focal_class.type: ScheduledFuture<?>
focal_class.var_name: monitorHandle
focal_class.declarator: monitor
focal_class.modifier: private final
focal_class.original_string: private final WindowMonitor monitor;
focal_class.type: WindowMonitor
focal_class.var_name: monitor
focal_class.declarator: monitorInterval
focal_class.modifier: private final
focal_class.original_string: private final long monitorInterval;
focal_class.type: long
focal_class.var_name: monitorInterval
focal_class.declarator: listeners
focal_class.modifier: private final
focal_class.original_string: private final CopyOnWriteArrayList<UnwrappedWeakReference<WindowListener<K,R,P>>> listeners;
focal_class.type: CopyOnWriteArrayList<UnwrappedWeakReference<WindowListener<K,R,P>>>
focal_class.var_name: listeners
focal_class.file: ch-commons-util/src/main/java/com/cloudhopper/commons/util/windowing/Window.java
focal_class.identifier: Window
focal_class.class_method_signature: Window.Window(int size)
focal_class.full_signature: public  Window(int size)
focal_class.identifier: Window
focal_class.modifiers: public
focal_class.parameters: (int size)
focal_class.signature:  Window(int size)
focal_class.class_method_signature: Window.Window(int size, ScheduledExecutorService executor, long monitorInterval, WindowListener<K,R,P> listener)
focal_class.full_signature: public  Window(int size, ScheduledExecutorService executor, long monitorInterval, WindowListener<K,R,P> listener)
focal_class.identifier: Window
focal_class.modifiers: public
focal_class.parameters: (int size, ScheduledExecutorService executor, long monitorInterval, WindowListener<K,R,P> listener)
focal_class.signature:  Window(int size, ScheduledExecutorService executor, long monitorInterval, WindowListener<K,R,P> listener)
focal_class.class_method_signature: Window.Window(int size, ScheduledExecutorService executor, long monitorInterval, WindowListener<K,R,P> listener, String monitorThreadName)
focal_class.full_signature: public  Window(int size, ScheduledExecutorService executor, long monitorInterval, WindowListener<K,R,P> listener, String monitorThreadName)
focal_class.identifier: Window
focal_class.modifiers: public
focal_class.parameters: (int size, ScheduledExecutorService executor, long monitorInterval, WindowListener<K,R,P> listener, String monitorThreadName)
focal_class.signature:  Window(int size, ScheduledExecutorService executor, long monitorInterval, WindowListener<K,R,P> listener, String monitorThreadName)
focal_class.class_method_signature: Window.getMaxSize()
focal_class.full_signature: public int getMaxSize()
focal_class.identifier: getMaxSize
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getMaxSize()
focal_class.class_method_signature: Window.getSize()
focal_class.full_signature: public int getSize()
focal_class.identifier: getSize
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getSize()
focal_class.class_method_signature: Window.getFreeSize()
focal_class.full_signature: public int getFreeSize()
focal_class.identifier: getFreeSize
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getFreeSize()
focal_class.class_method_signature: Window.containsKey(K key)
focal_class.full_signature: public boolean containsKey(K key)
focal_class.identifier: containsKey
focal_class.modifiers: public
focal_class.parameters: (K key)
focal_class.return: boolean
focal_class.signature: boolean containsKey(K key)
focal_class.class_method_signature: Window.get(K key)
focal_class.full_signature: public WindowFuture<K,R,P> get(K key)
focal_class.identifier: get
focal_class.modifiers: public
focal_class.parameters: (K key)
focal_class.return: WindowFuture<K,R,P>
focal_class.signature: WindowFuture<K,R,P> get(K key)
focal_class.class_method_signature: Window.addListener(WindowListener<K,R,P> listener)
focal_class.full_signature: public void addListener(WindowListener<K,R,P> listener)
focal_class.identifier: addListener
focal_class.modifiers: public
focal_class.parameters: (WindowListener<K,R,P> listener)
focal_class.return: void
focal_class.signature: void addListener(WindowListener<K,R,P> listener)
focal_class.class_method_signature: Window.removeListener(WindowListener<K,R,P> listener)
focal_class.full_signature: public void removeListener(WindowListener<K,R,P> listener)
focal_class.identifier: removeListener
focal_class.modifiers: public
focal_class.parameters: (WindowListener<K,R,P> listener)
focal_class.return: void
focal_class.signature: void removeListener(WindowListener<K,R,P> listener)
focal_class.class_method_signature: Window.getListeners()
focal_class.full_signature:  List<UnwrappedWeakReference<WindowListener<K,R,P>>> getListeners()
focal_class.identifier: getListeners
focal_class.parameters: ()
focal_class.return: List<UnwrappedWeakReference<WindowListener<K,R,P>>>
focal_class.signature: List<UnwrappedWeakReference<WindowListener<K,R,P>>> getListeners()
focal_class.class_method_signature: Window.destroy()
focal_class.full_signature: public synchronized void destroy()
focal_class.identifier: destroy
focal_class.modifiers: public synchronized
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void destroy()
focal_class.class_method_signature: Window.startMonitor()
focal_class.full_signature: public synchronized boolean startMonitor()
focal_class.identifier: startMonitor
focal_class.modifiers: public synchronized
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean startMonitor()
focal_class.class_method_signature: Window.stopMonitor()
focal_class.full_signature: public synchronized void stopMonitor()
focal_class.identifier: stopMonitor
focal_class.modifiers: public synchronized
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void stopMonitor()
focal_class.class_method_signature: Window.createSortedSnapshot()
focal_class.full_signature: public Map<K,WindowFuture<K,R,P>> createSortedSnapshot()
focal_class.identifier: createSortedSnapshot
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<K,WindowFuture<K,R,P>>
focal_class.signature: Map<K,WindowFuture<K,R,P>> createSortedSnapshot()
focal_class.class_method_signature: Window.offer(K key, R request, long offerTimeoutMillis)
focal_class.full_signature: public WindowFuture offer(K key, R request, long offerTimeoutMillis)
focal_class.identifier: offer
focal_class.modifiers: public
focal_class.parameters: (K key, R request, long offerTimeoutMillis)
focal_class.return: WindowFuture
focal_class.signature: WindowFuture offer(K key, R request, long offerTimeoutMillis)
focal_class.class_method_signature: Window.offer(K key, R request, long offerTimeoutMillis, long expireTimeoutMillis)
focal_class.full_signature: public WindowFuture offer(K key, R request, long offerTimeoutMillis, long expireTimeoutMillis)
focal_class.identifier: offer
focal_class.modifiers: public
focal_class.parameters: (K key, R request, long offerTimeoutMillis, long expireTimeoutMillis)
focal_class.return: WindowFuture
focal_class.signature: WindowFuture offer(K key, R request, long offerTimeoutMillis, long expireTimeoutMillis)
focal_class.class_method_signature: Window.offer(K key, R request, long offerTimeoutMillis, long expireTimeoutMillis, boolean callerWaitingHint)
focal_class.full_signature: public WindowFuture offer(K key, R request, long offerTimeoutMillis, long expireTimeoutMillis, boolean callerWaitingHint)
focal_class.identifier: offer
focal_class.modifiers: public
focal_class.parameters: (K key, R request, long offerTimeoutMillis, long expireTimeoutMillis, boolean callerWaitingHint)
focal_class.return: WindowFuture
focal_class.signature: WindowFuture offer(K key, R request, long offerTimeoutMillis, long expireTimeoutMillis, boolean callerWaitingHint)
focal_class.class_method_signature: Window.getPendingOfferCount()
focal_class.full_signature: public int getPendingOfferCount()
focal_class.identifier: getPendingOfferCount
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getPendingOfferCount()
focal_class.class_method_signature: Window.beginPendingOffer()
focal_class.full_signature: private void beginPendingOffer()
focal_class.identifier: beginPendingOffer
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void beginPendingOffer()
focal_class.class_method_signature: Window.endPendingOffer()
focal_class.full_signature: private boolean endPendingOffer()
focal_class.identifier: endPendingOffer
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean endPendingOffer()
focal_class.class_method_signature: Window.abortPendingOffers()
focal_class.full_signature: public boolean abortPendingOffers()
focal_class.identifier: abortPendingOffers
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean abortPendingOffers()
focal_class.class_method_signature: Window.complete(K key, P response)
focal_class.full_signature: public WindowFuture<K,R,P> complete(K key, P response)
focal_class.identifier: complete
focal_class.modifiers: public
focal_class.parameters: (K key, P response)
focal_class.return: WindowFuture<K,R,P>
focal_class.signature: WindowFuture<K,R,P> complete(K key, P response)
focal_class.class_method_signature: Window.fail(K key, Throwable t)
focal_class.full_signature: public WindowFuture<K,R,P> fail(K key, Throwable t)
focal_class.identifier: fail
focal_class.modifiers: public
focal_class.parameters: (K key, Throwable t)
focal_class.return: WindowFuture<K,R,P>
focal_class.signature: WindowFuture<K,R,P> fail(K key, Throwable t)
focal_class.class_method_signature: Window.failAll(Throwable t)
focal_class.full_signature: public List<WindowFuture<K,R,P>> failAll(Throwable t)
focal_class.identifier: failAll
focal_class.modifiers: public
focal_class.parameters: (Throwable t)
focal_class.return: List<WindowFuture<K,R,P>>
focal_class.signature: List<WindowFuture<K,R,P>> failAll(Throwable t)
focal_class.class_method_signature: Window.cancel(K key)
focal_class.full_signature: public WindowFuture<K,R,P> cancel(K key)
focal_class.identifier: cancel
focal_class.modifiers: public
focal_class.parameters: (K key)
focal_class.return: WindowFuture<K,R,P>
focal_class.signature: WindowFuture<K,R,P> cancel(K key)
focal_class.class_method_signature: Window.cancelAll()
focal_class.full_signature: public List<WindowFuture<K,R,P>> cancelAll()
focal_class.identifier: cancelAll
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<WindowFuture<K,R,P>>
focal_class.signature: List<WindowFuture<K,R,P>> cancelAll()
focal_class.class_method_signature: Window.cancelAllExpired()
focal_class.full_signature: public List<WindowFuture<K,R,P>> cancelAllExpired()
focal_class.identifier: cancelAllExpired
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<WindowFuture<K,R,P>>
focal_class.signature: List<WindowFuture<K,R,P>> cancelAllExpired()
focal_class.class_method_signature: Window.removeHelper(K key)
focal_class.full_signature:  void removeHelper(K key)
focal_class.identifier: removeHelper
focal_class.parameters: (K key)
focal_class.return: void
focal_class.signature: void removeHelper(K key)
focal_method.body: public int getSize() {
          return this.futures.size();
      }
focal_method.class_method_signature: Window.getSize()
focal_method.full_signature: public int getSize()
focal_method.identifier: getSize
focal_method.invocations: size
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: int
focal_method.signature: int getSize()