Class ExecutableArchiveLauncher

java.lang.Object
org.springframework.boot.loader.launch.Launcher
org.springframework.boot.loader.launch.ExecutableArchiveLauncher
Direct Known Subclasses:
JarLauncher, WarLauncher

public abstract class ExecutableArchiveLauncher extends Launcher
Base class for a Launcher backed by an executable archive.
Since:
3.2.0
Author:
Phillip Webb, Andy Wilkinson, Madhura Bhave, Scott Frederick
See Also:
  • Constructor Details

  • Method Details

    • createClassLoader

      protected ClassLoader createClassLoader(Collection<URL> urls) throws Exception
      Description copied from class: Launcher
      Create a classloader for the specified archives.
      Overrides:
      createClassLoader in class Launcher
      Parameters:
      urls - the classpath URLs
      Returns:
      the classloader
      Throws:
      Exception - if the classloader cannot be created
    • getArchive

      protected final Archive getArchive()
      Description copied from class: Launcher
      Return the archive being launched or null if there is no archive.
      Specified by:
      getArchive in class Launcher
      Returns:
      the launched archive
    • getMainClass

      protected String getMainClass() throws Exception
      Description copied from class: Launcher
      Returns the main class that should be launched.
      Specified by:
      getMainClass in class Launcher
      Returns:
      the name of the main class
      Throws:
      Exception - if the main class cannot be obtained
    • getClassPathUrls

      protected Set<URL> getClassPathUrls() throws Exception
      Description copied from class: Launcher
      Returns the archives that will be used to construct the class path.
      Specified by:
      getClassPathUrls in class Launcher
      Returns:
      the class path archives
      Throws:
      Exception - if the class path archives cannot be obtained
    • isSearchedDirectory

      protected boolean isSearchedDirectory(Archive.Entry entry)
      Determine if the specified directory entry is a candidate for further searching.
      Parameters:
      entry - the entry to check
      Returns:
      true if the entry is a candidate for further searching