Package org.apache.tomcat.lite.http.HttpChannel

Examples of org.apache.tomcat.lite.http.HttpChannel.HttpService


        mCtx.addWrapper("/sleep/10", new SleepCallback().sleep(10000).setData(
                "sleep 1"));

        mCtx.addWrapper("/chunked/*", new StaticContentService().setData("AAAA")
                .chunked());
        mCtx.addWrapper("/helloClose", new HttpService() {
            @Override
            public void service(HttpRequest httpReq, HttpResponse httpRes)
                    throws IOException {
                httpRes.setHeader("Connection", "close");
                httpRes.getBodyWriter().write("Hello");
View Full Code Here


    }

    public void testCallbacks() throws IOException {
        // already accepted - will change
        serverConnector.setHttpService(new HttpService() {
            public void service(HttpRequest httpReq, HttpResponse httpRes)
                    throws IOException {

                headersDone = true;
                HttpChannel http = httpReq.getHttpChannel();
View Full Code Here

        runService(ch, true);
    }

    public void runService(HttpChannel ch, boolean recycle) {
        MappingData mapRes = ch.getRequest().getMappingData();
        HttpService h = (HttpService) mapRes.getServiceObject();
        try {
            h.service(ch.getRequest(), ch.getResponse());
            if (!ch.getRequest().isAsyncStarted()) {
                ch.complete();
                if (recycle) {
                    ch.release(); // recycle objects.
                }
View Full Code Here

            mapRes.recycle();

            mapper.map(httpReq.serverName(),
                  httpReq.decodedURI(), mapRes);

          HttpService h = (HttpService) mapRes.getServiceObject();

          if (h != null) {
              if (debug) {
                  log.info(">>>>>>>> START: " + http.getRequest().method() + " " +
                      http.getRequest().decodedURI() + " " +
                      h.getClass().getSimpleName());
              }

              if (mapRes.service.selectorThread || noThread) {
                  runService(http, recycle);
              } else {
View Full Code Here

    @Override
    public void init() throws Exception {
        registry = Registry.getRegistry(null, null);
        httpConnServer = HttpServer.newServer(port);

        httpConnServer.getDispatcher().setDefaultService(new HttpService() {
            @Override
            public void service(HttpRequest httpReq, HttpResponse httpRes)
                    throws IOException {
                coyoteService(httpReq, httpRes);
            }
View Full Code Here

TOP

Related Classes of org.apache.tomcat.lite.http.HttpChannel.HttpService

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.