Package com.sun.net.httpserver

Examples of com.sun.net.httpserver.HttpServer.createContext()


            }
           
            HttpServer server = factory.createHttpServerInstance(httpListenPort);
            server.createContext("/getscreen", new ConsoleProxyThumbnailHandler());
            server.createContext("/resource/", new ConsoleProxyResourceHandler());
            server.createContext("/ajax", new ConsoleProxyAjaxHandler());
            server.createContext("/ajaximg", new ConsoleProxyAjaxImageHandler());
            server.setExecutor(new ThreadExecutor()); // creates a default executor
            server.start();
        } catch(Exception e) {
            s_logger.error(e.getMessage(), e);
View Full Code Here


           
            HttpServer server = factory.createHttpServerInstance(httpListenPort);
            server.createContext("/getscreen", new ConsoleProxyThumbnailHandler());
            server.createContext("/resource/", new ConsoleProxyResourceHandler());
            server.createContext("/ajax", new ConsoleProxyAjaxHandler());
            server.createContext("/ajaximg", new ConsoleProxyAjaxImageHandler());
            server.setExecutor(new ThreadExecutor()); // creates a default executor
            server.start();
        } catch(Exception e) {
            s_logger.error(e.getMessage(), e);
            System.exit(1);
View Full Code Here

   
    private static void startupHttpCmdPort() {
        try {
            s_logger.info("Listening for HTTP CMDs on port " + httpCmdListenPort);
            HttpServer cmdServer = HttpServer.create(new InetSocketAddress(httpCmdListenPort), 2);
            cmdServer.createContext("/cmd", new ConsoleProxyCmdHandler());
            cmdServer.setExecutor(new ThreadExecutor()); // creates a default executor
            cmdServer.start();
        } catch(Exception e) {
            s_logger.error(e.getMessage(), e);
            System.exit(1);
View Full Code Here

        } catch (IOException ioe) {
            throw new ProcessingException(LocalizationMessages.ERROR_CONTAINER_EXCEPTION_IO(), ioe);
        }

        server.setExecutor(Executors.newCachedThreadPool());
        server.createContext(path, handler);
        server.start();
        handler.onServerStart();

        return server;
    }
View Full Code Here

        addr = new InetSocketAddress(address, port);

        server = HttpServer.create(addr, 10);

        server.createContext("/ATOM", new GenericHandler("public_timeline.atom"));
        server.createContext("/RSS", new GenericHandler("public_timeline.rss"));
        server.createContext("/SOAP", new GenericHandler("simple_soap.xml"));
        server.createContext("/JSON", new GenericHandler("public_timeline.json"));
        server.createContext("/XML", new GenericHandler("public_timeline.xml"));
View Full Code Here

        addr = new InetSocketAddress(address, port);

        server = HttpServer.create(addr, 10);

        server.createContext("/ATOM", new GenericHandler("public_timeline.atom"));
        server.createContext("/RSS", new GenericHandler("public_timeline.rss"));
        server.createContext("/SOAP", new GenericHandler("simple_soap.xml"));
        server.createContext("/JSON", new GenericHandler("public_timeline.json"));
        server.createContext("/XML", new GenericHandler("public_timeline.xml"));

        server.createContext("/TEXT", new TEXTHandler());
View Full Code Here

        server = HttpServer.create(addr, 10);

        server.createContext("/ATOM", new GenericHandler("public_timeline.atom"));
        server.createContext("/RSS", new GenericHandler("public_timeline.rss"));
        server.createContext("/SOAP", new GenericHandler("simple_soap.xml"));
        server.createContext("/JSON", new GenericHandler("public_timeline.json"));
        server.createContext("/XML", new GenericHandler("public_timeline.xml"));

        server.createContext("/TEXT", new TEXTHandler());
        server.createContext("/TEXT2", new TEXTHandler());
View Full Code Here

        server = HttpServer.create(addr, 10);

        server.createContext("/ATOM", new GenericHandler("public_timeline.atom"));
        server.createContext("/RSS", new GenericHandler("public_timeline.rss"));
        server.createContext("/SOAP", new GenericHandler("simple_soap.xml"));
        server.createContext("/JSON", new GenericHandler("public_timeline.json"));
        server.createContext("/XML", new GenericHandler("public_timeline.xml"));

        server.createContext("/TEXT", new TEXTHandler());
        server.createContext("/TEXT2", new TEXTHandler());
View Full Code Here

        server.createContext("/ATOM", new GenericHandler("public_timeline.atom"));
        server.createContext("/RSS", new GenericHandler("public_timeline.rss"));
        server.createContext("/SOAP", new GenericHandler("simple_soap.xml"));
        server.createContext("/JSON", new GenericHandler("public_timeline.json"));
        server.createContext("/XML", new GenericHandler("public_timeline.xml"));

        server.createContext("/TEXT", new TEXTHandler());
        server.createContext("/TEXT2", new TEXTHandler());

        server.start();
View Full Code Here

        server.createContext("/RSS", new GenericHandler("public_timeline.rss"));
        server.createContext("/SOAP", new GenericHandler("simple_soap.xml"));
        server.createContext("/JSON", new GenericHandler("public_timeline.json"));
        server.createContext("/XML", new GenericHandler("public_timeline.xml"));

        server.createContext("/TEXT", new TEXTHandler());
        server.createContext("/TEXT2", new TEXTHandler());

        server.start();

        System.out.println("Server started on IP: " + address + ":" + port + " at " + df.format(new Date()));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.