@@ -129,8 +129,8 @@ private NettyHttpService(String serviceName,
129
129
this .workerThreadPoolSize = workerThreadPoolSize ;
130
130
this .execThreadPoolSize = execThreadPoolSize ;
131
131
this .execThreadKeepAliveSecs = execThreadKeepAliveSecs ;
132
- this .channelConfigs = new HashMap <>(channelConfigs );
133
- this .childChannelConfigs = new HashMap <>(childChannelConfigs );
132
+ this .channelConfigs = new HashMap <ChannelOption , Object >(channelConfigs );
133
+ this .childChannelConfigs = new HashMap <ChannelOption , Object >(childChannelConfigs );
134
134
this .rejectedExecutionHandler = rejectedExecutionHandler ;
135
135
this .resourceHandler = new HttpResourceHandler (httpHandlers , handlerHooks , urlRewriter , exceptionHandler );
136
136
this .handlerContext = new BasicHandlerContext (this .resourceHandler );
@@ -152,10 +152,9 @@ public static Builder builder(String serviceName) {
152
152
153
153
/**
154
154
* Starts the HTTP service.
155
- *
156
- * @throws Exception if the service failed to started
155
+ * @throws Throwable
157
156
*/
158
- public synchronized void start () throws Exception {
157
+ public synchronized void start () throws Throwable {
159
158
if (state == State .RUNNING ) {
160
159
LOG .debug ("Ignore start() call on HTTP service {} since it has already been started." , serviceName );
161
160
return ;
@@ -193,7 +192,6 @@ public synchronized void start() throws Exception {
193
192
shutdownExecutorGroups (0 , 5 , TimeUnit .SECONDS , eventExecutorGroup );
194
193
}
195
194
} catch (Throwable t2 ) {
196
- t .addSuppressed (t2 );
197
195
}
198
196
state = State .FAILED ;
199
197
throw t ;
@@ -224,10 +222,9 @@ public boolean isSSLEnabled() {
224
222
/**
225
223
* Stops the HTTP service gracefully and release all resources. Same as calling {@link #stop(long, long, TimeUnit)}
226
224
* with {@code 0} second quiet period and {@code 5} seconds timeout.
227
- *
228
- * @throws Exception if there is exception raised during shutdown.
225
+ * @throws Throwable
229
226
*/
230
- public void stop () throws Exception {
227
+ public void stop () throws Throwable {
231
228
stop (0 , 5 , TimeUnit .SECONDS );
232
229
}
233
230
@@ -239,9 +236,9 @@ public void stop() throws Exception {
239
236
* {@linkplain EventExecutorGroup#shutdown()}
240
237
* regardless if a task was submitted during the quiet period
241
238
* @param unit the unit of {@code quietPeriod} and {@code timeout}
242
- * @throws Exception if there is exception raised during shutdown.
239
+ * @throws Throwable
243
240
*/
244
- public synchronized void stop (long quietPeriod , long timeout , TimeUnit unit ) throws Exception {
241
+ public synchronized void stop (long quietPeriod , long timeout , TimeUnit unit ) throws Throwable {
245
242
if (state == State .STOPPED ) {
246
243
LOG .debug ("Ignore stop() call on HTTP service {} since it has already been stopped." , serviceName );
247
244
return ;
@@ -377,7 +374,7 @@ protected void initChannel(SocketChannel ch) throws Exception {
377
374
*/
378
375
private void shutdownExecutorGroups (long quietPeriod , long timeout , TimeUnit unit , EventExecutorGroup ...groups ) {
379
376
Exception ex = null ;
380
- List <Future <?>> futures = new ArrayList <>();
377
+ List <Future <?>> futures = new ArrayList <Future <?> >();
381
378
for (EventExecutorGroup group : groups ) {
382
379
if (group == null ) {
383
380
continue ;
@@ -391,8 +388,6 @@ private void shutdownExecutorGroups(long quietPeriod, long timeout, TimeUnit uni
391
388
} catch (Exception e ) {
392
389
if (ex == null ) {
393
390
ex = e ;
394
- } else {
395
- ex .addSuppressed (e );
396
391
}
397
392
}
398
393
}
@@ -449,8 +444,8 @@ protected Builder(String serviceName) {
449
444
rejectedExecutionHandler = DEFAULT_REJECTED_EXECUTION_HANDLER ;
450
445
httpChunkLimit = DEFAULT_HTTP_CHUNK_LIMIT ;
451
446
port = 0 ;
452
- channelConfigs = new HashMap <>();
453
- childChannelConfigs = new HashMap <>();
447
+ channelConfigs = new HashMap <ChannelOption , Object >();
448
+ childChannelConfigs = new HashMap <ChannelOption , Object >();
454
449
channelConfigs .put (ChannelOption .SO_BACKLOG , DEFAULT_CONNECTION_BACKLOG );
455
450
sslHandlerFactory = null ;
456
451
exceptionHandler = new ExceptionHandler ();
0 commit comments