Package com.vaadin.base.devserver
Class ViteHandler
java.lang.Object
com.vaadin.base.devserver.AbstractDevServerRunner
com.vaadin.base.devserver.ViteHandler
- All Implemented Interfaces:
DevModeHandler,RequestHandler,Serializable
Handles communication with a Vite server.
This class is meant to be used during developing time.
For internal use only. May be renamed or removed in a future release.
- See Also:
-
Field Summary
Fields inherited from class com.vaadin.base.devserver.AbstractDevServerRunner
DEV_SERVER_HOST -
Constructor Summary
ConstructorsConstructorDescriptionViteHandler(Lookup lookup, int runningPort, File npmFolder, CompletableFuture<Void> waitFor) Creates and starts the dev mode handler if none has been started yet. -
Method Summary
Modifier and TypeMethodDescriptionGets the url path to the /VAADIN folder.Gets the url path to the /VAADIN folder inside the context root.protected FileGets the binary that starts the dev server.protected FileGets the main configuration file for the dev server.protected PatternGets a pattern to match with the output to determine that the server has failed to start.protected StringGets the name of the dev server for outputting to the user and statistics.protected PatternGets a pattern to match with the output to determine that the server has been restarted.protected PatternGets a pattern to match with the output to determine that the server is restarting.getServerStartupCommand(FrontendTools frontendTools) Gets the commands to run to start the dev server.protected PatternGets a pattern to match with the output to determine that the server has started successfully.prepareConnection(String path, String method) Prepare a HTTP connection against the dev server.Methods inherited from class com.vaadin.base.devserver.AbstractDevServerRunner
checkConnection, doStartDevServer, getApplicationConfiguration, getFailedOutput, getFrontendTools, getPort, getProjectRoot, getWatchDog, handleRequest, onDevServerCompilation, serveDevModeRequest, stop, updateServerStartupEnvironment, validateFiles, waitForDevServer, writeStream
-
Constructor Details
-
ViteHandler
Creates and starts the dev mode handler if none has been started yet.- Parameters:
lookup- the provided lookup to get required datarunningPort- a port on which Vite is already running or 0 to start a new processnpmFolder- folder with npm configuration fileswaitFor- a completable future whose execution result needs to be available to start the dev server
-
-
Method Details
-
getServerStartupCommand
Description copied from class:AbstractDevServerRunnerGets the commands to run to start the dev server.- Specified by:
getServerStartupCommandin classAbstractDevServerRunner- Parameters:
frontendTools- the frontend tools object- Returns:
- the list of commands to start the dev server
-
getServerName
Description copied from class:AbstractDevServerRunnerGets the name of the dev server for outputting to the user and statistics.- Specified by:
getServerNamein classAbstractDevServerRunner- Returns:
- the dev server name
-
getServerBinary
Description copied from class:AbstractDevServerRunnerGets the binary that starts the dev server.- Specified by:
getServerBinaryin classAbstractDevServerRunner- Returns:
- the dev server binary file
-
getServerConfig
Description copied from class:AbstractDevServerRunnerGets the main configuration file for the dev server.- Specified by:
getServerConfigin classAbstractDevServerRunner- Returns:
- the dev server configuration file
-
getServerFailurePattern
Description copied from class:AbstractDevServerRunnerGets a pattern to match with the output to determine that the server has failed to start.- Specified by:
getServerFailurePatternin classAbstractDevServerRunner- Returns:
- the failure pattern
-
getServerSuccessPattern
Description copied from class:AbstractDevServerRunnerGets a pattern to match with the output to determine that the server has started successfully.- Specified by:
getServerSuccessPatternin classAbstractDevServerRunner- Returns:
- the success pattern
-
getServerRestartingPattern
Description copied from class:AbstractDevServerRunnerGets a pattern to match with the output to determine that the server is restarting. Defaults to null, meaning that server restart is not monitored. Server restart is monitored only if both this method andAbstractDevServerRunner.getServerRestartedPattern()provides a pattern.- Overrides:
getServerRestartingPatternin classAbstractDevServerRunner- Returns:
- the restarting pattern, or
nullif restart monitoring is not used
-
getServerRestartedPattern
Description copied from class:AbstractDevServerRunnerGets a pattern to match with the output to determine that the server has been restarted. Defaults to null, meaning that server restart is not monitored. Server restart is monitored only if both this method andAbstractDevServerRunner.getServerRestartingPattern()provides a pattern.- Overrides:
getServerRestartedPatternin classAbstractDevServerRunner- Returns:
- the restarted pattern, or
nullif restart monitoring is not used
-
prepareConnection
Description copied from interface:DevModeHandlerPrepare a HTTP connection against the dev server.- Specified by:
prepareConnectionin interfaceDevModeHandler- Overrides:
prepareConnectionin classAbstractDevServerRunner- Parameters:
path- the file to request, needs to be safemethod- the http method to use- Returns:
- the connection
- Throws:
IOException- on connection error
-
getPathToVaadin
Gets the url path to the /VAADIN folder.- Returns:
- the url path to the /VAADIN folder, relative to the host root
-
getPathToVaadinInContext
Gets the url path to the /VAADIN folder inside the context root.- Returns:
- the url path to the /VAADIN folder, relative to the context root
-