Browse Source

Make it easier to subclass Launchers

Change constructors from `package private` to `protected` for subclasses
to use.

Closes gh-3741
pull/3901/head
Ilayaperumal Gopinathan 11 years ago committed by Phillip Webb
parent
commit
61ac04aa4c
  1. 2
      spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/ExecutableArchiveLauncher.java
  2. 7
      spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/JarLauncher.java
  3. 2
      spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/WarLauncher.java

2
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/ExecutableArchiveLauncher.java

@ -55,7 +55,7 @@ public abstract class ExecutableArchiveLauncher extends Launcher { @@ -55,7 +55,7 @@ public abstract class ExecutableArchiveLauncher extends Launcher {
this.javaAgentDetector = javaAgentDetector;
}
ExecutableArchiveLauncher(Archive archive) {
protected ExecutableArchiveLauncher(Archive archive) {
this.javaAgentDetector = new InputArgumentsJavaAgentDetector();
this.archive = archive;
}

7
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/JarLauncher.java

@ -31,6 +31,13 @@ public class JarLauncher extends ExecutableArchiveLauncher { @@ -31,6 +31,13 @@ public class JarLauncher extends ExecutableArchiveLauncher {
private static final AsciiBytes LIB = new AsciiBytes("lib/");
public JarLauncher() {
}
protected JarLauncher(Archive archive) {
super(archive);
}
@Override
protected boolean isNestedArchive(Archive.Entry entry) {
return !entry.isDirectory() && entry.getName().startsWith(LIB);

2
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/WarLauncher.java

@ -42,7 +42,7 @@ public class WarLauncher extends ExecutableArchiveLauncher { @@ -42,7 +42,7 @@ public class WarLauncher extends ExecutableArchiveLauncher {
super();
}
WarLauncher(Archive archive) {
protected WarLauncher(Archive archive) {
super(archive);
}

Loading…
Cancel
Save