|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openqa.grid.web.servlet.handler.RequestHandler
public class RequestHandler
Base stuff to handle the request coming from a remote. Threading notes; RequestHandlers are instantiated per-request, run on the servlet container thread. The instance is also accessed by the matcher thread.
Constructor Summary | |
---|---|
RequestHandler(SeleniumBasedRequest request,
javax.servlet.http.HttpServletResponse response,
Registry registry)
|
Method Summary | |
---|---|
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 hanlder 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 fro mthe 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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RequestHandler(SeleniumBasedRequest request, javax.servlet.http.HttpServletResponse response, Registry registry)
Method Detail |
---|
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 toString()
toString
in class Object
public String debug()
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public Registry getRegistry()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |