Package net.reversehttp

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


        configureLogging();
        try {
            int port = (args.length > 0) ? Integer.parseInt(args[0]) : 8000;
      Logger.getLogger(TestReverseHttpService.class.getName()).log
    (Level.FINE, "Starting on port " + port);
            HttpServer httpd = new NormalHttpServer(port,
                    new TestNormalHttpService());
            httpd.serve();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

            String containerDomain = label + "." + hostAndPort;
            ServiceContainer container = new ServiceContainer(containerDomain);
            Address targetAddress = new Address("queue", containerDomain);
            container.bindName(targetAddress, new Sub(targetAddress, Address
                    .parse(sourceStr)));
            HttpServer httpd = new ReverseHttpServer(label, serverUrl,
                    container);
            httpd.serve();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

            String hostAndPort = (args.length > 1) ? args[1]
                    : "localhost:8000";

            URL reflectorUrl = new URL("http://" + hostAndPort + "/reversehttp");
            TestReverseHttpService service = new TestReverseHttpService();
            HttpServer httpd = new ReverseHttpServer(label, reflectorUrl,
                    service);
            ((ReverseHttpServer) httpd).addPropertyChangeListener(service);
            httpd.serve();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

            ServiceContainer container = new ServiceContainer(ownAddress
                    .getDomain());
            container.bindName(ownAddress, new Sub(ownAddress, Address
                    .parse(sourceStr)));
            HttpServer httpd = new NormalHttpServer(port, container);
            httpd.serve();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

TOP

Related Classes of net.reversehttp.HttpServer

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.