@@ -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 ;
@@ -217,10 +215,9 @@ public String getServiceName() {
217215 /**
218216 * Stops the HTTP service gracefully and release all resources. Same as calling {@link #stop(long, long, TimeUnit)}
219217 * with {@code 0} second quiet period and {@code 5} seconds timeout.
220- *
221- * @throws Exception if there is exception raised during shutdown.
218+ * @throws Throwable
222219 */
223- public void stop () throws Exception {
220+ public void stop () throws Throwable {
224221 stop (0 , 5 , TimeUnit .SECONDS );
225222 }
226223
@@ -232,9 +229,9 @@ public void stop() throws Exception {
232229 * {@linkplain EventExecutorGroup#shutdown()}
233230 * regardless if a task was submitted during the quiet period
234231 * @param unit the unit of {@code quietPeriod} and {@code timeout}
235- * @throws Exception if there is exception raised during shutdown.
232+ * @throws Throwable
236233 */
237- public synchronized void stop (long quietPeriod , long timeout , TimeUnit unit ) throws Exception {
234+ public synchronized void stop (long quietPeriod , long timeout , TimeUnit unit ) throws Throwable {
238235 if (state == State .STOPPED ) {
239236 LOG .debug ("Ignore stop() call on HTTP service {} since it has already been stopped." , serviceName );
240237 return ;
@@ -370,7 +367,7 @@ protected void initChannel(SocketChannel ch) throws Exception {
370367 */
371368 private void shutdownExecutorGroups (long quietPeriod , long timeout , TimeUnit unit , EventExecutorGroup ...groups ) {
372369 Exception ex = null ;
373- List <Future <?>> futures = new ArrayList <>();
370+ List <Future <?>> futures = new ArrayList <Future <?> >();
374371 for (EventExecutorGroup group : groups ) {
375372 if (group == null ) {
376373 continue ;
@@ -384,8 +381,6 @@ private void shutdownExecutorGroups(long quietPeriod, long timeout, TimeUnit uni
384381 } catch (Exception e ) {
385382 if (ex == null ) {
386383 ex = e ;
387- } else {
388- ex .addSuppressed (e );
389384 }
390385 }
391386 }
@@ -442,8 +437,8 @@ protected Builder(String serviceName) {
442437 rejectedExecutionHandler = DEFAULT_REJECTED_EXECUTION_HANDLER ;
443438 httpChunkLimit = DEFAULT_HTTP_CHUNK_LIMIT ;
444439 port = 0 ;
445- channelConfigs = new HashMap <>();
446- childChannelConfigs = new HashMap <>();
440+ channelConfigs = new HashMap <ChannelOption , Object >();
441+ childChannelConfigs = new HashMap <ChannelOption , Object >();
447442 channelConfigs .put (ChannelOption .SO_BACKLOG , DEFAULT_CONNECTION_BACKLOG );
448443 sslHandlerFactory = null ;
449444 exceptionHandler = new ExceptionHandler ();
0 commit comments