Examples of HttpServer


Examples of org.apache.directory.server.integration.http.HttpServer

        if ( ( httpServerBean == null ) || httpServerBean.isDisabled() )
        {
            return null;
        }

        HttpServer httpServer = new HttpServer();

        // HttpConfFile
        httpServer.setConfFile( httpServerBean.getHttpConfFile() );

        // The transports
        TransportBean[] transports = httpServerBean.getTransports();

        for ( TransportBean transportBean : transports )
        {
            if ( transportBean.isDisabled() )
            {
                continue;
            }

            if ( transportBean instanceof TcpTransportBean )
            {
                TcpTransport transport = new TcpTransport( transportBean.getSystemPort() );
                transport.setAddress( transportBean.getTransportAddress() );

                if ( transportBean.getTransportId().equalsIgnoreCase( HttpServer.HTTP_TRANSPORT_ID ) )
                {
                    httpServer.setHttpTransport( transport );
                }
                else if ( transportBean.getTransportId().equalsIgnoreCase( HttpServer.HTTPS_TRANSPORT_ID ) )
                {
                    httpServer.setHttpsTransport( transport );
                }
                else
                {
                    LOG.warn( "Transport ids of HttpServer should be either 'http' or 'https'" );
                }
            }
        }

        // The webApps
        httpServer.setWebApps( createHttpWebApps( httpServerBean.getHttpWebApps(), directoryService ) );

        return httpServer;
    }
View Full Code Here

Examples of org.apache.excalibur.instrument.manager.http.server.HTTPServer

        m_rootBreadCrumbLabel = configuration.getAttribute(
            "root-bread-crumb-label", m_rootBreadCrumbURL );
       
        String accessLogFile = configuration.getAttribute( "access-log", null );
       
        m_httpServer = new HTTPServer( m_port, m_bindAddr );
        m_httpServer.enableLogging( getLogger().getChildLogger( "server" ) );
        m_httpServer.setInstrumentableName( "server" );
        m_httpServer.setAccessLogFile( accessLogFile );
        addChildInstrumentable( m_httpServer );
    }
View Full Code Here

Examples of org.apache.hadoop.hbase.http.HttpServer

   * Test that the server is alive once started
   *
   * @throws Throwable on failure
   */
  @Test public void testCreatedServerIsNotAlive() throws Throwable {
    HttpServer server = createTestServer();
    assertNotLive(server);
  }
View Full Code Here

Examples of org.apache.hadoop.http.HttpServer

    //create a servlet to serve full-file content
    InetSocketAddress infoSocAddr = DataNode.getInfoAddr(conf);
    String infoHost = infoSocAddr.getHostName();
    int tmpInfoPort = infoSocAddr.getPort();
    this.infoServer = (secureResources == null)
       ? new HttpServer("datanode", infoHost, tmpInfoPort, tmpInfoPort == 0,
           conf, SecurityUtil.getAdminAcls(conf, DFSConfigKeys.DFS_ADMIN))
       : new HttpServer("datanode", infoHost, tmpInfoPort, tmpInfoPort == 0,
           conf, SecurityUtil.getAdminAcls(conf, DFSConfigKeys.DFS_ADMIN),
           secureResources.getListener());
    if (conf.getBoolean("dfs.https.enable", false)) {
      boolean needClientAuth = conf.getBoolean("dfs.https.need.client.auth", false);
      InetSocketAddress secInfoSocAddr = NetUtils.createSocketAddr(conf.get(
View Full Code Here

Examples of org.apache.hama.http.HttpServer

      startTime = System.currentTimeMillis();
      this.masterServer = RPC.getServer(this, host, port, conf);

      infoPort = conf.getInt("bsp.http.infoserver.port", 40013);

      infoServer = new HttpServer("bspmaster", host, infoPort, true, conf);
      infoServer.setAttribute("bsp.master", this);

      // starting webserver
      infoServer.start();
View Full Code Here

Examples of org.apache.http.impl.bootstrap.HttpServer

        SocketConfig socketConfig = SocketConfig.custom()
                .setSoTimeout(15000)
                .setTcpNoDelay(true)
                .build();

        final HttpServer server = ServerBootstrap.bootstrap()
                .setListenerPort(port)
                .setServerInfo("Test/1.1")
                .setSocketConfig(socketConfig)
                .setSslContext(sslcontext)
                .setExceptionLogger(new StdErrorExceptionLogger())
                .registerHandler("*", new HttpFileHandler(docRoot))
                .create();

        server.start();
        server.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS);

        Runtime.getRuntime().addShutdownHook(new Thread() {
            @Override
            public void run() {
                server.shutdown(5, TimeUnit.SECONDS);
            }
        });
    }
View Full Code Here

Examples of org.apache.http.impl.nio.bootstrap.HttpServer

        IOReactorConfig config = IOReactorConfig.custom()
                .setSoTimeout(15000)
                .setTcpNoDelay(true)
                .build();

        final HttpServer server = ServerBootstrap.bootstrap()
                .setListenerPort(port)
                .setServerInfo("Test/1.1")
                .setIOReactorConfig(config)
                .setSslContext(sslcontext)
                .setExceptionLogger(ExceptionLogger.STD_ERR)
                .registerHandler("*", new HttpFileHandler(docRoot))
                .create();

        server.start();
        server.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS);

        Runtime.getRuntime().addShutdownHook(new Thread() {
            @Override
            public void run() {
                server.shutdown(5, TimeUnit.SECONDS);
            }
        });

    }
View Full Code Here

Examples of org.apache.http.mockup.HttpServer

    private HttpServer server;
    private HttpClient client;

    protected void setUp() throws Exception {
        this.server = new HttpServer();
        this.client = new HttpClient();
    }
View Full Code Here

Examples of org.apache.http.testserver.HttpServer

    private HttpServer server;
    private HttpClient client;

    @Before
    public void initServer() throws Exception {
        this.server = new HttpServer();
    }
View Full Code Here

Examples of org.astrogrid.samp.httpd.HttpServer

    /**
     * Private constructor constructs sole instance.
     */
    private JSkyServer() throws IOException {
        httpServer_ = new HttpServer();
        httpServer_.setDaemon(true);

        /* Set up handler for custom resource serving. */
        resourceHandler_ = new ResourceHandler(httpServer_, "/dynamic");
        httpServer_.addHandler(resourceHandler_);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.