org.jvnet.hudson.test
Class JavaNetReverseProxy

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.jvnet.hudson.test.JavaNetReverseProxy
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class JavaNetReverseProxy
extends javax.servlet.http.HttpServlet

Acts as a reverse proxy, so that during a test we can avoid hitting updates.jenkins-ci.org.

The contents are cached locally.

Author:
Kohsuke Kawaguchi
See Also:
Serialized Form

Field Summary
 int localPort
           
 
Constructor Summary
JavaNetReverseProxy(File cacheFolder)
           
 
Method Summary
static JavaNetReverseProxy getInstance()
          Gets the default instance.
protected  void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void stop()
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

localPort

public final int localPort
Constructor Detail

JavaNetReverseProxy

public JavaNetReverseProxy(File cacheFolder)
                    throws Exception
Throws:
Exception
Method Detail

stop

public void stop()
          throws Exception
Throws:
Exception

service

protected void service(javax.servlet.http.HttpServletRequest req,
                       javax.servlet.http.HttpServletResponse resp)
                throws javax.servlet.ServletException,
                       IOException
Overrides:
service in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException

getInstance

public static JavaNetReverseProxy getInstance()
                                       throws Exception
Gets the default instance.

Throws:
Exception


Copyright © 2004-2013. All Rights Reserved.