org.openqa.grid.internal
Class Registry

java.lang.Object
  extended by org.openqa.grid.internal.Registry

public class Registry
extends java.lang.Object

Kernel of the grid. Keeps track of what's happening, what's free/used and assigned resources to incoming requests.


Field Summary
static java.lang.String KEY
           
 
Constructor Summary
Registry()
           
Registry(Hub hub, GridHubConfiguration config)
           
 
Method Summary
 void add(RemoteProxy proxy)
          Add a proxy to the list of proxy available for the grid to managed and link the proxy to the registry.
 void addNewSessionRequest(RequestHandler request)
           
 void assignRequestToProxy()
          iterates the list of incoming session request to find a potential match in the list of proxies.
 java.util.Set<TestSession> getActiveSessions()
           
 java.util.Set<RemoteProxy> getAllProxies()
           
 GridHubConfiguration getConfiguration()
           
 Hub getHub()
           
 java.util.concurrent.locks.Lock getLock()
           
 java.util.List<RequestHandler> getNewSessionRequests()
           
 int getNewSessionWaitTimeout()
          how long a session can remains in the newSession queue before being quicked out
 Prioritizer getPrioritizer()
           
 RemoteProxy getProxyById(java.lang.String id)
           
 TestSession getSession(java.lang.String externalKey)
          gets the test session associated to this external key.
 java.util.List<RemoteProxy> getUsedProxies()
           
 void release(java.lang.String internalKey)
           
 void setHub(Hub hub)
           
 void setNewSessionWaitTimeout(int newSessionWaitTimeout)
           
 void setPrioritizer(Prioritizer prioritizer)
           
 void setThrowOnCapabilityNotPresent(boolean throwOnCapabilityNotPresent)
          If throwOnCapabilityNotPresent is set to true, the hub will reject test request for a capability that is not on the grid.
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY

public static final java.lang.String KEY
Constructor Detail

Registry

public Registry()

Registry

public Registry(Hub hub,
                GridHubConfiguration config)
Method Detail

getConfiguration

public GridHubConfiguration getConfiguration()

getNewSessionWaitTimeout

public int getNewSessionWaitTimeout()
how long a session can remains in the newSession queue before being quicked out

Returns:

setNewSessionWaitTimeout

public void setNewSessionWaitTimeout(int newSessionWaitTimeout)

stop

public void stop()

getHub

public Hub getHub()

setHub

public void setHub(Hub hub)

addNewSessionRequest

public void addNewSessionRequest(RequestHandler request)

assignRequestToProxy

public void assignRequestToProxy()
iterates the list of incoming session request to find a potential match in the list of proxies. If something changes in the registry, the matcher iteration is stopped to account for that change.


release

public void release(java.lang.String internalKey)

add

public void add(RemoteProxy proxy)
Add a proxy to the list of proxy available for the grid to managed and link the proxy to the registry.

Parameters:
proxy -

setThrowOnCapabilityNotPresent

public void setThrowOnCapabilityNotPresent(boolean throwOnCapabilityNotPresent)
If throwOnCapabilityNotPresent is set to true, the hub will reject test request for a capability that is not on the grid. No exception will be thrown if the capability is present but busy.

If set to false, the test will be queued hoping a new proxy will register later offering that capability.

Parameters:
throwOnCapabilityNotPresent -

getLock

public java.util.concurrent.locks.Lock getLock()

getAllProxies

public java.util.Set<RemoteProxy> getAllProxies()

getUsedProxies

public java.util.List<RemoteProxy> getUsedProxies()

getSession

public TestSession getSession(java.lang.String externalKey)
gets the test session associated to this external key. The external key is the session used by webdriver.

Parameters:
externalKey -
Returns:
null if the hub doesn't have a node associated to the provided externalKey

getNewSessionRequests

public java.util.List<RequestHandler> getNewSessionRequests()

getActiveSessions

public java.util.Set<TestSession> getActiveSessions()

setPrioritizer

public void setPrioritizer(Prioritizer prioritizer)

getPrioritizer

public Prioritizer getPrioritizer()

getProxyById

public RemoteProxy getProxyById(java.lang.String id)


Copyright © 2011. All Rights Reserved.