comparison src/org/eclipse/jetty/server/Server.java @ 887:df84a1741687

make Connector reference to server explicit
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 04 Oct 2016 23:59:56 -0600
parents 0d876a03ab0b
children 1d0c304e12b5
comparison
equal deleted inserted replaced
886:0d876a03ab0b 887:df84a1741687
60 private static final Logger LOG = LoggerFactory.getLogger(Server.class); 60 private static final Logger LOG = LoggerFactory.getLogger(Server.class);
61 61
62 public static final String version = "8"; 62 public static final String version = "8";
63 63
64 private final AttributesMap _attributes = new AttributesMap(); 64 private final AttributesMap _attributes = new AttributesMap();
65 public final ThreadPoolExecutor threadPool; 65 public final ThreadPoolExecutor threadPool = new ThreadPoolExecutor(256, 256, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
66 private final List<Connector> connectors = new ArrayList<Connector>(); 66 final List<Connector> connectors = new ArrayList<Connector>();
67 67
68 68
69 /* ------------------------------------------------------------ */ 69 public Server() {
70 /** Convenience constructor 70 setServer(this);
71 * Creates server and a {@link SelectChannelConnector} at the passed port. 71 }
72 */ 72
73 public Server(int port) 73 public Server(int port)
74 { 74 {
75 setServer(this); 75 setServer(this);
76 76 new SelectChannelConnector(this,port);
77 Connector connector = new SelectChannelConnector();
78 connector.setPort(port);
79 connector.setServer(this);
80 connectors.add(connector);
81
82 threadPool = new ThreadPoolExecutor(256, 256, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
83 }
84
85 // call before start
86 public void addConnector(Connector connector) {
87 connectors.add(connector);
88 } 77 }
89 78
90 /* ------------------------------------------------------------ */ 79 /* ------------------------------------------------------------ */
91 @Override 80 @Override
92 protected void doStart() throws Exception 81 protected void doStart() throws Exception