protected ContextHandlerCollection getContexts() { if (m_contexts == null) m_contexts = new ContextHandlerCollection(); return m_contexts; }
protected void createHttpServer() { final ContextHandlerCollection contexts; final ServletHolder servletHolder; final Context root; httpServer = new Server(port); contexts = new ContextHandlerCollection(); httpServer.setHandler(contexts); root = new Context(contexts, "/", Context.SESSIONS); servletHolder = new ServletHolder(new MainServlet()); servletHolder.setInitParameter("route_resolver", routeResolverClass().getName()); root.addServlet(servletHolder, "/*"); }
public JavaNetReverseProxy(File cacheFolder) throws Exception { this.cacheFolder = cacheFolder; cacheFolder.mkdirs(); server = new Server(); ContextHandlerCollection contexts = new ContextHandlerCollection(); server.setHandler(contexts); Context root = new Context(contexts, "/", Context.SESSIONS); root.addServlet(new ServletHolder(this), "/"); SocketConnector connector = new SocketConnector(); server.addConnector(connector); server.start(); localPort = connector.getLocalPort(); }
public JavaNetReverseProxy(File cacheFolder) throws Exception { this.cacheFolder = cacheFolder; cacheFolder.mkdirs(); server = new Server(); ContextHandlerCollection contexts = new ContextHandlerCollection(); server.setHandler(contexts); Context root = new Context(contexts, "/", Context.SESSIONS); root.addServlet(new ServletHolder(this), "/"); SocketConnector connector = new SocketConnector(); server.addConnector(connector); server.start(); localPort = connector.getLocalPort(); }
public JavaNetReverseProxy(File cacheFolder) throws Exception { this.cacheFolder = cacheFolder; cacheFolder.mkdirs(); server = new Server(); ContextHandlerCollection contexts = new ContextHandlerCollection(); server.setHandler(contexts); Context root = new Context(contexts, "/", Context.SESSIONS); root.addServlet(new ServletHolder(this), "/"); SocketConnector connector = new SocketConnector(); server.addConnector(connector); server.start(); localPort = connector.getLocalPort(); }
ContextHandlerCollection contexts = new ContextHandlerCollection(); RequestLog requestLog = HttpRequestLog.getRequestLog(name);
webServer.setThreadPool(threadPool); ContextHandlerCollection contexts = new ContextHandlerCollection(); RequestLog requestLog = HttpRequestLog.getRequestLog(name);
ContextHandlerCollection contexts = new ContextHandlerCollection(); webServer.setHandler(contexts); webAppContext = new WebAppContext();
ContextHandlerCollection contexts = new ContextHandlerCollection();
public EmbeddedWebServer(String host, int port) { server = new Server(); handler = new ContextHandlerCollection(); root = new Context(handler, "/", new SessionHandler(), null, null, null); if (EMPTY.equals(Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_KEYSTORE)) || EMPTY.equals(Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_KEYSTOREPASS)) || EMPTY.equals(Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_TRUSTSTORE)) || EMPTY.equals(Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_TRUSTSTOREPASS))) { sock = new SocketConnector(); usingSsl = false; } else { SslSocketConnector sslSock = new SslSocketConnector(); AccumuloConfiguration conf = Monitor.getSystemConfiguration(); // Restrict the protocols on the server socket final String includeProtocols = conf.get(Property.MONITOR_SSL_INCLUDE_PROTOCOLS); if (null != includeProtocols && !includeProtocols.isEmpty()) { String[] protocols = StringUtils.split(includeProtocols, ','); sslSock = new TLSSocketConnector(protocols); } sslSock.setKeystore(conf.get(Property.MONITOR_SSL_KEYSTORE)); sslSock.setKeyPassword(conf.get(Property.MONITOR_SSL_KEYSTOREPASS)); sslSock.setTruststore(conf.get(Property.MONITOR_SSL_TRUSTSTORE)); sslSock.setTrustPassword(conf.get(Property.MONITOR_SSL_TRUSTSTOREPASS)); usingSsl = true; sock = sslSock; } sock.setHost(host); sock.setPort(port); }
ContextHandlerCollection contexts = new ContextHandlerCollection(); RequestLog requestLog = HttpRequestLog.getRequestLog(name);
ContextHandlerCollection contexts = new ContextHandlerCollection();
ContextHandlerCollection contexts = new ContextHandlerCollection(); RequestLog requestLog = HttpRequestLog.getRequestLog(name);
ContextHandlerCollection contexts = new ContextHandlerCollection(); webServer.setHandler(contexts); webAppContext = new WebAppContext();
ContextHandlerCollection contexts = new ContextHandlerCollection(); webServer.setHandler(contexts);
ContextHandlerCollection contexts = new ContextHandlerCollection(); webServer.setHandler(contexts);
public static void main(String[] args) throws Exception { Server server = new Server(8080); ContextHandlerCollection contexts = new ContextHandlerCollection(); server.setHandler(contexts); Context root = new Context(contexts,"/",Context.SESSIONS); root.addServlet(new ServletHolder(new HelloServlet("Ciao")), "/*"); Context other = new Context(contexts,"/other",Context.SESSIONS); other.addServlet("org.mortbay.jetty.example.ManyServletContexts$HelloServlet", "/*"); StatisticsHandler stats = new StatisticsHandler(); contexts.addHandler(stats); Context yetanother =new Context(stats,"/yo",Context.SESSIONS); yetanother.addServlet(new ServletHolder(new HelloServlet("YO!")), "/*"); server.start(); server.join(); }
public static void main(String[] args) throws Exception { Server server = new Server(); Connector connector=new SelectChannelConnector(); connector.setPort(8080); server.setConnectors(new Connector[]{connector}); ContextHandler context0 = new ContextHandler(); context0.setContextPath("/zero"); Handler handler0=new HelloHandler(); context0.setHandler(handler0); ContextHandler context1 = new ContextHandler(); context1.setContextPath("/one"); Handler handler1=new HelloHandler(); context1.setHandler(handler1); ContextHandlerCollection contexts = new ContextHandlerCollection(); contexts.setHandlers(new Handler[]{context0,context1}); HandlerCollection handlers = new HandlerCollection(); handlers.setHandlers(new Handler[]{contexts,new DefaultHandler()}); server.setHandler(handlers); server.start(); server.join(); }
public static void main(String[] args) throws Exception { final ContextHandlerCollection contexts; final HubConfiguration configuration; final Server server; final Context root; configuration = HubRegistry.registry().gridConfiguration().getHub(); server = new Server(configuration.getPort()); contexts = new ContextHandlerCollection(); server.setHandler(contexts); root = new Context(contexts, "/", Context.SESSIONS); root.addServlet(new ServletHolder(new HubServlet()), "/selenium-server/driver/*"); root.addServlet(new ServletHolder(new ConsoleServlet()), "/console"); root.addServlet(new ServletHolder(new RegistrationServlet()), "/registration-manager/register"); root.addServlet(new ServletHolder(new UnregistrationServlet()), "/registration-manager/unregister"); root.addServlet(new ServletHolder(new LifecycleManagerServlet()), "/lifecycle-manager"); root.addServlet(new ServletHolder(new HeartbeatServlet()), "/heartbeat"); startRemoteControlPoller(); ensureRemoteControlPollerStopOnShutdown(); server.start(); server.join(); }
public static void main(String[] args) throws Exception { final ContextHandlerCollection contexts; final HubConfiguration configuration; final Server server; final Context root; configuration = HubRegistry.registry().gridConfiguration().getHub(); server = new Server(configuration.getPort()); contexts = new ContextHandlerCollection(); server.setHandler(contexts); root = new Context(contexts, "/", Context.SESSIONS); root.addServlet(new ServletHolder(new HubServlet()), "/selenium-server/driver/*"); root.addServlet(new ServletHolder(new ConsoleServlet()), "/console"); root.addServlet(new ServletHolder(new RegistrationServlet()), "/registration-manager/register"); root.addServlet(new ServletHolder(new UnregistrationServlet()), "/registration-manager/unregister"); root.addServlet(new ServletHolder(new LifecycleManagerServlet()), "/lifecycle-manager"); root.addServlet(new ServletHolder(new HeartbeatServlet()), "/heartbeat"); startRemoteControlPoller(); ensureRemoteControlPollerStopOnShutdown(); server.start(); server.join(); }