Class ServerPiranha

java.lang.Object
cloud.piranha.dist.server.ServerPiranha
All Implemented Interfaces:
Piranha, Runnable

public class ServerPiranha extends Object implements Piranha, Runnable
The Piranha Server runtime.
Author:
Manfred Riem ([email protected])
  • Constructor Details

    • ServerPiranha

      public ServerPiranha()
  • Method Details

    • run

      public void run()
      Run method.
      Specified by:
      run in interface Runnable
    • service

      public void service(WebApplicationRequest request, WebApplicationResponse response) throws IOException, jakarta.servlet.ServletException
      Description copied from interface: Piranha
      Service the request and response.
      Specified by:
      service in interface Piranha
      Parameters:
      request - the request.
      response - the response.
      Throws:
      IOException - when an I/O error occurs.
      jakarta.servlet.ServletException - when a Servlet error occurs.
    • setDefaultExtensionClass

      public void setDefaultExtensionClass(Class<? extends WebApplicationExtension> defaultExtensionClass)
      Set the default extension class.
      Parameters:
      defaultExtensionClass - the default extension class.
    • setExitOnStop

      public void setExitOnStop(boolean exitOnStop)
      Set the exit on stop flag.
      Parameters:
      exitOnStop - the exit on stop flag.
    • setHttpPort

      public void setHttpPort(int httpPort)
      Set the HTTP server port.
      Parameters:
      httpPort - the HTTP server port.
    • setHttpServerClass

      public void setHttpServerClass(String httpServerClass)
      Set the HTTP server class.
      Parameters:
      httpServerClass - the HTTP server class.
    • setHttpsPort

      public void setHttpsPort(int httpsPort)
      Set the HTTPS server port.
      Parameters:
      httpsPort - the HTTPS server port.
    • setHttpsServerClass

      public void setHttpsServerClass(String httpsServerClass)
      Set the HTTPS server class.
      Parameters:
      httpsServerClass - the HTTPS server class.
    • setJpmsEnabled

      public void setJpmsEnabled(boolean jpmsEnabled)
      Enable/disable JPMS.
      Parameters:
      jpmsEnabled - the JPMS enabled flag.
    • setSslKeystoreFile

      public void setSslKeystoreFile(String sslKeystoreFile)
      Set the SSL keystore file.

      Convenience wrapper around the javax.net.ssl.keyStore system property. Note using this method sets the property for the entire JVM.

      Parameters:
      sslKeystoreFile - the SSL keystore file.
    • setSslTruststoreFile

      public void setSslTruststoreFile(String sslTruststoreFile)
      Set the SSL truststore file.

      Convenience wrapper around the javax.net.ssl.trustStore system property. Note using this method sets the property for the entire JVM.

      Parameters:
      sslTruststoreFile - the SSL truststore file.
    • setWebAppsDir

      public void setWebAppsDir(File webAppsDir)
      Set the web applications directory.
      Parameters:
      webAppsDir - the web applications directory.
    • start

      public void start()
      Start the server.
    • startHttpServer

      public void startHttpServer()
      Start the HTTP server (if requested).
    • stop

      public void stop()
      Stop the server.