@ThreadSafe public class DefaultGridRegistry extends BaseGridRegistry implements GridRegistry
| Modifier and Type | Class and Description |
|---|---|
protected static class |
DefaultGridRegistry.UncaughtExceptionHandler |
httpClientFactory, hubKEY| Constructor and Description |
|---|
DefaultGridRegistry() |
DefaultGridRegistry(Hub hub) |
| Modifier and Type | Method and Description |
|---|---|
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 handler)
Add a new session request to the registry
|
void |
clearNewSessionRequests()
Clear all new session requests in the registry
|
void |
forceRelease(TestSlot testSlot,
SessionTerminationReason reason)
Releases the test slot, WITHOUT running any listener.
|
java.util.Set<TestSession> |
getActiveSessions() |
ProxySet |
getAllProxies() |
java.lang.Iterable<org.openqa.selenium.remote.DesiredCapabilities> |
getDesiredCapabilities() |
TestSession |
getExistingSession(ExternalSessionKey externalKey)
gets the test existing session associated to this external key.
|
int |
getNewSessionRequestCount() |
RemoteProxy |
getProxyById(java.lang.String id)
Get the
RemoteProxy using the id provided |
TestSession |
getSession(ExternalSessionKey externalKey)
Gets the test session associated to this external key.
|
java.util.List<RemoteProxy> |
getUsedProxies() |
static GridRegistry |
newInstance(Hub hub)
Creates a new
GridRegistry and starts it. |
void |
removeIfPresent(RemoteProxy proxy)
Remove the
RemoteProxy specified from the registry |
boolean |
removeNewSessionRequest(RequestHandler request)
Remove a new session request from the registry
|
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 |
start()
Start the registry
|
void |
stop()
Stop the registry
|
void |
terminate(TestSession session,
SessionTerminationReason reason)
Ends this test session for the hub, releasing the resources in the hub / registry.
|
getHttpClient, getHub, setHubclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetHttpClient, getHub, setHubpublic DefaultGridRegistry()
public DefaultGridRegistry(Hub hub)
public void start()
GridRegistrystart in interface GridRegistrypublic static GridRegistry newInstance(Hub hub)
GridRegistry and starts it.hub - the Hub to associate this registry withpublic void terminate(TestSession session, SessionTerminationReason reason)
terminate in interface GridRegistrysession - The session to terminatereason - the reason for terminationpublic void removeIfPresent(RemoteProxy proxy)
GridRegistryRemoteProxy specified from the registryremoveIfPresent in interface GridRegistryGridRegistry.removeIfPresent(RemoteProxy)public void forceRelease(TestSlot testSlot, SessionTerminationReason reason)
GridRegistryforceRelease in interface GridRegistrytestSlot - test slot to be releasedreason - reason for terminationGridRegistry.forceRelease(TestSlot, SessionTerminationReason)public void stop()
GridRegistrystop in interface GridRegistryGridRegistry.stop()public void addNewSessionRequest(RequestHandler handler)
GridRegistryaddNewSessionRequest in interface GridRegistryhandler - the RequestHandlerGridRegistry.addNewSessionRequest(RequestHandler)public void add(RemoteProxy proxy)
GridRegistryadd in interface GridRegistryproxy - The proxy to addGridRegistry.add(RemoteProxy)public void setThrowOnCapabilityNotPresent(boolean throwOnCapabilityNotPresent)
GridRegistryIf set to false, the test will be queued hoping a new proxy will register later offering that capability.
setThrowOnCapabilityNotPresent in interface GridRegistrythrowOnCapabilityNotPresent - true to throw if capability not presentGridRegistry.setThrowOnCapabilityNotPresent(boolean)public ProxySet getAllProxies()
getAllProxies in interface GridRegistryProxySet of all of the connected proxies/nodesGridRegistry.getAllProxies()public java.util.List<RemoteProxy> getUsedProxies()
getUsedProxies in interface GridRegistryList of all of the proxies/nodes which are in useGridRegistry.getUsedProxies()public TestSession getSession(ExternalSessionKey externalKey)
GridRegistrygetSession in interface GridRegistryexternalKey - the external session keyGridRegistry.getSession(ExternalSessionKey)public TestSession getExistingSession(ExternalSessionKey externalKey)
GridRegistrygetExistingSession in interface GridRegistryexternalKey - the external session keyGridRegistry.getExistingSession(ExternalSessionKey)public int getNewSessionRequestCount()
getNewSessionRequestCount in interface GridRegistryGridRegistry.getNewSessionRequestCount()public void clearNewSessionRequests()
GridRegistryclearNewSessionRequests in interface GridRegistryGridRegistry.clearNewSessionRequests()public boolean removeNewSessionRequest(RequestHandler request)
GridRegistryremoveNewSessionRequest in interface GridRegistryrequest - the RequestHandlerGridRegistry.removeNewSessionRequest(RequestHandler)public java.lang.Iterable<org.openqa.selenium.remote.DesiredCapabilities> getDesiredCapabilities()
getDesiredCapabilities in interface GridRegistryDesiredCapabilities in the new session queueGridRegistry.getDesiredCapabilities()public java.util.Set<TestSession> getActiveSessions()
getActiveSessions in interface GridRegistrySet of active TestSessionsGridRegistry.getActiveSessions()public RemoteProxy getProxyById(java.lang.String id)
GridRegistryRemoteProxy using the id providedgetProxyById in interface GridRegistryid - the string identifierRemoteProxyGridRegistry.getProxyById(String)