Ejemplo n.º 1
0
 public HttpRouter() {
   dispatcher = new DispatcherImpl(this);
   // Route service to forward the package in thread pool
   routerService = new RouterService(this);
   routerService.register(dispatcher);
   // Global setting
   httpConfig = new HttpConfig();
   // Initialize request handler
   requestHandler = RequestHandler.getInstance();
 }
Ejemplo n.º 2
0
 /**
  * Forward a request immediately
  *
  * @param request HttpRequest to be forward
  */
 public void forward(HttpRequest request, int requestCode) {
   addRoute(request, requestCode);
   routerService.execute();
 }
Ejemplo n.º 3
0
 /** To forward all of request */
 public void forward() {
   routerService.execute();
 }
Ejemplo n.º 4
0
 public void addRoute(HttpRequest request, int requestCode) {
   routerService.addRoute(request, requestCode);
 }
Ejemplo n.º 5
0
 public void addRoute(HttpRequest request) {
   routerService.addRoute(request, 0);
 }