类 LiveReloadServer
- java.lang.Object
- org.springframework.boot.devtools.livereload.LiveReloadServer
public class LiveReloadServer extends Object
A livereload server.- 从以下版本开始:
- 1.3.0
- 另请参阅:
- livereload.com
字段概要
字段 修饰符和类型 字段 说明 static int
DEFAULT_PORT
The default live reload server port.
构造器概要
构造器 构造器 说明 LiveReloadServer()
Create a newLiveReloadServer
listening on the default port.LiveReloadServer(int port)
Create a newLiveReloadServer
listening on the specified port.LiveReloadServer(int port, ThreadFactory threadFactory)
Create a newLiveReloadServer
listening on the specified port with a specificThreadFactory
.LiveReloadServer(ThreadFactory threadFactory)
Create a newLiveReloadServer
listening on the default port with a specificThreadFactory
.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected org.springframework.boot.devtools.livereload.Connection
createConnection(Socket socket, InputStream inputStream, OutputStream outputStream)
Factory method used to create theConnection
.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.
字段详细资料
DEFAULT_PORT
public static final int DEFAULT_PORT
The default live reload server port.- 另请参阅:
- 常量字段值
构造器详细资料
LiveReloadServer
public LiveReloadServer()
Create a newLiveReloadServer
listening on the default port.
LiveReloadServer
public LiveReloadServer(ThreadFactory threadFactory)
Create a newLiveReloadServer
listening on the default port with a specificThreadFactory
.- 参数:
threadFactory
- the thread factory
LiveReloadServer
public LiveReloadServer(int port)
Create a newLiveReloadServer
listening on the specified port.- 参数:
port
- the listen port
LiveReloadServer
public LiveReloadServer(int port, ThreadFactory threadFactory)
Create a newLiveReloadServer
listening on the specified port with a specificThreadFactory
.- 参数:
port
- the listen portthreadFactory
- the thread factory
方法详细资料
start
public void start() throws IOException
Start the livereload server and accept incoming connections.- 抛出:
IOException
- in case of I/O errors
isStarted
public boolean isStarted()
Return if the server has been started.- 返回:
true
if the server is running
getPort
public int getPort()
Return the port that the server is listening on.- 返回:
- the server port
stop
public void stop() throws IOException
Gracefully stop the livereload server.- 抛出:
IOException
- in case of I/O errors
triggerReload
public void triggerReload()
Trigger livereload of all connected clients.
createConnection
protected org.springframework.boot.devtools.livereload.Connection createConnection(Socket socket, InputStream inputStream, OutputStream outputStream) throws IOException
Factory method used to create theConnection
.- 参数:
socket
- the source socketinputStream
- the socket input streamoutputStream
- the socket output stream- 返回:
- a connection
- 抛出:
IOException
- in case of I/O errors