public class WebProxy extends org.mortbay.jetty.handler.DefaultHandler implements URIResolverHandler
In particular, it handles the control of the Jetty server that the Proxy server builds on.
Modifier and Type | Class and Description |
---|---|
static class |
WebProxy.HttpRequest
A wrapper around the Jetty HttpRequest, giving the simple Request interface used in our URIResolvers.
|
static class |
WebProxy.HttpResponse
A wrapper around the Jetty HttpResponse, giving the simple Response interface used in our URIResolvers.
|
Constructor and Description |
---|
WebProxy(URIResolver uriResolver)
Initialises a new web proxy, which delegates lookups to the given uri resolver.
|
Modifier and Type | Method and Description |
---|---|
void |
handle(String target,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
int dispatch)
Handle an HTTP request.
|
void |
kill()
Shut down this server.
|
void |
setURIResolver(URIResolver ur)
Sets the current URIResolver.
|
destroy, doStart, doStop, getServer, setServer, toString
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
public WebProxy(URIResolver uriResolver)
uriResolver
- The uriResolver used to handle lookups in the proxy.IOFailure
- on trouble starting the proxy server.ArgumentNotValid
- on null uriResolver.public void setURIResolver(URIResolver ur)
setURIResolver
in interface URIResolverHandler
ur
- The resolver to handle lookups.ArgumentNotValid
- on null uriResolver.public void handle(String target, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, int dispatch)
Exceptions will generate an internal server error-page with the details.
handle
in interface org.mortbay.jetty.Handler
handle
in class org.mortbay.jetty.handler.DefaultHandler
target
- URL or name for request. Not usedrequest
- The original request, including URLresponse
- The object that receives the resultpublic void kill()
Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.