Class MicroConfiguration

java.lang.Object
cloud.piranha.micro.loader.MicroConfiguration

public class MicroConfiguration extends Object
The configuration for Piranha Micro.
Author:
Arjan Tijms
  • 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 context
      root - the context root for web applications
      httpServer - 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

      public MicroConfiguration postConstruct()
      Handle post construct.
      Returns:
      the configuration.
    • toMap

      public Map<String,​Object> toMap()
      Construct a map for the configuration.
      Returns:
      the map.
    • getVersion

      public String getVersion()
      Returns the version.
      Returns:
      the version
    • setVersion

      public void setVersion(String version)
      Set the version.
      Parameters:
      version - the version.
    • getExtensions

      public String getExtensions()
      Returns the extensions.
      Returns:
      the extensions
    • setExtensions

      public void setExtensions(String extensions)
      Set the extensions.
      Parameters:
      extensions - the extensions.
    • getRepositories

      public String getRepositories()
      Returns the repositories.
      Returns:
      the repositories
    • setRepositories

      public void setRepositories(String repositories)
      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

      public String getRoot()
      Returns the root.
      Returns:
      the root
    • setRoot

      public void setRoot(String root)
      Set the root.
      Parameters:
      root - the root.
    • getExtensionsList

      public List<String> getExtensionsList()
      Returns the list of extensions.
      Returns:
      the list of extensions
    • getRepositoriesList

      public List<String> getRepositoriesList()
      Returns the list of repositories.
      Returns:
      the list of repositories
    • getMergedDependencies

      public List<String> getMergedDependencies()
      Returns the merged dependencies.
      Returns:
      the merged dependencies
    • getHttpServer

      public String getHttpServer()
      Returns the HTTP server engine.
      Returns:
      the HTTP server engine
    • setHttpServer

      public void setHttpServer(String httpServer)
      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.