Package org.grails.cli.app
Class GrailsApplicationLauncher
- java.lang.Object
-
- org.grails.cli.app.GrailsApplicationLauncher
-
public class GrailsApplicationLauncher extends java.lang.ObjectA launcher forSpringApplicationor aSpringApplicationsubclass. The class that is used can be configured using the System propertygrails.application.class.nameor theGRAILS_APPLICATION_CLASS_NAMEenvironment variable. Uses reflection to allow the launching code to exist in a separate ClassLoader from the application code.- Since:
- 2022.1.0
- See Also:
System.getProperty(String),System.getenv(String)
-
-
Constructor Summary
Constructors Constructor Description GrailsApplicationLauncher(java.lang.ClassLoader classLoader)Creates a new launcher that will use the givenclassLoaderto load the configuredSpringApplicationclass.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringgetEnvironmentVariable(java.lang.String name)java.lang.Objectlaunch(java.lang.Class<?>[] sources, java.lang.String[] args)Launches the application created using the givensources.
-
-
-
Method Detail
-
launch
public java.lang.Object launch(java.lang.Class<?>[] sources, java.lang.String[] args) throws java.lang.ExceptionLaunches the application created using the givensources. The application is launched with the givenargs.- Parameters:
sources- the sources for the applicationargs- the args for the application- Returns:
- the application's
ApplicationContext - Throws:
java.lang.Exception- if the launch fails
-
getEnvironmentVariable
protected java.lang.String getEnvironmentVariable(java.lang.String name)
-
-