Piranha is a cloud native extensible runtime, which delivers various integration libraries facilitating running applications in a non application server centric way. Some examples of integration libraries include JakartaEE libraries, as well as MicroProfile libraries, and integration libraries for various web frameworks, such as Faces, Vaadin, Wicket, etceteras.
A traditional Enterprise Java runtime is an installed application server acting as a deployment target, which supports running multiple applications via archives, which are each isolated by classloaders, and serves these applications via remote protocols such as HTTP.
Piranha’s scalable architecture can strip away all these features until only the bare libraries remain. A web application can be run having only the libraries on the flat classpath, and not even having an HTTP server running.
Piranha can scale down to essentially a serverless framework, or you can use it as a unit testing framework, all the way up to something more akin to a traditional application server, and many steps in between.
The cloud deployment model focusses on small, immutable units. With containers like Docker and platforms like Kubernetes, the archive and deployment features of a traditional application server are not necessarily needed anymore, but the Jakarta EE and MicroProfile APIs themselves are still really useful. Piranha can focus on only these APIs, and completely omitting (not just hiding) all functionality related to archives and deployment, making it optimally suited for a cloud environment.
Because traditional Jakarta EE products come with the deployment model, there is a bit more involved with testing code. Tools like Arquillian make integration testing quite easy, but often developers like a more unit testing oriented approach as well.
EmbeddedPiranha piranha = new
EmbeddedPiranhaBuilder()
.servlet("SnoopServlet",
SnoopServlet.class.getName())
.servletMapping("SnoopServlet", "/SnoopServlet")
.build()
.start();
EmbeddedRequest
request = new
EmbeddedRequestBuilder()
.servletPath("/SnoopServlet")
.build();
EmbeddedResponse
response = new
EmbeddedResponseBuilder()
.build();
piranha.service(request, response);
assertTrue(response.getResponseAsString().endsWith("SUCCESS"));
piranha.stop()
.destroy();
JAVA CHAMPION
SPEC/PROJECT LEAD
DUKE CHOICE AWARD