Package org.mortbay.jetty

Examples of org.mortbay.jetty.Connector


            else
            {
                InputStream is = resource.getInputStream();
                try
                {
                    Connector connector = HttpConnection.getCurrentConnection().getConnector();
                    buffer = ((NIOConnector)connector).getUseDirectBuffers()?
                            (NIOBuffer)new DirectNIOBuffer((int)length):
                            (NIOBuffer)new IndirectNIOBuffer((int)length);
                               
                }
View Full Code Here


       
        // Find the resource and content
        Resource resource=null;
        HttpContent content=null;
       
        Connector connector = HttpConnection.getCurrentConnection().getConnector();
        ResourceCache cache=(connector instanceof NIOConnector) ?_nioCache:_bioCache;
        try
        {  
            // Try gzipped content first
            if (gzip)
View Full Code Here

    public static void main(String[] args)
        throws Exception
    {
        Server proxy = new Server();
        //SelectChannelConnector connector = new SelectChannelConnector();
        Connector connector = new SocketConnector();
        connector.setPort(8888);
        proxy.addConnector(connector);
        Context context = new Context(proxy,"/",0);
        context.addServlet(new ServletHolder(new AsyncProxyServlet.Transparent("","www.google.com",80)), "/");

        proxy.start();
View Full Code Here

    public void init(Properties props) throws Exception {
        port = Options.getInt(props, "port", 8080);
       
        // Create all the Jetty objects but dont' start them
        server = new Server();
        Connector connector = new SelectChannelConnector();
        connector.setPort(port);
        server.setConnectors(new Connector[]{connector});

        ContextHandler context = new ContextHandler();
        context.setContextPath("/");
        final ServletContext servletContext = context.getServletContext();
View Full Code Here

    public ServerTestFixture( final int port )
        throws Exception
    {
        server = new Server();

        Connector connector = new SelectChannelConnector();
        connector.setPort( port );

        server.setConnectors( new Connector[]{ connector } );

        Constraint constraint = new Constraint();
        constraint.setName( Constraint.__BASIC_AUTH );
View Full Code Here

        String connectorKey = endpoint.getProtocol() + ":" + endpoint.getPort();

        synchronized (connectors) {
            ConnectorRef connectorRef = connectors.get(connectorKey);
            if (connectorRef == null) {
                Connector connector;
                if ("https".equals(endpoint.getProtocol())) {
                    connector = new SslSocketConnector();
                } else {
                    connector = new SelectChannelConnector();
                }
                connector.setPort(endpoint.getPort());
                server.addConnector(connector);
                connector.start();
                connectorRef = new ConnectorRef(connector);
            } else {
                // ref track the connector
                connectorRef.increment();
            }
View Full Code Here

    // set up Jetty and run the embedded server

    Server server = new Server();

    Connector connector = new SelectChannelConnector();
    if(conf.getBoolean(REST_SSL_ENABLED, false)) {
      SslSelectChannelConnector sslConnector = new SslSelectChannelConnector();
      String keystore = conf.get(REST_SSL_KEYSTORE_STORE);
      String password = conf.get(REST_SSL_KEYSTORE_PASSWORD);
      String keyPassword = conf.get(REST_SSL_KEYSTORE_KEYPASSWORD, password);
      sslConnector.setKeystore(keystore);
      sslConnector.setPassword(password);
      sslConnector.setKeyPassword(keyPassword);
      connector = sslConnector;
    }
    connector.setPort(servlet.getConfiguration().getInt("hbase.rest.port", 8080));
    connector.setHost(servlet.getConfiguration().get("hbase.rest.host", "0.0.0.0"));

    server.addConnector(connector);

    // Set the default max thread number to 100 to limit
    // the number of concurrent requests so that REST server doesn't OOM easily.
View Full Code Here

    // set up Jetty and run the embedded server

    Server server = new Server();

    Connector connector = new SelectChannelConnector();
    connector.setPort(servlet.getConfiguration().getInt("hbase.rest.port", 8080));
    connector.setHost(servlet.getConfiguration().get("hbase.rest.host", "0.0.0.0"));

    server.addConnector(connector);

    // Set the default max thread number to 100 to limit
    // the number of concurrent requests so that REST server doesn't OOM easily.
View Full Code Here

        String connectorKey = endpoint.getProtocol() + ":" + endpoint.getPort();

        synchronized (connectors) {
            ConnectorRef connectorRef = connectors.get(connectorKey);
            if (connectorRef == null) {
                Connector connector;
                if ("https".equals(endpoint.getProtocol())) {
                    connector = getSslSocketConnector();
                } else {
                    connector = new SelectChannelConnector();
                }
                connector.setPort(endpoint.getPort());
                getServer().addConnector(connector);
                // check the session support
                if (endpoint.isSessionSupport()) {
                    enableSessionSupport();
                }
                connector.start();
                connectorRef = new ConnectorRef(connector);
                connectors.put(connectorKey, connectorRef);
            } else {
                // ref track the connector
                connectorRef.increment();
View Full Code Here

      this("localhost", port, cacheManager, configuration);
   }

   private void init(RestServerConfiguration configuration) {
      org.mortbay.jetty.Server server = new org.mortbay.jetty.Server();
      Connector connector = new SelectChannelConnector();
      connector.setHost(host);
      connector.setPort(port);
      server.addConnector(connector);
      context = new Context(server, "/", Context.SESSIONS);
      context.setInitParams(Collections.singletonMap("resteasy.resources", "org.infinispan.rest.Server"));
      context.addEventListener(new ResteasyBootstrap());
      context.addServlet(HttpServletDispatcher.class, "/rest/*");
 
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.Connector

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.