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, FrameAddress frameAddress, java.util.concurrent.locks.Lock dataLock)
           
 
Method Summary
 void addJsWindowNameVar(java.lang.String jsWindowNameVar)
           
 void discardCommandResult()
           Throw away a command reply.
 boolean doBooleanCommand(java.lang.String command, java.lang.String arg1, java.lang.String arg2)
           
 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.
 SingleEntryAsyncQueue getCommandResultHolder()
           
static int getSpeed()
           
 java.lang.String getUniqueId()
           
 RemoteCommand handleCommandResult(java.lang.String commandResult)
          Accepts a command reply, and retrieves the next command to run.
 boolean isWindowPointedToByJsVariable(java.lang.String jsVariableName)
           
 boolean matchesFrameAddress(java.lang.String currentLocalFrameAddress, java.lang.String newFrameAddressExpression)
           
 void setResultExpected(boolean resultExpected)
           
static void setSpeed(int i)
           
 void setUniqueId(java.lang.String uniqueId)
           
 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,
                    FrameAddress frameAddress,
                    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)

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

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()

setUniqueId

public void setUniqueId(java.lang.String uniqueId)

getCommandResultHolder

public SingleEntryAsyncQueue getCommandResultHolder()

setResultExpected

public void setResultExpected(boolean resultExpected)

setSpeed

public static void setSpeed(int i)

getSpeed

public static int getSpeed()

isWindowPointedToByJsVariable

public boolean isWindowPointedToByJsVariable(java.lang.String jsVariableName)

doBooleanCommand

public boolean doBooleanCommand(java.lang.String command,
                                java.lang.String arg1,
                                java.lang.String arg2)

matchesFrameAddress

public boolean matchesFrameAddress(java.lang.String currentLocalFrameAddress,
                                   java.lang.String newFrameAddressExpression)

addJsWindowNameVar

public void addJsWindowNameVar(java.lang.String jsWindowNameVar)


Copyright © 2006 null. All Rights Reserved.