org.openqa.selenium.server
Class CachedContentTestHandler

java.lang.Object
  extended by org.openqa.selenium.server.CachedContentTestHandler
All Implemented Interfaces:
java.io.Serializable, HttpHandler, LifeCycle

public class CachedContentTestHandler
extends java.lang.Object
implements HttpHandler

This test handler is only needed for testing caching. It prints out the current time, but instructs the browser to cache the result.

See Also:
Serialized Form

Constructor Summary
CachedContentTestHandler()
           
 
Method Summary
 HttpContext getHttpContext()
           
 java.lang.String getName()
          Get the name of the handler.
 void handle(java.lang.String pathInContext, java.lang.String pathParams, HttpRequest httpRequest, HttpResponse res)
          Handle a request.
 void initialize(HttpContext c)
           
 boolean isStarted()
           
 void start()
          Start the LifeCycle.
 void stop()
          Stop the LifeCycle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedContentTestHandler

public CachedContentTestHandler()
Method Detail

handle

public void handle(java.lang.String pathInContext,
                   java.lang.String pathParams,
                   HttpRequest httpRequest,
                   HttpResponse res)
            throws HttpException,
                   java.io.IOException
Description copied from interface: HttpHandler
Handle a request. Note that Handlers are tried in order until one has handled the request. i.e. until request.isHandled() returns true. In broad terms this means, either a response has been commited or request.setHandled(true) has been called.

Specified by:
handle in interface HttpHandler
Parameters:
pathInContext - The context path
pathParams - Path parameters such as encoded Session ID
httpRequest - The HttpRequest request
res - The HttpResponse response
Throws:
HttpException
java.io.IOException

getName

public java.lang.String getName()
Description copied from interface: HttpHandler
Get the name of the handler.

Specified by:
getName in interface HttpHandler
Returns:
The name of the handler used for logging and reporting.

getHttpContext

public HttpContext getHttpContext()
Specified by:
getHttpContext in interface HttpHandler

initialize

public void initialize(HttpContext c)
Specified by:
initialize in interface HttpHandler

start

public void start()
           throws java.lang.Exception
Description copied from interface: LifeCycle
Start the LifeCycle.

Specified by:
start in interface LifeCycle
Throws:
java.lang.Exception - An arbitrary exception may be thrown.

stop

public void stop()
          throws java.lang.InterruptedException
Description copied from interface: LifeCycle
Stop the LifeCycle. The LifeCycle may wait for current activities to complete normally, but it can be interrupted.

Specified by:
stop in interface LifeCycle
Throws:
java.lang.InterruptedException - Stopping a lifecycle is rarely atomic and may be interrupted by another thread. If this happens InterruptedException is throw and the component will be in an indeterminant state and should probably be discarded.

isStarted

public boolean isStarted()
Specified by:
isStarted in interface LifeCycle
Returns:
True if the LifeCycle has been started.


Copyright © 2011. All Rights Reserved.