Merge pull request #6241 from Matt Benson

* gh-6241:
  Add an accessor for webEnvironment to SpringApplication
This commit is contained in:
Andy Wilkinson 2016-07-01 11:00:02 +01:00
commit fdc2e8407e
1 changed files with 9 additions and 0 deletions

View File

@ -928,6 +928,15 @@ public class SpringApplication {
this.mainApplicationClass = mainApplicationClass;
}
/**
* Returns whether this {@link SpringApplication} is running within a web environment.
* @return {@code true} if running within a web environment, otherwise {@code false}.
* @see #setWebEnvironment(boolean)
*/
public boolean isWebEnvironment() {
return this.webEnvironment;
}
/**
* Sets if this application is running within a web environment. If not specified will
* attempt to deduce the environment based on the classpath.