Reputation: 6832
More specifically, what's the difference between ServerConnector connector = new ServerConnector(server)
and server.addConnector(connector)
? Are they exclusive? Redundant?
Upvotes: 1
Views: 60
Reputation: 49525
One creates, one uses.
ServerConnector connector = new ServerConnector(server);
That creates a ServerConnector
, initialized from the state of the Server (various configuration, threadpools, schedulers, bufferpools, beans, etc) at that point in time.
server.addConnector(connector);
That uses the connector, by adding it to the server for bean and lifecycle management.
Upvotes: 1