org.openqa.selenium.server
Class SingleEntryAsyncQueue<T>

java.lang.Object
  extended by org.openqa.selenium.server.SingleEntryAsyncQueue<T>

public class SingleEntryAsyncQueue<T>
extends java.lang.Object

Holds the command to be next run in the browser

This class uses reentrant locks in order to allow the same thread to populate the queue as is waiting for it, which is what currently happens on during browser startup.

Version:
$Revision: 734 $
Author:
Jennifer Bevan

Field Summary
static long MILLISECONDS
           
 
Constructor Summary
SingleEntryAsyncQueue(long timeoutInSecs)
           
 
Method Summary
 long getTimeoutInSeconds()
           
protected  boolean isEmpty()
           
protected  boolean isPoison(T poisonSample)
           
protected  T peek()
           
protected  boolean poisonPollers()
          Clears the contents of the holder (if any) and also feeds 'poison' data a pending listener (if any);
protected  T pollToGetContentUntilTimeout()
           
protected  boolean putContent(T thing)
           
protected  void setPoison(T poisonInstance)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MILLISECONDS

public static final long MILLISECONDS
See Also:
Constant Field Values
Constructor Detail

SingleEntryAsyncQueue

public SingleEntryAsyncQueue(long timeoutInSecs)
Method Detail

getTimeoutInSeconds

public long getTimeoutInSeconds()

setPoison

protected void setPoison(T poisonInstance)

isPoison

protected boolean isPoison(T poisonSample)

pollToGetContentUntilTimeout

protected T pollToGetContentUntilTimeout()

putContent

protected boolean putContent(T thing)

isEmpty

protected boolean isEmpty()

peek

protected T peek()

poisonPollers

protected boolean poisonPollers()
Clears the contents of the holder (if any) and also feeds 'poison' data a pending listener (if any);

Returns:
true if poison was set and sent to any listeners.


Copyright © 2011. All Rights Reserved.