Package org.apache.tomcat.lite.http

Examples of org.apache.tomcat.lite.http.HttpWriter


    @Override
    public void service(HttpRequest httpReq, HttpResponse httpRes)
            throws IOException {
        HttpConnectionPool sc = pool;
        HttpWriter out = httpRes.getBodyWriter();

        httpRes.setContentType("text/plain");
        // TODO: use JMX/DynamicObject to get all public info
        out.println("hosts=" + sc.getTargetCount());
        out.println("waiting=" + sc.getSocketCount());
        out.println("closed=" + sc.getClosedSockets());
        out.println();

        for (RemoteServer remote: sc.getServers()) {
            out.append(remote.target);
            out.append("=");
            List<HttpConnection> connections = remote.getConnections();
            out.println(Integer.toString(connections.size()));

            for (IOChannel ch: connections) {
                out.println(ch.getId() +
                        " " + ch.toString());
            }
            out.println();
        }

    }
View Full Code Here

TOP

Related Classes of org.apache.tomcat.lite.http.HttpWriter

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.