Coverage Report - org.mule.config.builders.MuleXmlBuilderContextServlet
 
Classes in this File Line Coverage Branch Coverage Complexity
MuleXmlBuilderContextServlet
0%
0/13
0%
0/4
0
 
 1  
 /*
 2  
  * $Id: MuleXmlBuilderContextServlet.java 19391 2010-09-07 14:24:40Z dirk.olmes $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.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  
     private MuleXmlBuilderContextListener contextListener;
 28  
 
 29  
     @Override
 30  
     public void init() throws ServletException
 31  
     {
 32  0
         if (contextListener != null)
 33  
         {
 34  0
             contextListener.destroy();
 35  0
             contextListener = null;
 36  
         }
 37  0
         contextListener = new MuleXmlBuilderContextListener();
 38  0
         contextListener.initialize(getServletContext());
 39  0
     }
 40  
 
 41  
     @Override
 42  
     protected void service(HttpServletRequest request, HttpServletResponse response)
 43  
         throws ServletException, IOException
 44  
     {
 45  0
         getServletContext().log(
 46  
             "("
 47  
             + request.getRequestURI()
 48  
             + ")"
 49  
             + "MuleXmlBuilderContextServlet.service(HttpServletRequest request, HttpServletResponse response) call ignored.");
 50  0
         response.sendError(HttpServletResponse.SC_BAD_REQUEST);
 51  0
     }
 52  
 
 53  
     @Override
 54  
     public void destroy()
 55  
     {
 56  0
         if (contextListener != null)
 57  
         {
 58  0
             contextListener.destroy();
 59  
         }
 60  0
     }
 61  
 }