java.lang.Object
cloud.piranha.embedded.EmbeddedPiranha
- Direct Known Subclasses:
MicroEmbeddedPiranha
The embeddable servlet container version of Piranha.
- Author:
- Manfred Riem ([email protected])
-
Constructor Summary
ConstructorDescriptionConstructor.EmbeddedPiranha
(WebApplication webApplication) Another constructor. -
Method Summary
Modifier and TypeMethodDescriptiondestroy()
Destroy the web application.Returns the web application.Initialize the web application.service
(ServletRequest servletRequest) This method services a request by dispatching it to the configured Servlet and/or Filters.void
service
(ServletRequest servletRequest, ServletResponse servletResponse) Service method.This method services a request by dispatching it to the configured Servlet and/or Filters.start()
Start the web application.stop()
Stop the web application.
-
Constructor Details
-
EmbeddedPiranha
public EmbeddedPiranha()Constructor. -
EmbeddedPiranha
Another constructor.- Parameters:
webApplication
- the web application to use.
-
-
Method Details
-
destroy
Destroy the web application.- Returns:
- the instance.
-
getWebApplication
Returns the web application.- Returns:
- the web application
-
initialize
Initialize the web application.- Returns:
- the instance.
-
service
public EmbeddedResponse service(String servletPath, String... parameters) throws IOException, ServletException This method services a request by dispatching it to the configured Servlet and/or Filters.This is a convenience method for simple cases. Use the other service methods for more control of the request.
- 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.ServletException
- when a Servlet error occurs.
-
service
This method services a request by dispatching it to the configured Servlet and/or Filters.This is a convenience method uses
- Parameters:
servletRequest
- the request.- Returns:
- the response generated by the Servlet and/or Filters
- Throws:
IOException
- when an I/O error occurs.ServletException
- when a Servlet error occurs.
-
service
public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws IOException, ServletException Service method.- Parameters:
servletRequest
- the request.servletResponse
- the response.- Throws:
IOException
- when an I/O error occurs.ServletException
- when a Servlet error occurs.
-
start
Start the web application.- Returns:
- the instance.
-
stop
Stop the web application.- Returns:
- the instance.
-