1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.juddi.servlets;
17
18 import javax.servlet.ServletConfig;
19 import javax.servlet.ServletException;
20 import javax.servlet.http.HttpServlet;
21
22 import org.apache.commons.configuration.ConfigurationException;
23 import org.apache.commons.logging.Log;
24 import org.apache.commons.logging.LogFactory;
25 import org.apache.juddi.Registry;
26
27
28
29
30
31
32
33 public class RegistryServlet extends HttpServlet {
34
35 private static final long serialVersionUID = 4653310291840334765L;
36 private static Log logger = LogFactory.getLog(RegistryServlet.class);
37
38
39
40
41
42 @Override
43 public void init(ServletConfig config) throws ServletException {
44 super.init(config);
45 try {
46 Registry.start();
47 } catch (ConfigurationException e) {
48 logger.error("jUDDI registry could not be started."
49 + e.getMessage(), e);
50 throw new ServletException(e.getMessage(),e);
51 }
52 }
53
54 @Override
55 public void destroy() {
56 try {
57 Registry.stop();
58 } catch (ConfigurationException e) {
59 logger.error("jUDDI registry could not be stopped."
60 + e.getMessage(), e);
61 }
62 super.destroy();
63 }
64
65 }