1
2
3
4
5
6
7
8
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 public class MuleXmlBuilderContextServlet extends HttpServlet
21 {
22
23
24
25 private static final long serialVersionUID = -2446689032349402434L;
26
27 private MuleXmlBuilderContextListener contextListener;
28
29 public void init() throws ServletException
30 {
31 if (contextListener != null)
32 {
33 contextListener.destroy();
34 contextListener = null;
35 }
36 contextListener = new MuleXmlBuilderContextListener();
37 contextListener.initialize(getServletContext());
38 }
39
40 protected void service(HttpServletRequest request, HttpServletResponse response)
41 throws ServletException, IOException
42 {
43 getServletContext().log(
44 "("
45 + request.getRequestURI()
46 + ")"
47 + "MuleXmlBuilderContextServlet.service(HttpServletRequest request, HttpServletResponse response) call ignored.");
48 response.sendError(HttpServletResponse.SC_BAD_REQUEST);
49 }
50
51 public void destroy()
52 {
53 if (contextListener != null)
54 {
55 contextListener.destroy();
56 }
57 }
58 }