Coverage Report - org.mule.config.builders.MuleXmlBuilderContextServlet
 
Classes in this File Line Coverage Branch Coverage Complexity
MuleXmlBuilderContextServlet
0%
0/14
0%
0/4
1.667
 
 1  
 /*
 2  
  * $Id: MuleXmlBuilderContextServlet.java 7963 2007-08-21 08:53:15Z dirk.olmes $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.config.builders;
 12  
 
 13  
 import java.io.IOException;
 14  
 
 15  
 import javax.servlet.ServletException;
 16  
 import javax.servlet.http.HttpServlet;
 17  
 import javax.servlet.http.HttpServletRequest;
 18  
 import javax.servlet.http.HttpServletResponse;
 19  
 
 20  0
 public class MuleXmlBuilderContextServlet extends HttpServlet
 21  
 {
 22  
     /**
 23  
      * Serial version
 24  
      */
 25  
     private static final long serialVersionUID = -2446689032349402434L;
 26  
 
 27  0
     private MuleXmlBuilderContextListener contextListener = null;
 28  
     
 29  
     public void init() throws ServletException
 30  
     {
 31  0
         if (contextListener != null)
 32  
         {
 33  0
             contextListener.destroy();
 34  0
             contextListener = null;
 35  
         }
 36  0
         contextListener = new MuleXmlBuilderContextListener();
 37  0
         contextListener.initialize(getServletContext());
 38  0
     }
 39  
 
 40  
     protected void service(HttpServletRequest request, HttpServletResponse response)
 41  
         throws ServletException, IOException
 42  
     {
 43  0
         getServletContext().log(
 44  
             "("
 45  
             + request.getRequestURI()
 46  
             + ")"
 47  
             + "MuleXmlBuilderContextServlet.service(HttpServletRequest request, HttpServletResponse response) call ignored.");
 48  0
         response.sendError(HttpServletResponse.SC_BAD_REQUEST);
 49  0
     }
 50  
 
 51  
     public void destroy()
 52  
     {
 53  0
         if (contextListener != null)
 54  
         {
 55  0
             contextListener.destroy();
 56  
         }
 57  0
     }
 58  
 }