MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / createHandlers

Method createHandlers

java/src/org/openqa/selenium/grid/commands/Hub.java:108–221  ·  view source on GitHub ↗
(Config config)

Source from the content-addressed store, hash-verified

106 }
107
108 @Override
109 protected Handlers createHandlers(Config config) {
110 LoggingOptions loggingOptions = new LoggingOptions(config);
111 Tracer tracer = loggingOptions.getTracer();
112
113 EventBusOptions events = new EventBusOptions(config);
114 EventBus bus = events.getEventBus();
115
116 CombinedHandler handler = new CombinedHandler();
117
118 LocalSessionMap sessions = new LocalSessionMap(tracer, bus);
119 handler.addHandler(sessions);
120
121 BaseServerOptions serverOptions = new BaseServerOptions(config);
122 SecretOptions secretOptions = new SecretOptions(config);
123 Secret secret = secretOptions.getRegistrationSecret();
124
125 URL externalUrl;
126 try {
127 externalUrl = serverOptions.getExternalUri().toURL();
128 } catch (MalformedURLException e) {
129 throw new IllegalArgumentException(e);
130 }
131
132 NetworkOptions networkOptions = new NetworkOptions(config);
133 HttpClient.Factory clientFactory =
134 new RoutableHttpClientFactory(
135 externalUrl, handler, networkOptions.getHttpClientFactory(tracer));
136
137 DistributorOptions distributorOptions = new DistributorOptions(config);
138 NewSessionQueueOptions newSessionRequestOptions = new NewSessionQueueOptions(config);
139 LocalNewSessionQueue queue =
140 new LocalNewSessionQueue(
141 tracer,
142 distributorOptions.getSlotMatcher(),
143 newSessionRequestOptions.getSessionRequestTimeoutPeriod(),
144 newSessionRequestOptions.getSessionRequestTimeout(),
145 newSessionRequestOptions.getMaximumResponseDelay(),
146 secret,
147 newSessionRequestOptions.getBatchSize());
148 handler.addHandler(queue);
149
150 LocalDistributor distributor =
151 new LocalDistributor(
152 tracer,
153 bus,
154 clientFactory,
155 sessions,
156 queue,
157 distributorOptions.getSlotSelector(),
158 secret,
159 distributorOptions.getHealthCheckInterval(),
160 distributorOptions.shouldRejectUnsupportedCaps(),
161 newSessionRequestOptions.getSessionRequestRetryInterval(),
162 distributorOptions.getNewSessionThreadPoolSize(),
163 distributorOptions.getSlotMatcher(),
164 distributorOptions.getPurgeNodesInterval());
165 handler.addHandler(distributor);

Callers

nothing calls this directly

Calls 15

getTracerMethod · 0.95
getEventBusMethod · 0.95
addHandlerMethod · 0.95
getRegistrationSecretMethod · 0.95
getExternalUriMethod · 0.95
getHttpClientFactoryMethod · 0.95
getSlotMatcherMethod · 0.95
getBatchSizeMethod · 0.95
getSlotSelectorMethod · 0.95

Tested by

no test coverage detected