Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Grizzly fit in with Glassfish?

I know Glassfish uses a component called Grizzly but I am unsure of to exactly what role Grizzly performs. I have read that it is a 'front-end' for Glassfish. Is this correct? What exactly does Grizzly do, say when a HTTP request comes in or a response is being send back, does it pass through Grizzly first? And if so, for what reason?

like image 387
sonicboom Avatar asked Jan 09 '13 21:01

sonicboom


People also ask

What is Grizzly framework?

Grizzly web server framework has been designed to help developers to take advantage of the Java non-blocking I/O (NIO) API. Grizzly's goal is to help developers to build scalable and robust servers using NIO as well as offering extended framework components: web framework (HTTP/S), WebSocket, Comet. Grizzly.

What is Grizzly web server?

Grizzly is an HTTP Listener using Java's NIO technology and implemented entirely in Java. This re-usable, NIO–based framework can be used for any HTTP related operations (HTTP Listener/Connector) as well as non-HTTP operations, thus allowing the creation of any type of scalable multi-threaded server.


2 Answers

Grizzly does all of the heavy NIO lifting on behalf of one or more of the different containers within GlassFish. It's much like the connector functionality of Tomcat. The Connectors do the network operations on behalf of the core web container.

In the case of HTTP, Grizzly is responsible for parsing and serializing HTTP request/responses. It also provides the infrastructure to allow Servlet Async support to function. In the case of EE7, Grizzly also provides the functionality necessary to support non-blocking I/O within Servlets.

like image 72
rlubke Avatar answered Nov 09 '22 23:11

rlubke


Right from the project home page:

The Grizzly NIO and Web framework has been designed to help developers to take advantage of the Java™ NIO API. Grizzly's goal is to help developers to build scalable and robust servers using NIO and we are also offering extended framework components: Web Framework (HTTP/S), Bayeux Protocol, Servlet, HttpService OSGi and Comet.

A Users Guide is available along with code examples which demonstrate its various usages.

Please see the Grizzly project on Java.net for more details, and how to participate.

like image 33
John Yeary Avatar answered Nov 10 '22 01:11

John Yeary