Polish Javadoc
This commit is contained in:
@@ -54,7 +54,7 @@ public class DevToolsProperties {
|
||||
}
|
||||
|
||||
/**
|
||||
* Restart properties
|
||||
* Restart properties.
|
||||
*/
|
||||
public static class Restart {
|
||||
|
||||
@@ -173,7 +173,7 @@ public class DevToolsProperties {
|
||||
}
|
||||
|
||||
/**
|
||||
* LiveReload properties
|
||||
* LiveReload properties.
|
||||
*/
|
||||
public static class Livereload {
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public class OptionalLiveReloadServer {
|
||||
|
||||
/**
|
||||
* {@link PostConstruct} method to start the server if possible.
|
||||
* @throws Exception
|
||||
* @throws Exception in case of errors
|
||||
*/
|
||||
@PostConstruct
|
||||
public void startServer() throws Exception {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Support for classpath monitoring
|
||||
* Support for classpath monitoring.
|
||||
*/
|
||||
package org.springframework.boot.devtools.classpath;
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Andy Clement
|
||||
* @author Phillip Webb
|
||||
* @see FileChangeListener
|
||||
* @since 1.3.0
|
||||
* @see FileChangeListener
|
||||
*/
|
||||
public class FileSystemWatcher {
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@ import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* A {@link LiveReloadServer} connection.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
class Connection {
|
||||
|
||||
@@ -58,7 +60,7 @@ class Connection {
|
||||
* @param socket the source socket
|
||||
* @param inputStream the socket input stream
|
||||
* @param outputStream the socket output stream
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
Connection(Socket socket, InputStream inputStream, OutputStream outputStream)
|
||||
throws IOException {
|
||||
@@ -71,7 +73,7 @@ class Connection {
|
||||
|
||||
/**
|
||||
* Run the connection.
|
||||
* @throws Exception
|
||||
* @throws Exception in case of errors
|
||||
*/
|
||||
public void run() throws Exception {
|
||||
if (this.header.contains("Upgrade: websocket")
|
||||
@@ -126,7 +128,7 @@ class Connection {
|
||||
|
||||
/**
|
||||
* Trigger livereload for the client using this connection.
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public void triggerReload() throws IOException {
|
||||
if (this.webSocket) {
|
||||
@@ -152,7 +154,7 @@ class Connection {
|
||||
|
||||
/**
|
||||
* Close the connection.
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public void close() throws IOException {
|
||||
this.running = false;
|
||||
|
||||
@@ -40,7 +40,7 @@ class ConnectionInputStream extends FilterInputStream {
|
||||
* any HTTP content after the header since the initial request is usually just a
|
||||
* WebSocket upgrade.
|
||||
* @return the HTTP header
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public String readHeader() throws IOException {
|
||||
byte[] buffer = new byte[BUFFER_SIZE];
|
||||
@@ -58,7 +58,7 @@ class ConnectionInputStream extends FilterInputStream {
|
||||
* @param buffer the destination buffer
|
||||
* @param offset the buffer offset
|
||||
* @param length the amount of data to read
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public void readFully(byte[] buffer, int offset, int length) throws IOException {
|
||||
while (length > 0) {
|
||||
@@ -72,7 +72,7 @@ class ConnectionInputStream extends FilterInputStream {
|
||||
* Read a single byte from the stream (checking that the end of the stream hasn't been
|
||||
* reached.
|
||||
* @return the content
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public int checkedRead() throws IOException {
|
||||
int b = read();
|
||||
@@ -84,12 +84,12 @@ class ConnectionInputStream extends FilterInputStream {
|
||||
|
||||
/**
|
||||
* Read a number of bytes from the stream (checking that the end of the stream hasn't
|
||||
* been reached)
|
||||
* been reached).
|
||||
* @param buffer the destination buffer
|
||||
* @param offset the buffer offset
|
||||
* @param length the length to read
|
||||
* @return the amount of data read
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public int checkedRead(byte[] buffer, int offset, int length) throws IOException {
|
||||
int amountRead = read(buffer, offset, length);
|
||||
|
||||
@@ -107,6 +107,9 @@ class Frame {
|
||||
return new Frame(Type.forCode(firstByte & 0x0F), payload);
|
||||
}
|
||||
|
||||
/**
|
||||
* Frame types.
|
||||
*/
|
||||
public enum Type {
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,8 +38,8 @@ import org.springframework.util.Assert;
|
||||
* A <a href="http://livereload.com">livereload</a> server.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @see <a href="http://livereload.com">livereload.com</a>
|
||||
* @since 1.3.0
|
||||
* @see <a href="http://livereload.com">livereload.com</a>
|
||||
*/
|
||||
public class LiveReloadServer {
|
||||
|
||||
@@ -109,7 +109,7 @@ public class LiveReloadServer {
|
||||
|
||||
/**
|
||||
* Start the livereload server and accept incoming connections.
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public synchronized void start() throws IOException {
|
||||
Assert.state(!isStarted(), "Server already started");
|
||||
@@ -137,7 +137,7 @@ public class LiveReloadServer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the port that the server is listening on
|
||||
* Return the port that the server is listening on.
|
||||
* @return the server port
|
||||
*/
|
||||
public int getPort() {
|
||||
@@ -165,7 +165,7 @@ public class LiveReloadServer {
|
||||
|
||||
/**
|
||||
* Gracefully stop the livereload server.
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public synchronized void stop() throws IOException {
|
||||
if (this.listenThread != null) {
|
||||
@@ -231,7 +231,7 @@ public class LiveReloadServer {
|
||||
* @param inputStream the socket input stream
|
||||
* @param outputStream the socket output stream
|
||||
* @return a connection
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
protected Connection createConnection(Socket socket, InputStream inputStream,
|
||||
OutputStream outputStream) throws IOException {
|
||||
@@ -303,7 +303,7 @@ public class LiveReloadServer {
|
||||
}
|
||||
|
||||
/**
|
||||
* {@link ThreadFactory} to create the worker threads,
|
||||
* {@link ThreadFactory} to create the worker threads.
|
||||
*/
|
||||
private static class WorkerThreadFactory implements ThreadFactory {
|
||||
|
||||
|
||||
@@ -27,6 +27,8 @@ import org.springframework.core.type.AnnotatedTypeMetadata;
|
||||
|
||||
/**
|
||||
* Condition used to check that the actual local port is available.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
class LocalDebugPortAvailableCondition extends SpringBootCondition {
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class Dispatcher {
|
||||
* @param request the request
|
||||
* @param response the response
|
||||
* @return {@code true} if the request was dispatched
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public boolean handle(ServerHttpRequest request, ServerHttpResponse response)
|
||||
throws IOException {
|
||||
|
||||
@@ -33,7 +33,7 @@ public interface Handler {
|
||||
* Handle the request.
|
||||
* @param request the request
|
||||
* @param response the response
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
void handle(ServerHttpRequest request, ServerHttpResponse response)
|
||||
throws IOException;
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.springframework.http.server.ServerHttpRequest;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* {@link HandlerMapper} implementation that maps incoming URLs
|
||||
* {@link HandlerMapper} implementation that maps incoming URLs.
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Phillip Webb
|
||||
|
||||
@@ -256,7 +256,7 @@ public class Restarter {
|
||||
/**
|
||||
* Start the application.
|
||||
* @param failureHandler a failure handler for application that won't start
|
||||
* @throws Exception
|
||||
* @throws Exception in case of errors
|
||||
*/
|
||||
protected void start(FailureHandler failureHandler) throws Exception {
|
||||
do {
|
||||
@@ -292,7 +292,7 @@ public class Restarter {
|
||||
* Relaunch the application using the specified classloader.
|
||||
* @param classLoader the classloader to use
|
||||
* @return any exception that caused the launch to fail or {@code null}
|
||||
* @throws Exception
|
||||
* @throws Exception in case of errors
|
||||
*/
|
||||
protected Throwable relaunch(ClassLoader classLoader) throws Exception {
|
||||
RestartLauncher launcher = new RestartLauncher(classLoader, this.mainClassName,
|
||||
@@ -304,7 +304,7 @@ public class Restarter {
|
||||
|
||||
/**
|
||||
* Stop the application.
|
||||
* @throws Exception
|
||||
* @throws Exception in case of errors
|
||||
*/
|
||||
protected void stop() throws Exception {
|
||||
this.logger.debug("Stopping application");
|
||||
|
||||
@@ -25,8 +25,8 @@ import org.springframework.util.Assert;
|
||||
* files that have been added, modified or deleted since the original JAR was created.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @see ClassLoaderFileRepository
|
||||
* @since 1.3.0
|
||||
* @see ClassLoaderFileRepository
|
||||
*/
|
||||
public class ClassLoaderFile implements Serializable {
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Classloaders used for reload support
|
||||
* Classloaders used for reload support.
|
||||
*/
|
||||
package org.springframework.boot.devtools.restart.classloader;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Application restart support
|
||||
* Application restart support.
|
||||
*/
|
||||
package org.springframework.boot.devtools.restart;
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public class HttpRestartServer {
|
||||
* Handle a server request.
|
||||
* @param request the request
|
||||
* @param response the response
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public void handle(ServerHttpRequest request, ServerHttpResponse response)
|
||||
throws IOException {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Remote restart server
|
||||
* Remote restart server.
|
||||
*/
|
||||
package org.springframework.boot.devtools.restart.server;
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public class TunnelClient implements SmartInitializingSingleton {
|
||||
|
||||
/**
|
||||
* Start the client and accept incoming connections on the port.
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public synchronized void start() throws IOException {
|
||||
Assert.state(this.serverThread == null, "Server already started");
|
||||
@@ -85,7 +85,7 @@ public class TunnelClient implements SmartInitializingSingleton {
|
||||
|
||||
/**
|
||||
* Stop the client, disconnecting any servers.
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public synchronized void stop() throws IOException {
|
||||
if (this.serverThread != null) {
|
||||
|
||||
@@ -34,7 +34,7 @@ public interface TunnelConnection {
|
||||
* @param closeable a closeable to call when the channel is closed
|
||||
* @return A {@link WritableByteChannel} that should be used to send any outgoing data
|
||||
* destined for the remote server
|
||||
* @throws Exception
|
||||
* @throws Exception in case of errors
|
||||
*/
|
||||
WritableByteChannel open(WritableByteChannel incomingChannel, Closeable closeable)
|
||||
throws Exception;
|
||||
|
||||
@@ -75,7 +75,7 @@ public class HttpTunnelPayload {
|
||||
/**
|
||||
* Assign this payload to the given {@link HttpOutputMessage}.
|
||||
* @param message the message to assign this payload to
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public void assignTo(HttpOutputMessage message) throws IOException {
|
||||
Assert.notNull(message, "Message must not be null");
|
||||
@@ -93,7 +93,7 @@ public class HttpTunnelPayload {
|
||||
/**
|
||||
* Write the content of this payload to the given target channel.
|
||||
* @param channel the channel to write to
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public void writeTo(WritableByteChannel channel) throws IOException {
|
||||
Assert.notNull(channel, "Channel must not be null");
|
||||
@@ -107,7 +107,7 @@ public class HttpTunnelPayload {
|
||||
* is no payload.
|
||||
* @param message the HTTP message
|
||||
* @return the payload or {@code null}
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public static HttpTunnelPayload get(HttpInputMessage message) throws IOException {
|
||||
long length = message.getHeaders().getContentLength();
|
||||
@@ -131,7 +131,7 @@ public class HttpTunnelPayload {
|
||||
* the channel timed out whilst reading.
|
||||
* @param channel the source channel
|
||||
* @return payload data or {@code null}
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public static ByteBuffer getPayloadData(ReadableByteChannel channel)
|
||||
throws IOException {
|
||||
|
||||
@@ -132,7 +132,7 @@ public class HttpTunnelServer {
|
||||
* Handle an incoming HTTP connection.
|
||||
* @param request the HTTP request
|
||||
* @param response the HTTP response
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public void handle(ServerHttpRequest request, ServerHttpResponse response)
|
||||
throws IOException {
|
||||
@@ -142,7 +142,7 @@ public class HttpTunnelServer {
|
||||
/**
|
||||
* Handle an incoming HTTP connection.
|
||||
* @param httpConnection the HTTP connection
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
protected void handle(HttpConnection httpConnection) throws IOException {
|
||||
try {
|
||||
@@ -157,7 +157,7 @@ public class HttpTunnelServer {
|
||||
/**
|
||||
* Returns the active server thread, creating and starting it if necessary.
|
||||
* @return the {@code ServerThread} (never {@code null})
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
protected ServerThread getServerThread() throws IOException {
|
||||
synchronized (this) {
|
||||
@@ -316,7 +316,7 @@ public class HttpTunnelServer {
|
||||
/**
|
||||
* Handle an incoming {@link HttpConnection}.
|
||||
* @param httpConnection the connection to handle.
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public void handleIncomingHttp(HttpConnection httpConnection) throws IOException {
|
||||
if (this.closed) {
|
||||
@@ -446,7 +446,7 @@ public class HttpTunnelServer {
|
||||
/**
|
||||
* Send a HTTP status response.
|
||||
* @param status the status to send
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public void respond(HttpStatus status) throws IOException {
|
||||
Assert.notNull(status, "Status must not be null");
|
||||
@@ -457,7 +457,7 @@ public class HttpTunnelServer {
|
||||
/**
|
||||
* Send a payload response.
|
||||
* @param payload the payload to send
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public void respond(HttpTunnelPayload payload) throws IOException {
|
||||
Assert.notNull(payload, "Payload must not be null");
|
||||
|
||||
@@ -26,7 +26,7 @@ package org.springframework.boot.devtools.tunnel.server;
|
||||
public interface PortProvider {
|
||||
|
||||
/**
|
||||
* Return the port number
|
||||
* Return the port number.
|
||||
* @return the port number
|
||||
*/
|
||||
int getPort();
|
||||
|
||||
@@ -31,7 +31,7 @@ public interface TargetServerConnection {
|
||||
* Open a connection to the target server with the specified timeout.
|
||||
* @param timeout the read timeout
|
||||
* @return a {@link ByteChannel} providing read/write access to the server
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
ByteChannel open(int timeout) throws IOException;
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ public class LiveReloadServerTests {
|
||||
/**
|
||||
* Useful main method for manual testing against a real browser.
|
||||
* @param args main args
|
||||
* @throws IOException
|
||||
* @throws IOException in case of I/O errors
|
||||
*/
|
||||
public static void main(String[] args) throws IOException {
|
||||
LiveReloadServer server = new LiveReloadServer();
|
||||
|
||||
Reference in New Issue
Block a user