~ubuntu-branches/ubuntu/trusty/tomcat7/trusty-security

« back to all changes in this revision

Viewing changes to java/org/apache/catalina/valves/CometConnectionManagerValve.java

  • Committer: Package Import Robot
  • Author(s): tony mancill
  • Date: 2012-06-07 22:43:21 UTC
  • mfrom: (11.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20120607224321-cfev8j681yueyov3
Tags: 7.0.27-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
 * <p>This Valve should be attached to a Context.</p>
49
49
 *
50
50
 * @author Remy Maucherat
51
 
 * @version $Id: CometConnectionManagerValve.java 1187022 2011-10-20 19:55:37Z markt $
 
51
 * @version $Id: CometConnectionManagerValve.java 1301272 2012-03-15 23:41:08Z markt $
52
52
 */
53
53
 
54
54
public class CometConnectionManagerValve extends ValveBase
73
73
    /**
74
74
     * List of current Comet connections.
75
75
     */
76
 
    protected List<Request> cometRequests =
 
76
    protected final List<Request> cometRequests =
77
77
        Collections.synchronizedList(new ArrayList<Request>());
78
78
 
79
79
 
80
80
    /**
81
81
     * Name of session attribute used to store list of comet connections.
82
82
     */
83
 
    protected String cometRequestsAttribute =
 
83
    protected final String cometRequestsAttribute =
84
84
        "org.apache.tomcat.comet.connectionList";
85
85
 
86
86
 
134
134
                    session.removeAttribute(cometRequestsAttribute);
135
135
                }
136
136
                // Close the comet connection
 
137
                CometEventImpl cometEvent = request.getEvent();
137
138
                try {
138
 
                    CometEventImpl cometEvent = request.getEvent();
139
139
                    cometEvent.setEventType(CometEvent.EventType.END);
140
140
                    cometEvent.setEventSubType(
141
141
                            CometEvent.EventSubType.WEBAPP_RELOAD);
142
142
                    getNext().event(request, request.getResponse(), cometEvent);
143
 
                    cometEvent.close();
144
143
                } catch (Exception e) {
145
144
                    container.getLogger().warn(
146
145
                            sm.getString("cometConnectionManagerValve.event"),
147
146
                            e);
 
147
                } finally {
 
148
                    try {
 
149
                        cometEvent.close();
 
150
                    } catch (IOException e) {
 
151
                        container.getLogger().warn(sm.getString(
 
152
                                "cometConnectionManagerValve.event"), e);
 
153
                    }
148
154
                }
149
155
            }
150
156
            cometRequests.clear();