public class Server extends Object
HttpHandler
s.
Suppose we have two types of web applications (HttpHandler
s)
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...Constructor and Description |
---|
Server() |
public static void main(String[] args)
Copyright © 2015 Oracle Corporation. All rights reserved.