com.vaadin.flow.server.startup.
Class DevModeInitializer
- java.lang.Object
-
- com.vaadin.flow.server.startup.DevModeInitializer
-
All Implemented Interfaces:
public class DevModeInitializer extends Object implements ClassLoaderAwareServletContainerInitializer, Serializable
Servlet initializer starting node updaters as well as the webpack-dev-mode server.
Since:
2.0
See Also:
-
-
Constructor Summary
Constructors Constructor and Description DevModeInitializer()
-
Method Summary
All Methods Modifier and Type Method and Description void
contextDestroyed(ServletContextEvent ctx)
void
contextInitialized(ServletContextEvent ctx)
static void
initDevModeHandler(Set<Class<?>> classes, ServletContext context, DeploymentConfiguration config)
Initialize the devmode server if not in production mode or compatibility mode.
static boolean
isDevModeAlreadyStarted(ServletContext servletContext)
Shows whether
DevModeHandler
has been already started or not.void
process(Set<Class<?>> classes, ServletContext context)
Implement this method instead of
ClassLoaderAwareServletContainerInitializer.onStartup(Set, ServletContext)
to handle classes accessible by different classloaders.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.server.startup.ClassLoaderAwareServletContainerInitializer
onStartup
-
-
-
-
Method Detail
-
process
public void process(Set<Class<?>> classes, ServletContext context) throws ServletException
Description copied from interface:
ClassLoaderAwareServletContainerInitializer
Implement this method instead of
ClassLoaderAwareServletContainerInitializer.onStartup(Set, ServletContext)
to handle classes accessible by different classloaders.Specified by:
process
in interfaceClassLoaderAwareServletContainerInitializer
Parameters:
classes
- the Set of application classes that extend, implement, or have been annotated with the class types specified by theHandlesTypes
annotation, or null if there are no matches, or this ServletContainerInitializer has not been annotated with HandlesTypescontext
- the ServletContext of the web application that is being started and in which the classes contained in c were foundThrows:
ServletException
- if an error has occurredSee Also:
ClassLoaderAwareServletContainerInitializer.onStartup(Set, ServletContext)
-
initDevModeHandler
public static void initDevModeHandler(Set<Class<?>> classes, ServletContext context, DeploymentConfiguration config) throws ServletException
Initialize the devmode server if not in production mode or compatibility mode.
Parameters:
classes
- classes to check for npm- and js modulescontext
- servlet context we are running inconfig
- deployment configurationThrows:
ServletException
- if dev mode can't be initialized
-
isDevModeAlreadyStarted
public static boolean isDevModeAlreadyStarted(ServletContext servletContext)
Shows whether
DevModeHandler
has been already started or not.Parameters:
servletContext
- The servlet context, notnull
Returns:
true
ifDevModeHandler
has already been started,false
- otherwise
-
contextInitialized
public void contextInitialized(ServletContextEvent ctx)
-
contextDestroyed
public void contextDestroyed(ServletContextEvent ctx)
-
-