public class RequestHandler extends java.lang.Object implements java.lang.Comparable<RequestHandler>
Constructor and Description |
---|
RequestHandler(SeleniumBasedRequest request,
javax.servlet.http.HttpServletResponse response,
GridRegistry registry) |
Modifier and Type | Method and Description |
---|---|
void |
bindSession(TestSession session) |
int |
compareTo(RequestHandler o) |
java.lang.String |
debug() |
boolean |
equals(java.lang.Object obj) |
void |
forwardNewSessionRequestAndUpdateRegistry(TestSession session)
Forward the new session request to the TestSession that has been assigned, and parse the
response to extract and return the external key assigned by the remote.
|
protected void |
forwardRequest(TestSession session,
RequestHandler handler) |
GridRegistry |
getRegistry() |
SeleniumBasedRequest |
getRequest() |
javax.servlet.http.HttpServletResponse |
getResponse() |
ExternalSessionKey |
getServerSession() |
TestSession |
getSession() |
int |
hashCode() |
void |
process()
forwards the request to the remote, allocating / releasing the resources if necessary.
|
protected void |
setSession(TestSession session) |
void |
stop() |
java.lang.String |
toString() |
void |
waitForSessionBound()
wait for the registry to match the request with a TestSlot.
|
public RequestHandler(SeleniumBasedRequest request, javax.servlet.http.HttpServletResponse response, GridRegistry registry)
public void forwardNewSessionRequestAndUpdateRegistry(TestSession session) throws NewSessionException
session
- sessionNewSessionException
- in case anything wrong happens during the new session process.protected void forwardRequest(TestSession session, RequestHandler handler) throws java.io.IOException
java.io.IOException
public void process()
public void waitForSessionBound() throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
java.lang.InterruptedException
- Interrupted exceptionjava.util.concurrent.TimeoutException
- if the request reaches the new session wait timeout before being
assigned.public SeleniumBasedRequest getRequest()
public javax.servlet.http.HttpServletResponse getResponse()
public int compareTo(RequestHandler o)
compareTo
in interface java.lang.Comparable<RequestHandler>
protected void setSession(TestSession session)
public void bindSession(TestSession session)
public TestSession getSession()
public ExternalSessionKey getServerSession()
public void stop()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String debug()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public GridRegistry getRegistry()