01: /******************************************************************************
02: * ResponderDISCONNECT.java
03: * ****************************************************************************/package org.openlaszlo.servlets.responders;
04:
05: import java.io.*;
06: import java.util.*;
07: import javax.servlet.*;
08: import javax.servlet.http.*;
09: import org.openlaszlo.compiler.*;
10: import org.openlaszlo.connection.*;
11: import org.apache.log4j.*;
12:
13: public final class ResponderDISCONNECT extends ResponderConnection {
14: private static boolean mIsInitialized = false;
15: private static Object mIsInitializedLock = new Object();
16:
17: private static Logger mLogger = Logger
18: .getLogger(ResponderDISCONNECT.class);
19:
20: protected void respondImpl(HttpServletRequest req,
21: HttpServletResponse res, Application app, int serial,
22: String username) throws IOException {
23: mLogger.debug(
24: /* (non-Javadoc)
25: * @i18n.test
26: * @org-mes="respondImpl(username=" + p[0] + ")"
27: */
28: org.openlaszlo.i18n.LaszloMessages.getMessage(
29: ResponderDISCONNECT.class.getName(), "051018-37",
30: new Object[] { username }));
31:
32: // Removes connection and unregisters itself from application through
33: // binding event listener
34: HTTPConnection connection = app.getConnection(req
35: .getParameter("i"));
36: if (connection != null) {
37: connection.disconnect();
38: app.unregister(connection);
39: }
40:
41: respondWithStatusSWF(res, HttpServletResponse.SC_OK,
42: "disconnected", serial);
43: }
44: }
|