public class LiveReloadServer extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PORT
The default live reload server port.
|
Constructor and Description |
---|
LiveReloadServer()
Create a new
LiveReloadServer listening on the default port. |
LiveReloadServer(int port)
Create a new
LiveReloadServer listening on the specified port. |
LiveReloadServer(int port,
ThreadFactory threadFactory)
Create a new
LiveReloadServer listening on the specified port with a
specific ThreadFactory . |
LiveReloadServer(ThreadFactory threadFactory)
Create a new
LiveReloadServer listening on the default port with a specific
ThreadFactory . |
Modifier and Type | Method and Description |
---|---|
protected org.springframework.boot.devtools.livereload.Connection |
createConnection(Socket socket,
InputStream inputStream,
OutputStream outputStream)
Factory method used to create the
Connection . |
int |
getPort()
Return the port that the server is listening on.
|
boolean |
isStarted()
Return if the server has been started.
|
void |
start()
Start the livereload server and accept incoming connections.
|
void |
stop()
Gracefully stop the livereload server.
|
void |
triggerReload()
Trigger livereload of all connected clients.
|
public static final int DEFAULT_PORT
public LiveReloadServer()
LiveReloadServer
listening on the default port.public LiveReloadServer(ThreadFactory threadFactory)
LiveReloadServer
listening on the default port with a specific
ThreadFactory
.threadFactory
- the thread factorypublic LiveReloadServer(int port)
LiveReloadServer
listening on the specified port.port
- the listen portpublic LiveReloadServer(int port, ThreadFactory threadFactory)
LiveReloadServer
listening on the specified port with a
specific ThreadFactory
.port
- the listen portthreadFactory
- the thread factorypublic void start() throws IOException
IOException
- in case of I/O errorspublic boolean isStarted()
true
if the server is runningpublic int getPort()
public void stop() throws IOException
IOException
- in case of I/O errorspublic void triggerReload()
protected org.springframework.boot.devtools.livereload.Connection createConnection(Socket socket, InputStream inputStream, OutputStream outputStream) throws IOException
Connection
.socket
- the source socketinputStream
- the socket input streamoutputStream
- the socket output streamIOException
- in case of I/O errorsCopyright © 2018 Pivotal Software, Inc.. All rights reserved.