Package org.apache.http.protocol

Examples of org.apache.http.protocol.HttpRequestHandlerRegistry


                        new ResponseContent(),
                        new ResponseConnControl()
                });
        this.connStrategy = new DefaultConnectionReuseStrategy();
        this.responseFactory = new DefaultHttpResponseFactory();
        this.reqistry = new HttpRequestHandlerRegistry();
        this.serversocket = new ServerSocket(0);
    }
View Full Code Here


     * @param params    the parameters to be used by the server, or
     *                  <code>null</code> to use
     *                  {@link #newDefaultParams default} parameters
     */
    public LocalTestServer(BasicHttpProcessor proc, HttpParams params) {
        handlerRegistry = new HttpRequestHandlerRegistry();
        reuseStrategy = new DefaultConnectionReuseStrategy();
        httpProcessor = (proc != null) ? proc : newProcessor();
        serverParams = (params != null) ? params : newDefaultParams();
    }
View Full Code Here

  /**
   * Creates a new test server.
   */
  public LocalHttpServer()
  {
    this.handlerRegistry = new HttpRequestHandlerRegistry();
    this.httpProcessor = new BasicHttpProcessor();
    this.httpProcessor.addInterceptor(new ResponseDate());
    this.httpProcessor.addInterceptor(new ResponseServer());
    this.httpProcessor.addInterceptor(new ResponseContent());
    this.httpProcessor.addInterceptor(new ResponseConnControl());
View Full Code Here

    BasicHttpProcessor inProcessor = new BasicHttpProcessor();
    inProcessor.addInterceptor(new ResponseConnControl());
    inProcessor.addInterceptor(new ResponseContentCustom());
   
    HttpRequestHandlerRegistry registry = new HttpRequestHandlerRegistry();
    registry.register("*", new ProxyRequestHandler(this, logger, requestEngine));

    httpService = new VegaHttpService(inProcessor, new DefaultConnectionReuseStrategy(), new DefaultHttpResponseFactory(), registry, params, sslContextRepository);
   
    connectionList = new ArrayList<ConnectionTask>();
  }
View Full Code Here

            httpproc.addInterceptor(new ResponseServer());
            httpproc.addInterceptor(new ResponseContent());
            httpproc.addInterceptor(new ResponseConnControl());

            // Set up request handlers
            HttpRequestHandlerRegistry reqistry = new HttpRequestHandlerRegistry();
            reqistry.register("/clusterservice", requestHandler);

            // Set up the HTTP service
            _httpService = new HttpService(httpproc, new DefaultConnectionReuseStrategy(), new DefaultHttpResponseFactory());
            _httpService.setParams(_params);
            _httpService.setHandlerResolver(reqistry);
View Full Code Here

    private int referenceCounter;

    JhcServerEngine(HttpParams params, int port, String protocol) {
        this.params = params;
        serviceHandler = new AsyncBufferingHttpServiceHandler(params);
        handlerRegistry = new HttpRequestHandlerRegistry();
        serviceHandler.setHandlerResolver(handlerRegistry);
        this.port = port;
        this.protocol = protocol;
    }
View Full Code Here

            .setParameter(HttpProtocolParams.ORIGIN_SERVER, "Jakarta-HttpComponents-NIO/1.1");

        ListeningIOReactor ioReactor = new DefaultListeningIOReactor(2, params);

        // Set up request handlers
        HttpRequestHandlerRegistry reqistry = new HttpRequestHandlerRegistry();
        reqistry.register("*", new HttpFileHandler(args[0]));
       
        MyNHttpServiceHandler handler = new MyNHttpServiceHandler(reqistry, params);
        IOEventDispatch ioEventDispatch = new DefaultServerIOEventDispatch(handler, params);
       
        try {
View Full Code Here

                    httpproc.addInterceptor(new ResponseServer());
                    httpproc.addInterceptor(new ResponseContent());
                    httpproc.addInterceptor(new ResponseConnControl());
                   
                    // Set up request handlers
                    HttpRequestHandlerRegistry reqistry = new HttpRequestHandlerRegistry();
                    reqistry.register("*", new HttpFileHandler(this.docRoot));
                   
                    // Set up the HTTP service
                    HttpService httpService = new HttpService(
                            httpproc,
                            new DefaultConnectionReuseStrategy(),
View Full Code Here

     */
    public LocalTestServer(final BasicHttpProcessor proc, final ConnectionReuseStrategy reuseStrat,
                           final HttpResponseFactory responseFactory, final HttpExpectationVerifier expectationVerifier,
                           final HttpParams params, final SSLContext sslcontext) {
        super();
        this.handlerRegistry = new HttpRequestHandlerRegistry();
        this.workers = Collections.synchronizedSet(new HashSet<Worker>());
        this.httpservice = new HttpService(proc != null ? proc : newProcessor(), reuseStrat != null ? reuseStrat
                : newConnectionReuseStrategy(), responseFactory != null ? responseFactory : newHttpResponseFactory(),
                handlerRegistry, expectationVerifier, params != null ? params : newDefaultParams());
        this.sslcontext = sslcontext;
View Full Code Here

            httpproc.addInterceptor(new ResponseServer());
            httpproc.addInterceptor(new ResponseContent());
            httpproc.addInterceptor(new ResponseConnControl());

            // Set up request handlers
            HttpRequestHandlerRegistry reqistry = new HttpRequestHandlerRegistry();
            reqistry.register("*", new HttpServiceHandler(server));

            // Set up the HTTP service
            this.httpService = new HttpService(httpproc, new DefaultConnectionReuseStrategy(),
                    new DefaultHttpResponseFactory());
            this.httpService.setParams(this.params);
View Full Code Here

TOP

Related Classes of org.apache.http.protocol.HttpRequestHandlerRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.