cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/servlet ParanoidCocoonServlet.java
Date Fri, 01 Aug 2003 12:45:05 GMT
cziegeler    2003/08/01 05:45:05

  Modified:    src/java/org/apache/cocoon/servlet
                        ParanoidCocoonServlet.java
  Log:
  Reset classloader
  
  Revision  Changes    Path
  1.6       +17 -7     cocoon-2.1/src/java/org/apache/cocoon/servlet/ParanoidCocoonServlet.java
  
  Index: ParanoidCocoonServlet.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/servlet/ParanoidCocoonServlet.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ParanoidCocoonServlet.java	9 Jul 2003 07:42:22 -0000	1.5
  +++ ParanoidCocoonServlet.java	1 Aug 2003 12:45:05 -0000	1.6
  @@ -125,10 +125,15 @@
           
   		// Always set the context classloader. JAXP uses it to find a ParserFactory,
   		// and thus fails if it's not set to the webapp classloader.
  -		Thread.currentThread().setContextClassLoader(this.classloader);
  +        final ClassLoader old = Thread.currentThread().getContextClassLoader();
  +        try {
  +            Thread.currentThread().setContextClassLoader(this.classloader);
           
  -		// Inlitialize the actual servlet
  -		this.initServlet();
  +            // Inlitialize the actual servlet
  +            this.initServlet();
  +        } finally {
  +            Thread.currentThread().setContextClassLoader(old);
  +        }
           
   	}
   	
  @@ -242,10 +247,15 @@
   	 * Service the request by delegating the call to the real servlet
   	 */
   	public void service(ServletRequest request, ServletResponse response)
  -	  throws ServletException, IOException {
  +    throws ServletException, IOException {
   
  -		Thread.currentThread().setContextClassLoader(this.classloader);
  -		this.servlet.service(request, response);
  +        final ClassLoader old = Thread.currentThread().getContextClassLoader();
  +        try {
  +		    Thread.currentThread().setContextClassLoader(this.classloader);
  +		    this.servlet.service(request, response);
  +        } finally {
  +            Thread.currentThread().setContextClassLoader(old);    
  +        }
   	}
       
   	/**
  
  
  

Mime
View raw message