Class LiveReloadServer
java.lang.Object
org.springframework.boot.devtools.livereload.LiveReloadServer
A livereload server.
- Since:
- 1.3.0
- Author:
- Phillip Webb
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intThe default live reload server port.
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a newLiveReloadServerlistening on the default port.LiveReloadServer(int port) Create a newLiveReloadServerlistening on the specified port.LiveReloadServer(int port, ThreadFactory threadFactory) Create a newLiveReloadServerlistening on the specified port with a specificThreadFactory.LiveReloadServer(ThreadFactory threadFactory) Create a newLiveReloadServerlistening on the default port with a specificThreadFactory.
- 
Method SummaryModifier and TypeMethodDescriptionprotected org.springframework.boot.devtools.livereload.ConnectioncreateConnection(Socket socket, InputStream inputStream, OutputStream outputStream) Factory method used to create theConnection.intgetPort()Return the port that the server is listening on.booleanReturn if the server has been started.intstart()Start the livereload server and accept incoming connections.voidstop()Gracefully stop the livereload server.voidTrigger livereload of all connected clients.
- 
Field Details- 
DEFAULT_PORTpublic static final int DEFAULT_PORTThe default live reload server port.- See Also:
 
 
- 
- 
Constructor Details- 
LiveReloadServerpublic LiveReloadServer()Create a newLiveReloadServerlistening on the default port.
- 
LiveReloadServerCreate a newLiveReloadServerlistening on the default port with a specificThreadFactory.- Parameters:
- threadFactory- the thread factory
 
- 
LiveReloadServerpublic LiveReloadServer(int port) Create a newLiveReloadServerlistening on the specified port.- Parameters:
- port- the listen port
 
- 
LiveReloadServerCreate a newLiveReloadServerlistening on the specified port with a specificThreadFactory.- Parameters:
- port- the listen port
- threadFactory- the thread factory
 
 
- 
- 
Method Details- 
startStart the livereload server and accept incoming connections.- Returns:
- the port on which the server is listening
- Throws:
- IOException- in case of I/O errors
 
- 
isStartedpublic boolean isStarted()Return if the server has been started.- Returns:
- trueif the server is running
 
- 
getPortpublic int getPort()Return the port that the server is listening on.- Returns:
- the server port
 
- 
stopGracefully stop the livereload server.- Throws:
- IOException- in case of I/O errors
 
- 
triggerReloadpublic void triggerReload()Trigger livereload of all connected clients.
- 
createConnectionprotected org.springframework.boot.devtools.livereload.Connection createConnection(Socket socket, InputStream inputStream, OutputStream outputStream) throws IOException Factory method used to create theConnection.- Parameters:
- socket- the source socket
- inputStream- the socket input stream
- outputStream- the socket output stream
- Returns:
- a connection
- Throws:
- IOException- in case of I/O errors
 
 
-