Mercurial Hosting > luan
annotate src/org/eclipse/jetty/server/Server.java @ 812:700317ba03ad
remove SessionIdManager
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 08 Sep 2016 21:44:37 -0600 |
parents | 3428c60d7cfc |
children | 8e9db0bbf4f9 |
rev | line source |
---|---|
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
1 // |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
2 // ======================================================================== |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
3 // Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd. |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
4 // ------------------------------------------------------------------------ |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
5 // All rights reserved. This program and the accompanying materials |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
6 // are made available under the terms of the Eclipse Public License v1.0 |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
7 // and Apache License v2.0 which accompanies this distribution. |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
8 // |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
9 // The Eclipse Public License is available at |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
10 // http://www.eclipse.org/legal/epl-v10.html |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
11 // |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
12 // The Apache License v2.0 is available at |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
13 // http://www.opensource.org/licenses/apache2.0.php |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
14 // |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
15 // You may elect to redistribute this code under either of these licenses. |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
16 // ======================================================================== |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
17 // |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
18 |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
19 package org.eclipse.jetty.server; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
20 |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
21 import java.io.IOException; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
22 import java.net.InetSocketAddress; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
23 import java.util.Enumeration; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
24 |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
25 import javax.servlet.AsyncContext; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
26 import javax.servlet.ServletException; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
27 import javax.servlet.http.HttpServletRequest; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
28 import javax.servlet.http.HttpServletResponse; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
29 |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
30 import org.eclipse.jetty.http.HttpGenerator; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
31 import org.eclipse.jetty.http.HttpURI; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
32 import org.eclipse.jetty.server.handler.HandlerWrapper; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
33 import org.eclipse.jetty.server.nio.SelectChannelConnector; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
34 import org.eclipse.jetty.util.Attributes; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
35 import org.eclipse.jetty.util.AttributesMap; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
36 import org.eclipse.jetty.util.LazyList; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
37 import org.eclipse.jetty.util.MultiException; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
38 import org.eclipse.jetty.util.TypeUtil; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
39 import org.eclipse.jetty.util.URIUtil; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
40 import org.eclipse.jetty.util.component.Container; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
41 import org.eclipse.jetty.util.component.Destroyable; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
42 import org.eclipse.jetty.util.component.LifeCycle; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
43 import org.eclipse.jetty.util.log.Log; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
44 import org.eclipse.jetty.util.log.Logger; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
45 import org.eclipse.jetty.util.thread.QueuedThreadPool; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
46 import org.eclipse.jetty.util.thread.ShutdownThread; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
47 import org.eclipse.jetty.util.thread.ThreadPool; |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
48 |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
49 /* ------------------------------------------------------------ */ |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
50 /** Jetty HTTP Servlet Server. |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
51 * This class is the main class for the Jetty HTTP Servlet server. |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
52 * It aggregates Connectors (HTTP request receivers) and request Handlers. |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
53 * The server is itself a handler and a ThreadPool. Connectors use the ThreadPool methods |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
54 * to run jobs that will eventually call the handle method. |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
55 * |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
56 * @org.apache.xbean.XBean description="Creates an embedded Jetty web server" |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
57 */ |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
58 public class Server extends HandlerWrapper implements Attributes |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
59 { |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
60 private static final Logger LOG = Log.getLogger(Server.class); |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
61 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
62 private static final String __version; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
63 static |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
64 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
65 if (Server.class.getPackage()!=null && |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
66 "Eclipse.org - Jetty".equals(Server.class.getPackage().getImplementationVendor()) && |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
67 Server.class.getPackage().getImplementationVersion()!=null) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
68 __version=Server.class.getPackage().getImplementationVersion(); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
69 else |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
70 __version=System.getProperty("jetty.version","8.y.z-SNAPSHOT"); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
71 } |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
72 |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
73 private final Container _container=new Container(); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
74 private final AttributesMap _attributes = new AttributesMap(); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
75 private ThreadPool _threadPool; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
76 private Connector[] _connectors; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
77 private boolean _sendServerVersion = true; //send Server: header |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
78 private boolean _sendDateHeader = false; //send Date: header |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
79 private int _graceful=0; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
80 private boolean _stopAtShutdown; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
81 private boolean _dumpAfterStart=false; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
82 private boolean _dumpBeforeStop=false; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
83 private boolean _uncheckedPrintWriter=false; |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
84 |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
85 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
86 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
87 public Server() |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
88 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
89 setServer(this); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
90 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
91 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
92 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
93 /** Convenience constructor |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
94 * Creates server and a {@link SelectChannelConnector} at the passed port. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
95 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
96 public Server(int port) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
97 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
98 setServer(this); |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
99 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
100 Connector connector=new SelectChannelConnector(); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
101 connector.setPort(port); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
102 setConnectors(new Connector[]{connector}); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
103 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
104 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
105 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
106 /** Convenience constructor |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
107 * Creates server and a {@link SelectChannelConnector} at the passed address. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
108 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
109 public Server(InetSocketAddress addr) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
110 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
111 setServer(this); |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
112 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
113 Connector connector=new SelectChannelConnector(); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
114 connector.setHost(addr.getHostName()); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
115 connector.setPort(addr.getPort()); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
116 setConnectors(new Connector[]{connector}); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
117 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
118 |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
119 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
120 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
121 public static String getVersion() |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
122 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
123 return __version; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
124 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
125 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
126 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
127 /** |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
128 * @return Returns the container. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
129 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
130 public Container getContainer() |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
131 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
132 return _container; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
133 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
134 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
135 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
136 public boolean getStopAtShutdown() |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
137 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
138 return _stopAtShutdown; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
139 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
140 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
141 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
142 public void setStopAtShutdown(boolean stop) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
143 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
144 //if we now want to stop |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
145 if (stop) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
146 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
147 //and we weren't stopping before |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
148 if (!_stopAtShutdown) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
149 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
150 //only register to stop if we're already started (otherwise we'll do it in doStart()) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
151 if (isStarted()) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
152 ShutdownThread.register(this); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
153 } |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
154 } |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
155 else |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
156 ShutdownThread.deregister(this); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
157 |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
158 _stopAtShutdown=stop; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
159 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
160 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
161 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
162 /** |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
163 * @return Returns the connectors. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
164 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
165 public Connector[] getConnectors() |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
166 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
167 return _connectors; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
168 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
169 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
170 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
171 public void addConnector(Connector connector) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
172 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
173 setConnectors((Connector[])LazyList.addToArray(getConnectors(), connector, Connector.class)); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
174 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
175 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
176 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
177 /** |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
178 * Conveniance method which calls {@link #getConnectors()} and {@link #setConnectors(Connector[])} to |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
179 * remove a connector. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
180 * @param connector The connector to remove. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
181 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
182 public void removeConnector(Connector connector) { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
183 setConnectors((Connector[])LazyList.removeFromArray (getConnectors(), connector)); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
184 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
185 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
186 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
187 /** Set the connectors for this server. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
188 * Each connector has this server set as it's ThreadPool and its Handler. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
189 * @param connectors The connectors to set. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
190 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
191 public void setConnectors(Connector[] connectors) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
192 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
193 if (connectors!=null) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
194 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
195 for (int i=0;i<connectors.length;i++) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
196 connectors[i].setServer(this); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
197 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
198 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
199 _container.update(this, _connectors, connectors, "connector"); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
200 _connectors = connectors; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
201 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
202 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
203 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
204 /** |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
205 * @return Returns the threadPool. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
206 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
207 public ThreadPool getThreadPool() |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
208 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
209 return _threadPool; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
210 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
211 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
212 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
213 /** |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
214 * @param threadPool The threadPool to set. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
215 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
216 public void setThreadPool(ThreadPool threadPool) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
217 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
218 if (_threadPool!=null) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
219 removeBean(_threadPool); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
220 _container.update(this, _threadPool, threadPool, "threadpool",false); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
221 _threadPool = threadPool; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
222 if (_threadPool!=null) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
223 addBean(_threadPool); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
224 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
225 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
226 /** |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
227 * @return true if {@link #dumpStdErr()} is called after starting |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
228 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
229 public boolean isDumpAfterStart() |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
230 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
231 return _dumpAfterStart; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
232 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
233 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
234 /** |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
235 * @param dumpAfterStart true if {@link #dumpStdErr()} is called after starting |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
236 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
237 public void setDumpAfterStart(boolean dumpAfterStart) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
238 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
239 _dumpAfterStart = dumpAfterStart; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
240 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
241 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
242 /** |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
243 * @return true if {@link #dumpStdErr()} is called before stopping |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
244 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
245 public boolean isDumpBeforeStop() |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
246 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
247 return _dumpBeforeStop; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
248 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
249 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
250 /** |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
251 * @param dumpBeforeStop true if {@link #dumpStdErr()} is called before stopping |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
252 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
253 public void setDumpBeforeStop(boolean dumpBeforeStop) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
254 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
255 _dumpBeforeStop = dumpBeforeStop; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
256 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
257 |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
258 |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
259 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
260 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
261 @Override |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
262 protected void doStart() throws Exception |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
263 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
264 if (getStopAtShutdown()) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
265 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
266 ShutdownThread.register(this); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
267 } |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
268 |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
269 ShutdownMonitor.getInstance().start(); // initialize |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
270 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
271 LOG.info("jetty-"+__version); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
272 HttpGenerator.setServerVersion(__version); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
273 |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
274 MultiException mex=new MultiException(); |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
275 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
276 if (_threadPool==null) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
277 setThreadPool(new QueuedThreadPool()); |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
278 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
279 try |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
280 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
281 super.doStart(); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
282 } |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
283 catch(Throwable e) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
284 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
285 mex.add(e); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
286 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
287 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
288 if (_connectors!=null && mex.size()==0) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
289 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
290 for (int i=0;i<_connectors.length;i++) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
291 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
292 try{_connectors[i].start();} |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
293 catch(Throwable e) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
294 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
295 mex.add(e); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
296 } |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
297 } |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
298 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
299 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
300 if (isDumpAfterStart()) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
301 dumpStdErr(); |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
302 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
303 mex.ifExceptionThrow(); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
304 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
305 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
306 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
307 @Override |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
308 protected void doStop() throws Exception |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
309 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
310 if (isDumpBeforeStop()) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
311 dumpStdErr(); |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
312 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
313 MultiException mex=new MultiException(); |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
314 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
315 if (_graceful>0) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
316 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
317 if (_connectors!=null) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
318 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
319 for (int i=_connectors.length;i-->0;) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
320 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
321 LOG.info("Graceful shutdown {}",_connectors[i]); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
322 try{_connectors[i].close();}catch(Throwable e){mex.add(e);} |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
323 } |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
324 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
325 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
326 Handler[] contexts = getChildHandlersByClass(Graceful.class); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
327 for (int c=0;c<contexts.length;c++) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
328 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
329 Graceful context=(Graceful)contexts[c]; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
330 LOG.info("Graceful shutdown {}",context); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
331 context.setShutdown(true); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
332 } |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
333 Thread.sleep(_graceful); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
334 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
335 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
336 if (_connectors!=null) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
337 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
338 for (int i=_connectors.length;i-->0;) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
339 try{_connectors[i].stop();}catch(Throwable e){mex.add(e);} |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
340 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
341 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
342 try {super.doStop(); } catch(Throwable e) { mex.add(e);} |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
343 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
344 mex.ifExceptionThrow(); |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
345 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
346 if (getStopAtShutdown()) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
347 ShutdownThread.deregister(this); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
348 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
349 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
350 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
351 /* Handle a request from a connection. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
352 * Called to handle a request on the connection when either the header has been received, |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
353 * or after the entire request has been received (for short requests of known length), or |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
354 * on the dispatch of an async request. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
355 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
356 public void handle(AbstractHttpConnection connection) throws IOException, ServletException |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
357 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
358 final String target=connection.getRequest().getPathInfo(); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
359 final Request request=connection.getRequest(); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
360 final Response response=connection.getResponse(); |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
361 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
362 if (LOG.isDebugEnabled()) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
363 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
364 LOG.debug("REQUEST "+target+" on "+connection); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
365 handle(target, request, request, response); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
366 LOG.debug("RESPONSE "+target+" "+connection.getResponse().getStatus()+" handled="+request.isHandled()); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
367 } |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
368 else |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
369 handle(target, request, request, response); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
370 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
371 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
372 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
373 /* Handle a request from a connection. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
374 * Called to handle a request on the connection when either the header has been received, |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
375 * or after the entire request has been received (for short requests of known length), or |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
376 * on the dispatch of an async request. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
377 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
378 public void handleAsync(AbstractHttpConnection connection) throws IOException, ServletException |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
379 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
380 final AsyncContinuation async = connection.getRequest().getAsyncContinuation(); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
381 final AsyncContinuation.AsyncEventState state = async.getAsyncEventState(); |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
382 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
383 final Request baseRequest=connection.getRequest(); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
384 final String path=state.getPath(); |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
385 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
386 if (path!=null) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
387 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
388 // this is a dispatch with a path |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
389 final String contextPath=state.getServletContext().getContextPath(); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
390 HttpURI uri = new HttpURI(URIUtil.addPaths(contextPath,path)); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
391 baseRequest.setUri(uri); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
392 baseRequest.setRequestURI(null); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
393 baseRequest.setPathInfo(baseRequest.getRequestURI()); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
394 if (uri.getQuery()!=null) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
395 baseRequest.mergeQueryString(uri.getQuery()); //we have to assume dispatch path and query are UTF8 |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
396 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
397 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
398 final String target=baseRequest.getPathInfo(); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
399 final HttpServletRequest request=(HttpServletRequest)async.getRequest(); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
400 final HttpServletResponse response=(HttpServletResponse)async.getResponse(); |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
401 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
402 if (LOG.isDebugEnabled()) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
403 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
404 LOG.debug("REQUEST "+target+" on "+connection); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
405 handle(target, baseRequest, request, response); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
406 LOG.debug("RESPONSE "+target+" "+connection.getResponse().getStatus()); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
407 } |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
408 else |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
409 handle(target, baseRequest, request, response); |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
410 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
411 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
412 |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
413 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
414 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
415 public void join() throws InterruptedException |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
416 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
417 getThreadPool().join(); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
418 } |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
419 |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
420 /* ------------------------------------------------------------ */ |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
421 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
422 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
423 public void setSendServerVersion (boolean sendServerVersion) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
424 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
425 _sendServerVersion = sendServerVersion; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
426 } |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
427 |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
428 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
429 public boolean getSendServerVersion() |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
430 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
431 return _sendServerVersion; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
432 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
433 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
434 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
435 /** |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
436 * @param sendDateHeader |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
437 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
438 public void setSendDateHeader(boolean sendDateHeader) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
439 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
440 _sendDateHeader = sendDateHeader; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
441 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
442 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
443 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
444 public boolean getSendDateHeader() |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
445 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
446 return _sendDateHeader; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
447 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
448 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
449 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
450 /** |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
451 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
452 @Deprecated |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
453 public int getMaxCookieVersion() |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
454 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
455 return 1; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
456 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
457 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
458 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
459 /** |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
460 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
461 @Deprecated |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
462 public void setMaxCookieVersion(int maxCookieVersion) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
463 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
464 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
465 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
466 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
467 /** |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
468 * Add a LifeCycle object to be started/stopped |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
469 * along with the Server. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
470 * @deprecated Use {@link #addBean(Object)} |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
471 * @param c |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
472 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
473 @Deprecated |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
474 public void addLifeCycle (LifeCycle c) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
475 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
476 addBean(c); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
477 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
478 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
479 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
480 /** |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
481 * Add an associated bean. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
482 * The bean will be added to the servers {@link Container} |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
483 * and if it is a {@link LifeCycle} instance, it will be |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
484 * started/stopped along with the Server. Any beans that are also |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
485 * {@link Destroyable}, will be destroyed with the server. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
486 * @param o the bean object to add |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
487 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
488 @Override |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
489 public boolean addBean(Object o) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
490 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
491 if (super.addBean(o)) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
492 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
493 _container.addBean(o); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
494 return true; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
495 } |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
496 return false; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
497 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
498 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
499 /** |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
500 * Remove a LifeCycle object to be started/stopped |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
501 * along with the Server |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
502 * @deprecated Use {@link #removeBean(Object)} |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
503 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
504 @Deprecated |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
505 public void removeLifeCycle (LifeCycle c) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
506 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
507 removeBean(c); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
508 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
509 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
510 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
511 /** |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
512 * Remove an associated bean. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
513 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
514 @Override |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
515 public boolean removeBean (Object o) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
516 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
517 if (super.removeBean(o)) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
518 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
519 _container.removeBean(o); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
520 return true; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
521 } |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
522 return false; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
523 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
524 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
525 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
526 /* |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
527 * @see org.eclipse.util.AttributesMap#clearAttributes() |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
528 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
529 public void clearAttributes() |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
530 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
531 _attributes.clearAttributes(); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
532 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
533 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
534 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
535 /* |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
536 * @see org.eclipse.util.AttributesMap#getAttribute(java.lang.String) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
537 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
538 public Object getAttribute(String name) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
539 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
540 return _attributes.getAttribute(name); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
541 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
542 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
543 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
544 /* |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
545 * @see org.eclipse.util.AttributesMap#getAttributeNames() |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
546 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
547 public Enumeration getAttributeNames() |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
548 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
549 return AttributesMap.getAttributeNamesCopy(_attributes); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
550 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
551 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
552 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
553 /* |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
554 * @see org.eclipse.util.AttributesMap#removeAttribute(java.lang.String) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
555 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
556 public void removeAttribute(String name) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
557 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
558 _attributes.removeAttribute(name); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
559 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
560 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
561 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
562 /* |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
563 * @see org.eclipse.util.AttributesMap#setAttribute(java.lang.String, java.lang.Object) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
564 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
565 public void setAttribute(String name, Object attribute) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
566 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
567 _attributes.setAttribute(name, attribute); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
568 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
569 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
570 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
571 /** |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
572 * @return the graceful |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
573 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
574 public int getGracefulShutdown() |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
575 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
576 return _graceful; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
577 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
578 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
579 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
580 /** |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
581 * Set graceful shutdown timeout. If set, the internal <code>doStop()</code> method will not immediately stop the |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
582 * server. Instead, all {@link Connector}s will be closed so that new connections will not be accepted |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
583 * and all handlers that implement {@link Graceful} will be put into the shutdown mode so that no new requests |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
584 * will be accepted, but existing requests can complete. The server will then wait the configured timeout |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
585 * before stopping. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
586 * @param timeoutMS the milliseconds to wait for existing request to complete before stopping the server. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
587 * |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
588 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
589 public void setGracefulShutdown(int timeoutMS) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
590 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
591 _graceful=timeoutMS; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
592 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
593 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
594 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
595 @Override |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
596 public String toString() |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
597 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
598 return this.getClass().getName()+"@"+Integer.toHexString(hashCode()); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
599 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
600 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
601 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
602 @Override |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
603 public void dump(Appendable out,String indent) throws IOException |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
604 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
605 dumpThis(out); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
606 dump(out,indent,TypeUtil.asList(getHandlers()),getBeans(),TypeUtil.asList(_connectors)); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
607 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
608 |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
609 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
610 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
611 public boolean isUncheckedPrintWriter() |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
612 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
613 return _uncheckedPrintWriter; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
614 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
615 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
616 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
617 public void setUncheckedPrintWriter(boolean unchecked) |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
618 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
619 _uncheckedPrintWriter=unchecked; |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
620 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
621 |
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
622 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
623 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
624 /* A handler that can be gracefully shutdown. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
625 * Called by doStop if a {@link #setGracefulShutdown} period is set. |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
626 * TODO move this somewhere better |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
627 */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
628 public interface Graceful extends Handler |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
629 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
630 public void setShutdown(boolean shutdown); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
631 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
632 |
812
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
633 /* ------------------------------------------------------------ */ |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
634 public static void main(String...args) throws Exception |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
635 { |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
636 System.err.println(getVersion()); |
700317ba03ad
remove SessionIdManager
Franklin Schmidt <fschmidt@gmail.com>
parents:
802
diff
changeset
|
637 } |
802
3428c60d7cfc
replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff
changeset
|
638 } |