java.lang.Object
cloud.piranha.micro.loader.MicroConfiguration
The configuration for Piranha Micro.
- Author:
- Arjan Tijms
-
Constructor Summary
ConstructorDescriptionDefault constructor.MicroConfiguration(String version, String extensions, String dependencies, String repositories, boolean offline, int port, boolean rootIsWarName, String root, String httpServer, boolean httpStart, List<String> extensionsList, List<String> repositoriesList, List<String> mergedDependencies)
Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the extensions.Returns the list of extensions.Returns the HTTP server engine.Returns the merged dependencies.int
getPort()
Returns the port.Returns the repositories.Returns the list of repositories.getRoot()
Returns the root.Returns the version.boolean
Checks whether the config asks to start the http serverboolean
Are we offline.boolean
Whether the war name is used for the context rootHandle post construct.void
setExtensions(String extensions)
Set the extensions.void
setHttpServer(String httpServer)
Set the HTTP server engine to use.void
setHttpStart(boolean httpStart)
Sets whether the config asks to start the http servervoid
setOffline(boolean offline)
Set the offline flag.void
setPort(int port)
Set the port.void
setRepositories(String repositories)
Set the repositories.void
Set the root.void
setRootIsWarName(boolean rootIsWarName)
Sets that the war name should be used for the root context of a web app.void
setVersion(String version)
Set the version.toMap()
Construct a map for the configuration.
-
Constructor Details
-
MicroConfiguration
public MicroConfiguration()Default constructor. Initializes most of the stuff from System properties. -
MicroConfiguration
public MicroConfiguration(String version, String extensions, String dependencies, String repositories, boolean offline, int port, boolean rootIsWarName, String root, String httpServer, boolean httpStart, List<String> extensionsList, List<String> repositoriesList, List<String> mergedDependencies)Constructor.- Parameters:
version
- Piranha version.extensions
- Piranha extensions.dependencies
- Piranha dependencies.repositories
- Piranha repositories.offline
- Offline flag.port
- http port on which Piranha listens to requests.rootIsWarName
- sets that the war name should be used for the root contextroot
- the context root for web applicationshttpServer
- the HTTP server implementation to use.httpStart
- whether or not to start the HTTP server.extensionsList
- List of extensions.repositoriesList
- List of repos.mergedDependencies
- List of merged dependencies.
-
-
Method Details
-
postConstruct
Handle post construct.- Returns:
- the configuration.
-
toMap
Construct a map for the configuration.- Returns:
- the map.
-
getVersion
Returns the version.- Returns:
- the version
-
setVersion
Set the version.- Parameters:
version
- the version.
-
getExtensions
Returns the extensions.- Returns:
- the extensions
-
setExtensions
Set the extensions.- Parameters:
extensions
- the extensions.
-
getRepositories
Returns the repositories.- Returns:
- the repositories
-
setRepositories
Set the repositories.- Parameters:
repositories
- the repositories.
-
isOffline
public boolean isOffline()Are we offline.- Returns:
- true if so, false otherwise.
-
setOffline
public void setOffline(boolean offline)Set the offline flag.- Parameters:
offline
- the offline flag.
-
getPort
public int getPort()Returns the port.- Returns:
- the port
-
setPort
public void setPort(int port)Set the port.- Parameters:
port
- the port.
-
isRootIsWarName
public boolean isRootIsWarName()Whether the war name is used for the context root- Returns:
- whether the war name is used for the context root
-
setRootIsWarName
public void setRootIsWarName(boolean rootIsWarName)Sets that the war name should be used for the root context of a web app.Setting this to true overrides the explicit context root set via the
setRoot
method.- Parameters:
rootIsWarName
- whether the war name is used for the context root
-
getRoot
Returns the root.- Returns:
- the root
-
setRoot
Set the root.- Parameters:
root
- the root.
-
getExtensionsList
Returns the list of extensions.- Returns:
- the list of extensions
-
getRepositoriesList
Returns the list of repositories.- Returns:
- the list of repositories
-
getMergedDependencies
Returns the merged dependencies.- Returns:
- the merged dependencies
-
getHttpServer
Returns the HTTP server engine.- Returns:
- the HTTP server engine
-
setHttpServer
Set the HTTP server engine to use.- Parameters:
httpServer
- the HTTP server engine.
-
isHttpStart
public boolean isHttpStart()Checks whether the config asks to start the http server- Returns:
- true if an http server will be started, false otherwise
-
setHttpStart
public void setHttpStart(boolean httpStart)Sets whether the config asks to start the http server- Parameters:
httpStart
- the HTTP start flag.
-