01: /*
02: * $Id: MuleXmlBuilderContextServlet.java 8077 2007-08-27 20:15:25Z aperepel $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
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: * Serial version
23: */
24: private static final long serialVersionUID = -2446689032349402434L;
25:
26: private MuleXmlBuilderContextListener contextListener;
27:
28: public void init() throws ServletException {
29: if (contextListener != null) {
30: contextListener.destroy();
31: contextListener = null;
32: }
33: contextListener = new MuleXmlBuilderContextListener();
34: contextListener.initialize(getServletContext());
35: }
36:
37: protected void service(HttpServletRequest request,
38: HttpServletResponse response) throws ServletException,
39: IOException {
40: getServletContext()
41: .log(
42: "("
43: + request.getRequestURI()
44: + ")"
45: + "MuleXmlBuilderContextServlet.service(HttpServletRequest request, HttpServletResponse response) call ignored.");
46: response.sendError(HttpServletResponse.SC_BAD_REQUEST);
47: }
48:
49: public void destroy() {
50: if (contextListener != null) {
51: contextListener.destroy();
52: }
53: }
54: }
|