org.openqa.selenium.server
Class SingleEntryAsyncQueue

java.lang.Object
  extended by org.openqa.selenium.server.SingleEntryAsyncQueue

public class SingleEntryAsyncQueue
extends java.lang.Object

Provides a synchronizing queue that holds a single entry (eg a single Selenium Command).

Version:
$Revision: 411 $
Author:
Paul Hammant

Constructor Summary
SingleEntryAsyncQueue(java.lang.String label, java.util.concurrent.locks.Lock dataLock, java.util.concurrent.locks.Condition condition)
           
 
Method Summary
 void clear()
          clear contents and tell any waiting threads to go away.
 java.lang.Object get()
          Retrieves the item from the queue.
 int getTimeout()
           
 boolean hasBlockedGetter()
           
 boolean isEmpty()
           
 java.lang.Object peek()
          Retrieves the item from the queue.
 void put(java.lang.Object newObj)
          Puts something in the queue.
static void setDefaultTimeout(int defaultTimeout)
           
 void setRetry(boolean retry)
           
 void setTimeout(int timeout)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SingleEntryAsyncQueue

public SingleEntryAsyncQueue(java.lang.String label,
                             java.util.concurrent.locks.Lock dataLock,
                             java.util.concurrent.locks.Condition condition)
Method Detail

clear

public void clear()
clear contents and tell any waiting threads to go away.


getTimeout

public int getTimeout()

setTimeout

public void setTimeout(int timeout)

get

public java.lang.Object get()

Retrieves the item from the queue.

If there's nothing in the queue right now, wait a period of time for something to show up.

Returns:
the item in the queue
Throws:
SeleniumCommandTimedOutException - if the timeout is exceeded.

peek

public java.lang.Object peek()

Retrieves the item from the queue.

If there's nothing in the queue right now, wait a period of time for something to show up.

Returns:
the item in the queue
Throws:
SeleniumCommandTimedOutException - if the timeout is exceeded.

isEmpty

public boolean isEmpty()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

put

public void put(java.lang.Object newObj)

Puts something in the queue.

If there's already something available in the queue, wait for that item to get picked up and removed from the queue.

Parameters:
newObj - - the thing to put in the queue

setDefaultTimeout

public static void setDefaultTimeout(int defaultTimeout)

hasBlockedGetter

public boolean hasBlockedGetter()

setRetry

public void setRetry(boolean retry)


Copyright © {inceptionYear}-2007 null. All Rights Reserved.