Package org.mortbay.jetty.bio

Examples of org.mortbay.jetty.bio.SocketConnector


    Context staticContext = new Context(clientFacingServer, "/static");
    staticContext.addServlet(new ServletHolder(new StaticServlet()), "/");
    Context context = new Context(clientFacingServer, "/");
    context.addServlet(new ServletHolder(new TraceClientServlet()), "/");
    boolean connected = false;
    SocketConnector socket = null;
   
    // Keep trying ports until we can connect
    while (!connected) {
      try {
        socket = new SocketConnector();
        socket.setPort(clientPort);
        clientFacingServer.addConnector(socket);
        clientFacingServer.start();
        connected = true;
      } catch (Exception e) {
        if (e instanceof BindException) {
View Full Code Here


       
        threadPool = new ThreadPoolExecutor(maxThreads, maxQueue, keepAliveTime, TimeUnit.SECONDS, queue);

        this.setThreadPool(new ThreadPoolExecutorAdapter(threadPool));
       
        Connector connector = new SocketConnector();
        connector.setPort(port);
        connector.setHost(host);
        connector.setMaxIdleTime(Configurations.getInteger("refine.connection.max_idle_time",60000));
        connector.setStatsOn(false);
        this.addConnector(connector);

        File webapp = new File(Configurations.get("refine.webapp","main/webapp"));

        if (!isWebapp(webapp)) {
View Full Code Here

        if (repository == null) {
            repository = super.getRepository();
        }

        if (connector == null) {
            connector = new SocketConnector();
            connector.setHost("localhost");
            connector.setPort(0);
        }

        if (server == null) {
View Full Code Here

public class Start {

  public static void main(String[] args) throws Exception {
    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

public class Start {

  public static void main(String[] args) throws Exception {
    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

   * @param staticContent folder where static content lives
   * @throws UnknownHostException
   */
  public static Server getServer(int port, String staticContent) throws UnknownHostException{
    Server webServer = new org.mortbay.jetty.Server();
    SocketConnector listener = new SocketConnector();
    listener.setPort(port);
    listener.setHost("127.0.0.1");
    webServer.addConnector(listener);
    ContextHandler staticContext = new ContextHandler();
    staticContext.setContextPath("/");
    staticContext.setResourceBase(staticContent);
    staticContext.addHandler(new ResourceHandler());
View Full Code Here

        if (repository == null) {
            repository = super.getRepository();
        }

        if (connector == null) {
            connector = new SocketConnector();
            connector.setHost("localhost");
            connector.setPort(0);
        }

        if (server == null) {
View Full Code Here

public class Start {

  public static void main(String[] args) throws Exception {
    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

public class Start {

  public static void main(String[] args) throws Exception {
    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

      // Print out usage if we get to here.
      printUsageAndExit();
    }
    org.mortbay.jetty.Server webServer = new org.mortbay.jetty.Server();

    Connector connector = new SocketConnector();
    connector.setPort(port);
    connector.setHost(bindAddress);

    QueuedThreadPool pool = new QueuedThreadPool();
    pool.setMaxThreads(numThreads);

    webServer.addConnector(connector);
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.