Examples of HttpServer


Examples of com.nabalive.framework.web.HttpServer

* Date: 10/20/11
*/
public class MainTestServer {

    public static void main(String args[]) throws InterruptedException {
        final HttpServer httpServer = new HttpServer();
        httpServer.setRestHandler(new MyRestHandler());

        httpServer.start();

        Thread.sleep(Long.MAX_VALUE);
    }
View Full Code Here

Examples of com.sun.net.httpserver.HttpServer

    public QpidRestAPI(final String addr, final int port, String broker, final int backlog, final String webroot)
        throws IOException
    {
        final InetSocketAddress inetaddr = (addr == null) ? new InetSocketAddress(port) :
                                                            new InetSocketAddress(addr, port);
        final HttpServer server = HttpServer.create(inetaddr, backlog);

        broker = (broker == null) ? inetaddr.getAddress().getHostAddress() + ":5672" : broker;

        Delegator fileserver = new Delegator(new FileServer(webroot + "/web", true));
        Delegator qpidserver  = new Delegator(new QpidServer(broker));

        Authenticator authenticator = new Authenticator(this.getClass().getCanonicalName(), webroot + "/authentication");

        server.setExecutor(Executors.newCachedThreadPool());
        server.createContext("/", fileserver);
        server.createContext("/ui", fileserver).setAuthenticator(authenticator);
        server.createContext("/qpid/connection", qpidserver).setAuthenticator(authenticator);
        server.start();
    }
View Full Code Here

Examples of com.volantis.testtools.server.HTTPServer

    /**
     * Test the assembly of messages
     */
    public void xtestAssembleMessage() throws Exception {

        HTTPServer assetServer = new HTTPServer(9999, 3);
        assetServer.start();

        MimeMessageAssembler mimeMessageAssembler = new MimeMessageAssembler() {
            protected void checkMessageConstraints(ArrayList imageAssets,
                                                   Integer maxMessageSize,
                                                   Integer maxImageSize,
View Full Code Here

Examples of io.vertx.core.http.HttpServer

    }

    @Test
    public void testGetHttpServer() throws Exception {
        jerseyServer.init(options);
        HttpServer server = jerseyServer.getHttpServer();
        assertEquals(httpServer, server);
    }
View Full Code Here

Examples of jrdesktop.server.http.HttpServer

        init();
    }     
   
    public static void init () {
        running = true;
        httpServer = new HttpServer();
        rt = new robot();
        clipbrdUtility = new ClipbrdUtility();
        SysTray.updateServerStatus(Commons.SERVER_STARTED);         
    }
View Full Code Here

Examples of kilim.http.HttpServer

*/

public class SimpleHttpServer {

    public static void main(String[] args) throws IOException {
        new HttpServer(7262, SimpleHttpSession.class);
        System.out.println("SimpleHttpServer listening on http://localhost:7262");
        System.out.println("From a browser, try http://localhost:7262/hello\n or http://localhost:7262/buy?code=200&desc=Rolls%20Royce");
    }
View Full Code Here

Examples of me.mabra.hellonzb.httpserver.nioengine.HttpServer

    if(server != null)
      return;
    else
    {
      server = new HttpServer(logger, HOME_URL, 8080);
      getHandler = server.getHttpHandler();
      jythonHandler = server.getJythonHandler();
    }

    // check files in web script directory and attach HTTP handler to them
View Full Code Here

Examples of net.pms.network.HTTPServer

    LogManager.getLogManager().readConfiguration(new ByteArrayInputStream("org.jaudiotagger.level=OFF".getBytes()));

    // Wrap System.err
    System.setErr(new PrintStream(new SystemErrWrapper(), true));

    server = new HTTPServer(configuration.getServerPort());

    /*
     * XXX: keep this here (i.e. after registerExtensions and before registerPlayers) so that plugins
     * can register custom players correctly (e.g. in the GUI) and/or add/replace custom formats
     *
 
View Full Code Here

Examples of net.reversehttp.HttpServer

        configureLogging();
        try {
            int port = (args.length > 0) ? Integer.parseInt(args[0]) : 8888;
            final Logger logger = Logger.getLogger(EndpointService.class.getName());
            logger.log(Level.FINE, "Starting on port " + port);
            HttpServer httpd = new NormalHttpServer(port,
                    new EndpointService(new Endpoint() {
                        public boolean acceptSubscriptionChange(String mode, String topic, String token, int leaseSeconds) {
                            System.out.println("Subscription change: "+mode+", "+topic+", "+token+", "+leaseSeconds);
                            return true;
                        }
                        public void handleDelivery(String topic, byte[] body) {
                            System.out.println("Received message:\n\"" + new String(body) + "\"");
                        }
                    }));
            httpd.serve();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

Examples of org.apache.avro.ipc.HttpServer

    TracePlugin dPlugin = new TracePlugin(conf);
   
    // Responders
    Responder bRes = new RecursingResponder(TestBasicTracing.advancedProtocol, bPlugin);
    bRes.addRPCPlugin(bPlugin);
    HttpServer server1 = new HttpServer(bRes, 21005);
    server1.start();

    Responder cRes = new EndpointResponder(TestBasicTracing.advancedProtocol);
    cRes.addRPCPlugin(cPlugin);
    HttpServer server2 = new HttpServer(cRes, 21006);
    server2.start();
   
    Responder dRes = new EndpointResponder(TestBasicTracing.advancedProtocol);
    dRes.addRPCPlugin(dPlugin);
    HttpServer server3 = new HttpServer(dRes, 21007);
    server3.start();
   
    // Root requestor
    HttpTransceiver trans = new HttpTransceiver(
        new URL("http://localhost:21005"));
   
    GenericRequestor r = new GenericRequestor(TestBasicTracing.advancedProtocol, trans);
    r.addRPCPlugin(aPlugin);
   
    GenericRecord params = new GenericData.Record(
        TestBasicTracing.advancedProtocol.getMessages().get("w").getRequest());
    params.put("req", 1);
   
    for (int i = 0; i < 40; i++) {
      r.request("w", params)
    }
   
    List<Span> allSpans = new ArrayList<Span>();
    allSpans.addAll(aPlugin.storage.getAllSpans());
    allSpans.addAll(bPlugin.storage.getAllSpans());
    allSpans.addAll(cPlugin.storage.getAllSpans());
    allSpans.addAll(dPlugin.storage.getAllSpans());

    SpanAggregationResults results = SpanAggregator.getFullSpans(allSpans);
   
    assertEquals(0, results.incompleteSpans.size());
    List<Span> merged = results.completeSpans;
    List<Trace> traces = SpanAggregator.getTraces(merged).traces;
   
    assertEquals(40, traces.size());
    TraceCollection collection = new TraceCollection(traces.get(0));
    for (Trace t: traces) {
      collection.addTrace(t);
    }
    server1.close();
    server2.close();
    server3.close();
    aPlugin.httpServer.close();
    aPlugin.clientFacingServer.stop();
    bPlugin.httpServer.close();
    bPlugin.clientFacingServer.stop();
    cPlugin.httpServer.close();
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.