public void addListener(ServerListener listener) {
        startStop.addListener(requireNonNull(listener, "listener"));
    }
Adds the specified {@link ServerListener} to this {@link Server}, so that it is notified when the state
of this {@link Server} changes. This method is useful when you want to initialize/destroy the resources
associated with a {@link Service}:
<pre>{@code
> public class MyService extends SimpleService {
>     @Override
>     public void serviceAdded(Server server) {
>         server.addListener(new ServerListenerAdapter() {
>             @Override
>             public void serverStarting() {
>                 ... initialize ...
>             }
>
>             @Override
>             public void serverStopped() {
>                 ... destroy ...
>             }
>         }
>     }
> }
}</pre>
core/src/main/java/com/linecorp/armeria/server/Server.java