|
|
|
@ -38,6 +38,7 @@ import org.springframework.boot.devtools.restart.classloader.ClassLoaderFile; |
|
|
|
import org.springframework.boot.devtools.restart.classloader.ClassLoaderFile.Kind; |
|
|
|
import org.springframework.boot.devtools.restart.classloader.ClassLoaderFile.Kind; |
|
|
|
import org.springframework.boot.devtools.restart.classloader.ClassLoaderFiles; |
|
|
|
import org.springframework.boot.devtools.restart.classloader.ClassLoaderFiles; |
|
|
|
import org.springframework.context.ApplicationListener; |
|
|
|
import org.springframework.context.ApplicationListener; |
|
|
|
|
|
|
|
import org.springframework.core.log.LogMessage; |
|
|
|
import org.springframework.http.HttpHeaders; |
|
|
|
import org.springframework.http.HttpHeaders; |
|
|
|
import org.springframework.http.HttpMethod; |
|
|
|
import org.springframework.http.HttpMethod; |
|
|
|
import org.springframework.http.HttpStatus; |
|
|
|
import org.springframework.http.HttpStatus; |
|
|
|
@ -114,10 +115,8 @@ public class ClassPathChangeUploader implements ApplicationListener<ClassPathCha |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (SocketException ex) { |
|
|
|
catch (SocketException ex) { |
|
|
|
if (logger.isWarnEnabled()) { |
|
|
|
logger.warn(LogMessage.format( |
|
|
|
logger.warn("A failure occurred when uploading to " + this.uri |
|
|
|
"A failure occurred when uploading to %s. Upload will be retried in 2 seconds", this.uri)); |
|
|
|
+ ". Upload will be retried in 2 seconds"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
logger.debug("Upload failure", ex); |
|
|
|
logger.debug("Upload failure", ex); |
|
|
|
Thread.sleep(2000); |
|
|
|
Thread.sleep(2000); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -130,10 +129,8 @@ public class ClassPathChangeUploader implements ApplicationListener<ClassPathCha |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void logUpload(ClassLoaderFiles classLoaderFiles) { |
|
|
|
private void logUpload(ClassLoaderFiles classLoaderFiles) { |
|
|
|
if (logger.isInfoEnabled()) { |
|
|
|
int size = classLoaderFiles.size(); |
|
|
|
int size = classLoaderFiles.size(); |
|
|
|
logger.info(LogMessage.format("Uploaded %s class %s", size, (size != 1) ? "resources" : "resource")); |
|
|
|
logger.info("Uploaded " + size + " class " + ((size != 1) ? "resources" : "resource")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private byte[] serialize(ClassLoaderFiles classLoaderFiles) throws IOException { |
|
|
|
private byte[] serialize(ClassLoaderFiles classLoaderFiles) throws IOException { |
|
|
|
|