code: public static LifecycleListener getContainerLifecycleListener(final ApplicationHandler applicationHandler) {
  
          final Iterable<ContainerLifecycleListener> listeners = Iterables.concat(
                  Providers.getAllProviders(applicationHandler.getInjectionManager(), ContainerLifecycleListener.class),
                  new LinkedList<ContainerLifecycleListener>() {{
                      add(new ServiceLocatorShutdownListener());
                  }});
  
          return new LifecycleListener() {
  
              @Override
              public void onReloadShutdown(Container container, Runnable tryScope) {
                  for (final ContainerLifecycleListener listener : listeners) {
                      if (listener instanceof ServiceLocatorShutdownListener) {
                          container = new ContainerDelegate(container);
                          tryScope.run();
                      }
                      listener.onShutdown(container);
                  }
              }
  
              @Override
              public void onStartup(final Container container) {
                  for (final ContainerLifecycleListener listener : listeners) {
                      listener.onStartup(container);
                  }
              }
  
              @Override
              public void onReload(final Container container) {
                  for (final ContainerLifecycleListener listener : listeners) {
                      listener.onReload(container);
                  }
              }
  
              @Override
              public void onShutdown(final Container container) {
                  for (final ContainerLifecycleListener listener : listeners) {
                      listener.onShutdown(container);
                  }
              }
          };
      }
docs: Provides a single ContainerLifecycleListener instance based on the {@link ApplicationHandler application} configuration.
  This method looks for providers implementing {@link org.glassfish.jersey.server.spi.ContainerLifecycleListener} interface and aggregates them into
  a single umbrella listener instance that is returned.
  
  @param applicationHandler actual application from where to get the listener.
  @return a single instance of a ContainerLifecycleListener, can not be null.