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 | 0 | 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 | 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 | |
} |