Class EmbeddedPiranha

java.lang.Object
cloud.piranha.embedded.EmbeddedPiranha
All Implemented Interfaces:
Piranha
Direct Known Subclasses:
MicroEmbeddedPiranha

public class EmbeddedPiranha extends Object implements Piranha
The embeddable version of Piranha.
Author:
Manfred Riem ([email protected])
  • Constructor Details

    • EmbeddedPiranha

      public EmbeddedPiranha()
      Constructor.
    • EmbeddedPiranha

      public EmbeddedPiranha(WebApplication webApplication)
      Constructor.
      Parameters:
      webApplication - the web application to use.
  • Method Details

    • destroy

      public EmbeddedPiranha destroy()
      Destroy the web application.
      Returns:
      the instance.
    • getWebApplication

      public WebApplication getWebApplication()
      {
      Returns:
      the web application}
    • initialize

      public EmbeddedPiranha initialize()
      Initialize the web application.
      Returns:
      the instance.
    • service

      public EmbeddedResponse service(String servletPath, String... parameters) throws IOException, jakarta.servlet.ServletException
      This method services a request by dispatching it to the configured Servlet and/or Filters.
      Parameters:
      servletPath - the request path, e.g. /foo/bar
      parameters - the request parameters, with each even parameter the name, and odd parameter the value. e.g. /foo, 1, bar, 2
      Returns:
      the response generated by the Servlet and/or Filters
      Throws:
      IOException - when an I/O error occurs.
      jakarta.servlet.ServletException - when a Servlet error occurs.
    • service

      public EmbeddedResponse service(WebApplicationRequest request) throws IOException, jakarta.servlet.ServletException
      This method services a request by dispatching it to the configured Servlet and/or Filters.
      Parameters:
      request - the request.
      Returns:
      the response generated by the Servlet and/or Filters
      Throws:
      IOException - when an I/O error occurs.
      jakarta.servlet.ServletException - when a Servlet error occurs.
    • 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.
    • start

      public EmbeddedPiranha start()
      Start the web application.
      Returns:
      the instance.
    • stop

      public EmbeddedPiranha stop()
      Stop the web application.
      Returns:
      the instance.