类 SpringApplicationLauncher


  • public class SpringApplicationLauncher
    extends Object
    A launcher for SpringApplication or a SpringApplication subclass. The class that is used can be configured using the System property spring.application.class.name or the SPRING_APPLICATION_CLASS_NAME environment variable. Uses reflection to allow the launching code to exist in a separate ClassLoader from the application code.
    从以下版本开始:
    1.2.0
    另请参阅:
    System.getProperty(String), System.getenv(String)
    • 构造器详细资料

      • SpringApplicationLauncher

        public SpringApplicationLauncher​(ClassLoader classLoader)
        Creates a new launcher that will use the given classLoader to load the configured SpringApplication class.
        参数:
        classLoader - the ClassLoader to use
    • 方法详细资料

      • launch

        public Object launch​(Object[] sources,
                             String[] args)
                      throws Exception
        Launches the application created using the given sources. The application is launched with the given args.
        参数:
        sources - The sources for the application
        args - The args for the application
        返回:
        The application's ApplicationContext
        抛出:
        Exception - if the launch fails