com.vaadin.base.devserver.
Class ViteHandler
- java.lang.Object
-
- com.vaadin.base.devserver.AbstractDevServerRunner
-
- com.vaadin.base.devserver.ViteHandler
-
All Implemented Interfaces:
public final class ViteHandler extends AbstractDevServerRunner
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 Modifier and Type Field Description static String
VITE_SERVER
The local installation path of the server node script.
-
Constructor Summary
Constructors Constructor Description ViteHandler(Lookup lookup, int runningPort, File npmFolder, CompletableFuture<Void> waitFor)
Creates and starts the dev mode handler if none has been started yet.
-
Method Summary
All Methods Modifier and Type Method Description protected File
getServerBinary()
Gets the binary that starts the dev server.
protected File
getServerConfig()
Gets the main configuration file for the dev server.
protected Pattern
getServerFailurePattern()
Gets a pattern to match with the output to determine that the server has failed to start.
protected String
getServerName()
Gets the name of the dev server for outputting to the user and statistics.
protected List<String>
getServerStartupCommand(FrontendTools frontendTools)
Gets the commands to run to start the dev server.
protected Pattern
getServerSuccessPattern()
Gets a pattern to match with the output to determine that the server has started successfully.
HttpURLConnection
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, getPort, getProjectRoot, getWatchDog, handleRequest, onDevServerCompilation, serveDevModeRequest, stop, triggerLiveReload, updateServerStartupEnvironment, validateFiles, waitForDevServer, writeStream
-
-
-
-
Field Detail
-
VITE_SERVER
public static final String VITE_SERVER
The local installation path of the server node script.
See Also:
-
-
Constructor Detail
-
ViteHandler
public ViteHandler(Lookup lookup, int runningPort, File npmFolder, CompletableFuture<Void> waitFor)
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 Detail
-
getServerStartupCommand
protected List<String> getServerStartupCommand(FrontendTools frontendTools)
Description copied from class:
AbstractDevServerRunner
Gets the commands to run to start the dev server.
Specified by:
getServerStartupCommand
in classAbstractDevServerRunner
Parameters:
frontendTools
- the frontend tools object
-
getServerName
protected String getServerName()
Description copied from class:
AbstractDevServerRunner
Gets the name of the dev server for outputting to the user and statistics.
Specified by:
getServerName
in classAbstractDevServerRunner
-
getServerBinary
protected File getServerBinary()
Description copied from class:
AbstractDevServerRunner
Gets the binary that starts the dev server.
Specified by:
getServerBinary
in classAbstractDevServerRunner
-
getServerConfig
protected File getServerConfig()
Description copied from class:
AbstractDevServerRunner
Gets the main configuration file for the dev server.
Specified by:
getServerConfig
in classAbstractDevServerRunner
-
getServerFailurePattern
protected Pattern getServerFailurePattern()
Description copied from class:
AbstractDevServerRunner
Gets a pattern to match with the output to determine that the server has failed to start.
Specified by:
-
getServerSuccessPattern
protected Pattern getServerSuccessPattern()
Description copied from class:
AbstractDevServerRunner
Gets a pattern to match with the output to determine that the server has started successfully.
Specified by:
-
prepareConnection
public HttpURLConnection prepareConnection(String path, String method) throws IOException
Description copied from interface:
DevModeHandler
Prepare a HTTP connection against the dev server.
Specified by:
prepareConnection
in interfaceDevModeHandler
Overrides:
prepareConnection
in classAbstractDevServerRunner
Parameters:
path
- the file to request, needs to be safemethod
- the http method to useReturns:
the connection
Throws:
IOException
- on connection error
-
-