@@ -129,8 +129,8 @@ private NettyHttpService(String serviceName,
129129 this .workerThreadPoolSize = workerThreadPoolSize ;
130130 this .execThreadPoolSize = execThreadPoolSize ;
131131 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 );
134134 this .rejectedExecutionHandler = rejectedExecutionHandler ;
135135 this .resourceHandler = new HttpResourceHandler (httpHandlers , handlerHooks , urlRewriter , exceptionHandler );
136136 this .handlerContext = new BasicHandlerContext (this .resourceHandler );
@@ -152,10 +152,9 @@ public static Builder builder(String serviceName) {
152152
153153 /**
154154 * Starts the HTTP service.
155- *
156- * @throws Exception if the service failed to started
155+ * @throws Throwable
157156 */
158- public synchronized void start () throws Exception {
157+ public synchronized void start () throws Throwable {
159158 if (state == State .RUNNING ) {
160159 LOG .debug ("Ignore start() call on HTTP service {} since it has already been started." , serviceName );
161160 return ;
@@ -193,7 +192,6 @@ public synchronized void start() throws Exception {
193192 shutdownExecutorGroups (0 , 5 , TimeUnit .SECONDS , eventExecutorGroup );
194193 }
195194 } catch (Throwable t2 ) {
196- t .addSuppressed (t2 );
197195 }
198196 state = State .FAILED ;
199197 throw t ;
@@ -224,10 +222,9 @@ public boolean isSSLEnabled() {
224222 /**
225223 * Stops the HTTP service gracefully and release all resources. Same as calling {@link #stop(long, long, TimeUnit)}
226224 * 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
229226 */
230- public void stop () throws Exception {
227+ public void stop () throws Throwable {
231228 stop (0 , 5 , TimeUnit .SECONDS );
232229 }
233230
@@ -239,9 +236,9 @@ public void stop() throws Exception {
239236 * {@linkplain EventExecutorGroup#shutdown()}
240237 * regardless if a task was submitted during the quiet period
241238 * @param unit the unit of {@code quietPeriod} and {@code timeout}
242- * @throws Exception if there is exception raised during shutdown.
239+ * @throws Throwable
243240 */
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 {
245242 if (state == State .STOPPED ) {
246243 LOG .debug ("Ignore stop() call on HTTP service {} since it has already been stopped." , serviceName );
247244 return ;
@@ -377,7 +374,7 @@ protected void initChannel(SocketChannel ch) throws Exception {
377374 */
378375 private void shutdownExecutorGroups (long quietPeriod , long timeout , TimeUnit unit , EventExecutorGroup ...groups ) {
379376 Exception ex = null ;
380- List <Future <?>> futures = new ArrayList <>();
377+ List <Future <?>> futures = new ArrayList <Future <?> >();
381378 for (EventExecutorGroup group : groups ) {
382379 if (group == null ) {
383380 continue ;
@@ -391,8 +388,6 @@ private void shutdownExecutorGroups(long quietPeriod, long timeout, TimeUnit uni
391388 } catch (Exception e ) {
392389 if (ex == null ) {
393390 ex = e ;
394- } else {
395- ex .addSuppressed (e );
396391 }
397392 }
398393 }
@@ -449,8 +444,8 @@ protected Builder(String serviceName) {
449444 rejectedExecutionHandler = DEFAULT_REJECTED_EXECUTION_HANDLER ;
450445 httpChunkLimit = DEFAULT_HTTP_CHUNK_LIMIT ;
451446 port = 0 ;
452- channelConfigs = new HashMap <>();
453- childChannelConfigs = new HashMap <>();
447+ channelConfigs = new HashMap <ChannelOption , Object >();
448+ childChannelConfigs = new HashMap <ChannelOption , Object >();
454449 channelConfigs .put (ChannelOption .SO_BACKLOG , DEFAULT_CONNECTION_BACKLOG );
455450 sslHandlerFactory = null ;
456451 exceptionHandler = new ExceptionHandler ();
0 commit comments