KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jivesoftware > messenger > XMPPBootServlet


1 /**
2  * $RCSfile: XMPPBootServlet.java,v $
3  * $Revision: 1.5 $
4  * $Date: 2005/07/29 22:55:59 $
5  *
6  * Copyright (C) 2004 Jive Software. All rights reserved.
7  *
8  * This software is published under the terms of the GNU Public License (GPL),
9  * a copy of which is included in this distribution.
10  */

11
12 package org.jivesoftware.messenger;
13
14 import javax.servlet.ServletConfig JavaDoc;
15 import javax.servlet.ServletException JavaDoc;
16 import javax.servlet.ServletRequest JavaDoc;
17 import javax.servlet.ServletResponse JavaDoc;
18 import javax.servlet.http.HttpServlet JavaDoc;
19
20 public class XMPPBootServlet extends HttpServlet JavaDoc {
21
22     private XMPPServer server;
23     private Object JavaDoc serverLock = new Object JavaDoc();
24
25     public void init(ServletConfig JavaDoc servletConfig) throws ServletException JavaDoc {
26         synchronized (serverLock) {
27             // only start up if it hasn't already...
28
if (XMPPServer.getInstance() == null) {
29                 if (server == null) {
30                     server = new XMPPServer();
31                 }
32             }
33         }
34     }
35
36     public void service(ServletRequest JavaDoc servletRequest, ServletResponse JavaDoc servletResponse) throws ServletException JavaDoc {
37         // does nothing
38
}
39 }
40
Popular Tags