Package org.mortbay.jetty.bio

Examples of org.mortbay.jetty.bio.SocketConnector


            // Create the server
            Server server = new Server();
            ContextHandlerCollection contexts = new ContextHandlerCollection();
            server.setHandler(contexts);
           
            SocketConnector connector = new SocketConnector();
            String address = args[0];
            int colon = address.lastIndexOf(':');
            if (colon<0)
                connector.setPort(Integer.parseInt(address));
            else
            {
                connector.setHost(address.substring(0,colon));
                connector.setPort(Integer.parseInt(address.substring(colon+1)));
            }
            server.setConnectors(new Connector[]{connector});
           
            if (args.length<3)
            {
View Full Code Here


    server = new Server(port);
    // insecure: only use for tests!!!!
    server.setSessionIdManager(new HashSessionIdManager(new Random(random.nextLong())));
    new WebAppContext(server, path, context );

    SocketConnector connector = new SocketConnector();
    connector.setMaxIdleTime(1000 * 60 * 60);
    connector.setSoLingerTime(-1);
    connector.setPort(0);
    server.setConnectors(new Connector[]{connector});
    server.setStopAtShutdown( true );
   
    server.start();
    port = connector.getLocalPort();
  }
View Full Code Here

   
    if (Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_KEYSTORE) == ""
        || Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_KEYSTOREPASS) == ""
        || Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_TRUSTSTORE) == ""
        || Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_TRUSTSTOREPASS) == "") {
      sock = new SocketConnector();
      usingSsl = false;
    } else {
      sock = new SslSocketConnector();
      ((SslSocketConnector) sock).setKeystore(Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_KEYSTORE));
      ((SslSocketConnector) sock).setKeyPassword(Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_KEYSTOREPASS));
View Full Code Here

  public static void main( String[] args )
  {
    //System.setProperty("solr.solr.home", "../../../example/solr");

    Server server = new Server();
    SocketConnector connector = new SocketConnector();
    // Set some timeout options to make debugging easier.
    connector.setMaxIdleTime(1000 * 60 * 60);
    connector.setSoLingerTime(-1);
    connector.setPort(8080);
    server.setConnectors(new Connector[] { connector });
   
    WebAppContext bb = new WebAppContext();
    bb.setServer(server);
    bb.setContextPath("/");
View Full Code Here

    System.setProperty("org.mortbay.http.HttpRequest.maxFormContentSize", "1000000");
   
      // Create the server
      Server server=new Server();
     
      SocketConnector conn = new SocketConnector();
      conn.setPort(Oscar3Props.getInstance().port);
      if(Oscar3Props.getInstance().lockdown) conn.setHost("127.0.0.1");
      server.addConnector(conn);

      String serverRoot = Oscar3Props.getInstance().serverRoot;
      Context context;
      if(serverRoot == null || serverRoot.equals("none")) {
View Full Code Here

   * @throws Exception
   */
  public static void launchServer() throws Exception {

      Server server=new Server();
      SocketConnector conn = new SocketConnector();
      conn.setPort(8182);
      if(Oscar3Props.getInstance().lockdown) conn.setHost("127.0.0.1");
      server.addConnector(conn);
     
      Context context = new Context(server, "/");
      context.addServlet("uk.ac.cam.ch.wwmm.oscar3server.ViewMolServlet", "/ViewMol");
     
View Full Code Here

    String path = "../../webapp/web";

    server = new Server(port);
    new WebAppContext(server, path, context );

    SocketConnector connector = new SocketConnector();
    connector.setMaxIdleTime(1000 * 60 * 60);
    connector.setSoLingerTime(-1);
    connector.setPort(0);
    server.setConnectors(new Connector[]{connector});
    server.setStopAtShutdown( true );
   
    server.start();
    port = connector.getLocalPort();
  }
View Full Code Here

    protected void startServer() throws Exception
    {
        logger.debug("server starting");
        Server server = new Server();
        Connector connector = new SocketConnector();
        connector.setPort(getPorts().get(1));
        server.setConnectors(new Connector[]{connector});

        ServletHandler handler = new ServletHandler();
        server.setHandler(handler);
View Full Code Here

    public static void main(String[] args) {
        final Server jettyServer = new Server();

        try {
            SocketConnector conn = new SocketConnector();
            String portVariable = System.getProperty("jetty.port");
            int port = parsePort(portVariable);
            if (port <= 0)
                port = 8080;
            conn.setPort(port);
            conn.setAcceptQueueSize(100);
            jettyServer.setConnectors(new Connector[] { conn });

            WebAppContext wah = new WebAppContext();
            wah.setContextPath("/geowebcache");
            wah.setWar("src/main/webapp");
View Full Code Here

public class Start
{
   public static void main(String[] args) throws Exception
   {
      Server server = new Server();
      SocketConnector connector = new SocketConnector();
      connector.setPort(9090);
      server.setConnectors(new Connector[] { connector });

      WebAppContext bb = new WebAppContext();
      bb.setServer(server);
      bb.setContextPath("/");
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.bio.SocketConnector

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.