Mercurial Hosting > luan
comparison src/org/eclipse/jetty/server/Server.java @ 987:af8742d31bca
remove Server._attributes
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Mon, 17 Oct 2016 04:59:15 -0600 |
| parents | 53b3f7d9714c |
| children | 688c39c50ee3 |
comparison
equal
deleted
inserted
replaced
| 986:4f2d04c72781 | 987:af8742d31bca |
|---|---|
| 34 | 34 |
| 35 import org.eclipse.jetty.http.HttpURI; | 35 import org.eclipse.jetty.http.HttpURI; |
| 36 import org.eclipse.jetty.server.handler.HandlerWrapper; | 36 import org.eclipse.jetty.server.handler.HandlerWrapper; |
| 37 import org.eclipse.jetty.server.nio.BlockingChannelConnector; | 37 import org.eclipse.jetty.server.nio.BlockingChannelConnector; |
| 38 import org.eclipse.jetty.server.nio.SelectChannelConnector; | 38 import org.eclipse.jetty.server.nio.SelectChannelConnector; |
| 39 import org.eclipse.jetty.util.Attributes; | |
| 40 import org.eclipse.jetty.util.AttributesMap; | |
| 41 import org.eclipse.jetty.util.LazyList; | 39 import org.eclipse.jetty.util.LazyList; |
| 42 import org.eclipse.jetty.util.MultiException; | 40 import org.eclipse.jetty.util.MultiException; |
| 43 import org.eclipse.jetty.util.TypeUtil; | 41 import org.eclipse.jetty.util.TypeUtil; |
| 44 import org.eclipse.jetty.util.URIUtil; | 42 import org.eclipse.jetty.util.URIUtil; |
| 45 import org.eclipse.jetty.util.component.Destroyable; | 43 import org.eclipse.jetty.util.component.Destroyable; |
| 54 * The server is itself a handler and a ThreadPool. Connectors use the ThreadPool methods | 52 * The server is itself a handler and a ThreadPool. Connectors use the ThreadPool methods |
| 55 * to run jobs that will eventually call the handle method. | 53 * to run jobs that will eventually call the handle method. |
| 56 * | 54 * |
| 57 * @org.apache.xbean.XBean description="Creates an embedded Jetty web server" | 55 * @org.apache.xbean.XBean description="Creates an embedded Jetty web server" |
| 58 */ | 56 */ |
| 59 public class Server extends HandlerWrapper implements Attributes | 57 public final class Server extends HandlerWrapper |
| 60 { | 58 { |
| 61 private static final Logger LOG = LoggerFactory.getLogger(Server.class); | 59 private static final Logger LOG = LoggerFactory.getLogger(Server.class); |
| 62 | 60 |
| 63 public static final String version = "8"; | 61 public static final String version = "8"; |
| 64 | 62 |
| 65 private final AttributesMap _attributes = new AttributesMap(); | |
| 66 public final ThreadPoolExecutor threadPool = new ThreadPoolExecutor(256, 256, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>()); | 63 public final ThreadPoolExecutor threadPool = new ThreadPoolExecutor(256, 256, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>()); |
| 67 final List<Connector> connectors = new ArrayList<Connector>(); | 64 final List<Connector> connectors = new ArrayList<Connector>(); |
| 68 | 65 |
| 69 | 66 |
| 70 public Server() { | 67 public Server() { |
| 162 public void join() throws InterruptedException | 159 public void join() throws InterruptedException |
| 163 { | 160 { |
| 164 threadPool.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS); | 161 threadPool.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS); |
| 165 } | 162 } |
| 166 | 163 |
| 167 /* ------------------------------------------------------------ */ | |
| 168 /* | |
| 169 * @see org.eclipse.util.AttributesMap#clearAttributes() | |
| 170 */ | |
| 171 public void clearAttributes() | |
| 172 { | |
| 173 _attributes.clearAttributes(); | |
| 174 } | |
| 175 | |
| 176 /* ------------------------------------------------------------ */ | |
| 177 /* | |
| 178 * @see org.eclipse.util.AttributesMap#getAttribute(java.lang.String) | |
| 179 */ | |
| 180 public Object getAttribute(String name) | |
| 181 { | |
| 182 return _attributes.getAttribute(name); | |
| 183 } | |
| 184 | |
| 185 /* ------------------------------------------------------------ */ | |
| 186 /* | |
| 187 * @see org.eclipse.util.AttributesMap#getAttributeNames() | |
| 188 */ | |
| 189 public Enumeration getAttributeNames() | |
| 190 { | |
| 191 return AttributesMap.getAttributeNamesCopy(_attributes); | |
| 192 } | |
| 193 | |
| 194 /* ------------------------------------------------------------ */ | |
| 195 /* | |
| 196 * @see org.eclipse.util.AttributesMap#removeAttribute(java.lang.String) | |
| 197 */ | |
| 198 public void removeAttribute(String name) | |
| 199 { | |
| 200 _attributes.removeAttribute(name); | |
| 201 } | |
| 202 | |
| 203 /* ------------------------------------------------------------ */ | |
| 204 /* | |
| 205 * @see org.eclipse.util.AttributesMap#setAttribute(java.lang.String, java.lang.Object) | |
| 206 */ | |
| 207 public void setAttribute(String name, Object attribute) | |
| 208 { | |
| 209 _attributes.setAttribute(name, attribute); | |
| 210 } | |
| 211 | |
| 212 /* ------------------------------------------------------------ */ | |
| 213 @Override | 164 @Override |
| 214 public String toString() | 165 public String toString() |
| 215 { | 166 { |
| 216 return this.getClass().getName()+"@"+Integer.toHexString(hashCode()); | 167 return this.getClass().getName()+"@"+Integer.toHexString(hashCode()); |
| 217 } | 168 } |
