public class RequestHandler extends Object implements Comparable<RequestHandler>
Constructor and Description |
---|
RequestHandler(SeleniumBasedRequest request,
javax.servlet.http.HttpServletResponse response,
Registry registry) |
Modifier and Type | Method and Description |
---|---|
void |
bindSession(TestSession session) |
int |
compareTo(RequestHandler o) |
String |
debug() |
boolean |
equals(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) |
Registry |
getRegistry() |
SeleniumBasedRequest |
getRequest()
the SeleniumBasedRequest this handler is processing.
|
javax.servlet.http.HttpServletResponse |
getResponse()
the HttpServletResponse the handler is writing to.
|
ExternalSessionKey |
getServerSession()
return the session from the server ( = opaque handle used by the server to determine where to
route session-specific commands from the JSON wire protocol ).
|
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() |
String |
toString() |
void |
waitForSessionBound()
wait for the registry to match the request with a TestSlot.
|
public RequestHandler(SeleniumBasedRequest request, javax.servlet.http.HttpServletResponse response, Registry registry)
public void forwardNewSessionRequestAndUpdateRegistry(TestSession session) throws NewSessionException
NewSessionException
- in case anything wrong happens during the new session process.protected void forwardRequest(TestSession session, RequestHandler handler) throws IOException
IOException
public void process()
public void waitForSessionBound() throws InterruptedException, TimeoutException
TimeoutException
- if the request reaches the new session wait timeout before being
assigned.InterruptedException
public SeleniumBasedRequest getRequest()
public javax.servlet.http.HttpServletResponse getResponse()
public int compareTo(RequestHandler o)
compareTo
in interface Comparable<RequestHandler>
protected void setSession(TestSession session)
public void bindSession(TestSession session)
public TestSession getSession()
public ExternalSessionKey getServerSession()
public void stop()
public String debug()
public Registry getRegistry()
Copyright © 2013. All Rights Reserved.