class VaadinAppShellInitializer implements ClassLoaderAwareServletContainerInitializer,
        // implementing ServletContextListener is needed for the @WebListener
        // annotation.
        ServletContextListener, Serializable {

    @Override
    public void process(Set<Class<?>> classes, ServletContext context)
            throws ServletException {

        Collection<? extends ServletRegistration> registrations = context
                .getServletRegistrations().values();
        if (registrations.isEmpty()) {
            return;
        }

        DeploymentConfiguration config = StubServletConfig
                .createDeploymentConfiguration(context,
                        registrations.iterator().next(), VaadinServlet.class);

        init(classes, context, config);
    }

}