01: package org.jbpm.web;
02:
03: import javax.servlet.ServletException;
04: import javax.servlet.http.HttpServlet;
05:
06: import org.jbpm.JbpmConfiguration;
07:
08: public class CloseJbpmConfigurationServlet extends HttpServlet {
09:
10: private static final long serialVersionUID = 1L;
11:
12: String configurationName;
13:
14: public void init() throws ServletException {
15: configurationName = getInitParameter(
16: "jbpm.configuration.resource", null);
17: }
18:
19: public void destroy() {
20: JbpmConfiguration jbpmConfiguration = JbpmConfiguration
21: .getInstance(configurationName);
22: jbpmConfiguration.close();
23: }
24:
25: String getInitParameter(String name, String defaultValue) {
26: String value = getInitParameter(name);
27: if (value != null) {
28: return value;
29: }
30: return defaultValue;
31: }
32: }
|