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