comparison src/org/eclipse/jetty/server/Server.java @ 848:22a4e93ed20e

remove Container
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 19 Sep 2016 16:38:36 -0600
parents 292f2e31ab41
children e21ca9878a10
comparison
equal deleted inserted replaced
847:5dfb10ec0ca5 848:22a4e93ed20e
34 import org.eclipse.jetty.util.AttributesMap; 34 import org.eclipse.jetty.util.AttributesMap;
35 import org.eclipse.jetty.util.LazyList; 35 import org.eclipse.jetty.util.LazyList;
36 import org.eclipse.jetty.util.MultiException; 36 import org.eclipse.jetty.util.MultiException;
37 import org.eclipse.jetty.util.TypeUtil; 37 import org.eclipse.jetty.util.TypeUtil;
38 import org.eclipse.jetty.util.URIUtil; 38 import org.eclipse.jetty.util.URIUtil;
39 import org.eclipse.jetty.util.component.Container;
40 import org.eclipse.jetty.util.component.Destroyable; 39 import org.eclipse.jetty.util.component.Destroyable;
41 import org.eclipse.jetty.util.component.LifeCycle; 40 import org.eclipse.jetty.util.component.LifeCycle;
42 import org.slf4j.Logger; 41 import org.slf4j.Logger;
43 import org.slf4j.LoggerFactory; 42 import org.slf4j.LoggerFactory;
44 import org.eclipse.jetty.util.thread.QueuedThreadPool; 43 import org.eclipse.jetty.util.thread.QueuedThreadPool;
67 __version=Server.class.getPackage().getImplementationVersion(); 66 __version=Server.class.getPackage().getImplementationVersion();
68 else 67 else
69 __version=System.getProperty("jetty.version","8.y.z-SNAPSHOT"); 68 __version=System.getProperty("jetty.version","8.y.z-SNAPSHOT");
70 } 69 }
71 70
72 private final Container _container=new Container();
73 private final AttributesMap _attributes = new AttributesMap(); 71 private final AttributesMap _attributes = new AttributesMap();
74 private ThreadPool _threadPool; 72 private ThreadPool _threadPool;
75 private Connector[] _connectors; 73 private Connector[] _connectors;
76 private boolean _sendServerVersion = true; //send Server: header 74 private boolean _sendServerVersion = true; //send Server: header
77 private boolean _sendDateHeader = false; //send Date: header 75 private boolean _sendDateHeader = false; //send Date: header
121 { 119 {
122 return __version; 120 return __version;
123 } 121 }
124 122
125 /* ------------------------------------------------------------ */ 123 /* ------------------------------------------------------------ */
126 /**
127 * @return Returns the container.
128 */
129 public Container getContainer()
130 {
131 return _container;
132 }
133
134 /* ------------------------------------------------------------ */
135 public boolean getStopAtShutdown() 124 public boolean getStopAtShutdown()
136 { 125 {
137 return _stopAtShutdown; 126 return _stopAtShutdown;
138 } 127 }
139 128
193 { 182 {
194 for (int i=0;i<connectors.length;i++) 183 for (int i=0;i<connectors.length;i++)
195 connectors[i].setServer(this); 184 connectors[i].setServer(this);
196 } 185 }
197 186
198 _container.update(this, _connectors, connectors, "connector");
199 _connectors = connectors; 187 _connectors = connectors;
200 } 188 }
201 189
202 /* ------------------------------------------------------------ */ 190 /* ------------------------------------------------------------ */
203 /** 191 /**
214 */ 202 */
215 public void setThreadPool(ThreadPool threadPool) 203 public void setThreadPool(ThreadPool threadPool)
216 { 204 {
217 if (_threadPool!=null) 205 if (_threadPool!=null)
218 removeBean(_threadPool); 206 removeBean(_threadPool);
219 _container.update(this, _threadPool, threadPool, "threadpool",false);
220 _threadPool = threadPool; 207 _threadPool = threadPool;
221 if (_threadPool!=null) 208 if (_threadPool!=null)
222 addBean(_threadPool); 209 addBean(_threadPool);
223 } 210 }
224 211
487 @Override 474 @Override
488 public boolean addBean(Object o) 475 public boolean addBean(Object o)
489 { 476 {
490 if (super.addBean(o)) 477 if (super.addBean(o))
491 { 478 {
492 _container.addBean(o);
493 return true; 479 return true;
494 } 480 }
495 return false; 481 return false;
496 } 482 }
497 483
513 @Override 499 @Override
514 public boolean removeBean (Object o) 500 public boolean removeBean (Object o)
515 { 501 {
516 if (super.removeBean(o)) 502 if (super.removeBean(o))
517 { 503 {
518 _container.removeBean(o);
519 return true; 504 return true;
520 } 505 }
521 return false; 506 return false;
522 } 507 }
523 508