KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openlaszlo > servlets > responders > ResponderDISCONNECT


1 /******************************************************************************
2  * ResponderDISCONNECT.java
3  * ****************************************************************************/

4
5 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
6 * Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
7 * Use is subject to license terms. *
8 * J_LZ_COPYRIGHT_END *********************************************************/

9
10 package org.openlaszlo.servlets.responders;
11
12 import java.io.*;
13 import java.util.*;
14 import javax.servlet.*;
15 import javax.servlet.http.*;
16 import org.openlaszlo.compiler.*;
17 import org.openlaszlo.connection.*;
18 import org.apache.log4j.*;
19
20 public final class ResponderDISCONNECT extends ResponderConnection
21 {
22     private static boolean mIsInitialized = false;
23     private static Object JavaDoc mIsInitializedLock = new Object JavaDoc();
24
25     private static Logger mLogger = Logger.getLogger(ResponderDISCONNECT.class);
26
27
28     protected void respondImpl(HttpServletRequest req, HttpServletResponse res,
29                                Application app, int serial, String JavaDoc username)
30         throws IOException
31     {
32         mLogger.debug("respondImpl(username=" + username + ")");
33
34         // Removes connection and unregisters itself from application through
35
// binding event listener
36
HTTPConnection connection = app.getConnection(req.getParameter("i"));
37         if (connection != null) {
38             connection.disconnect();
39             app.unregister(connection);
40         }
41
42         respondWithStatusSWF(res, HttpServletResponse.SC_OK,
43                              "disconnected", serial);
44     }
45 }
46
Popular Tags