java.lang.Object
org.glassfish.grizzly.samples.httpserver.priorities.Server

public class Server extends Object
Example of HTTP server, which assigns different priorities (thread-pools) to registered HttpHandlers. Suppose we have two types of web applications (HttpHandlers) registered on NetworkListener. One of them is high-priority application we want to get response from as fast as possible (say some core service we use to check if server is running). Other application runs a long-lasting task, which may occupy a worker thread for significant amount of time, so, considering the thread-pool is limited, may impact other applications availability. How we can separate these two applications? There are two options: 1) we can use HttpHandler suspend/resume mechanism 2) lower level by-Request prioritization mechanism, which allows us to dispatch a Request processing to a proper thread-pool before passing control to HttpHandler.service(org.glassfish.grizzly.http.server.Request, org.glassfish.grizzly.http.server.Response) method. In this example we take the the 2nd approach...
Author:
Alexey Stashok
  • Constructor Details

    • Server

      public Server()
  • Method Details

    • main

      public static void main(String[] args)