org.openqa.selenium.server
Class CommandQueue

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

public class CommandQueue
extends java.lang.Object

Schedules and coordinates commands to be run.

Version:
$Revision: 734 $
Author:
Paul Hammant
See Also:
SingleEntryAsyncQueue

Constructor Summary
CommandQueue(java.lang.String sessionId, java.lang.String uniqueId, java.util.concurrent.locks.Lock dataLock)
           
 
Method Summary
 void addJsWindowNameVar(java.lang.String jsWindowNameVar)
           
 void declareClosed()
           
 void discardCommandResult()
           Throw away a command reply.
 java.lang.String doCommand(java.lang.String command, java.lang.String field, java.lang.String value)
          Schedules the specified command to be retrieved by the next call to handle command result, and returns the result of that command.
 void doCommandWithoutWaitingForAResponse(java.lang.String command, java.lang.String field, java.lang.String value)
           
 void endOfLife()
           Empty queues, and thereby wake up any threads that are hanging around and send them on their way.
 BrowserResponseSequencer getBrowserResponseSequencer()
           
 SingleEntryAsyncQueue getCommandResultHolder()
           
 FrameAddress getFrameAddress()
           
static int getSpeed()
           
 java.lang.String getUniqueId()
           
 RemoteCommand handleCommandResult(java.lang.String commandResult)
          Accepts a command reply, and retrieves the next command to run.
 void handleCommandResultWithoutWaitingForAResponse(java.lang.String commandResult)
           
 boolean isClosed()
           
 boolean isResultExpected()
          Get whether this command queue expects a result instead of just "OK".
 boolean isWindowPointedToByJsVariable(java.lang.String jsVariableName)
           
 void setFrameAddress(FrameAddress frameAddress)
           
 void setResultExpected(boolean resultExpected)
           
static void setSpeed(int i)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommandQueue

public CommandQueue(java.lang.String sessionId,
                    java.lang.String uniqueId,
                    java.util.concurrent.locks.Lock dataLock)
Method Detail

doCommand

public java.lang.String doCommand(java.lang.String command,
                                  java.lang.String field,
                                  java.lang.String value)
Schedules the specified command to be retrieved by the next call to handle command result, and returns the result of that command.

Parameters:
command - - the remote command verb
field - - the first remote argument (meaning depends on the verb)
value - - the second remote argument
Returns:
- the command result, defined by the remote JavaScript. "getX" style commands may return data from the browser; other "doX" style commands may just return "OK" or an error message.

doCommandWithoutWaitingForAResponse

public void doCommandWithoutWaitingForAResponse(java.lang.String command,
                                                java.lang.String field,
                                                java.lang.String value)
                                         throws WindowClosedException
Throws:
WindowClosedException

toString

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

handleCommandResult

public RemoteCommand handleCommandResult(java.lang.String commandResult)

Accepts a command reply, and retrieves the next command to run.

Parameters:
commandResult - - the reply from the previous command, or null
Returns:
- the next command to run

handleCommandResultWithoutWaitingForAResponse

public void handleCommandResultWithoutWaitingForAResponse(java.lang.String commandResult)

discardCommandResult

public void discardCommandResult()

Throw away a command reply.


endOfLife

public void endOfLife()

Empty queues, and thereby wake up any threads that are hanging around and send them on their way.


getUniqueId

public java.lang.String getUniqueId()

getFrameAddress

public FrameAddress getFrameAddress()

setFrameAddress

public void setFrameAddress(FrameAddress frameAddress)

getCommandResultHolder

public SingleEntryAsyncQueue getCommandResultHolder()

setResultExpected

public void setResultExpected(boolean resultExpected)

isResultExpected

public boolean isResultExpected()
Get whether this command queue expects a result instead of just "OK".

Returns:
Returns whether this command will expect a command result.

setSpeed

public static void setSpeed(int i)

getSpeed

public static int getSpeed()

isWindowPointedToByJsVariable

public boolean isWindowPointedToByJsVariable(java.lang.String jsVariableName)

addJsWindowNameVar

public void addJsWindowNameVar(java.lang.String jsWindowNameVar)

declareClosed

public void declareClosed()

isClosed

public boolean isClosed()

getBrowserResponseSequencer

public BrowserResponseSequencer getBrowserResponseSequencer()


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