Package io.dropwizard.jetty

Examples of io.dropwizard.jetty.HttpConnectorFactory


    private class FakeApplication extends Application<Configuration> {
        @Override
        public void run(Configuration configuration, Environment environment) {
            final SimpleServerFactory serverConfig = new SimpleServerFactory();
            configuration.setServerFactory(serverConfig);
            final HttpConnectorFactory connectorConfig = (HttpConnectorFactory) serverConfig.getConnector();
            connectorConfig.setPort(0);

            environment.healthChecks().register("dummy", new DummyHealthCheck());

            for (Object resource : resources) {
                environment.jersey().register(resource);
View Full Code Here


        assertThat(http.getApplicationContextPath()).isEqualTo("/service");
    }

    @Test
    public void testGetPort() {
        final HttpConnectorFactory connector = (HttpConnectorFactory) http.getConnector();
        assertThat(connector.getPort()).isEqualTo(0);
    }
View Full Code Here

    SingularityHostAndPortProvider(final SingularityConfiguration configuration, @Named(HOST_ADDRESS_PROPERTY) String hostAddress) {
      checkNotNull(configuration, "configuration is null");
      this.hostname = !Strings.isNullOrEmpty(configuration.getHostname()) ? configuration.getHostname() : JavaUtils.getHostName().or(hostAddress);

      SimpleServerFactory simpleServerFactory = (SimpleServerFactory) configuration.getServerFactory();
      HttpConnectorFactory httpFactory = (HttpConnectorFactory) simpleServerFactory.getConnector();

      this.httpPort = httpFactory.getPort();
    }
View Full Code Here

    final DefaultServerFactory serverFactory = new DefaultServerFactory();
    if (noHttp) {
      serverFactory.setApplicationConnectors(Collections.<ConnectorFactory>emptyList());
      serverFactory.setAdminConnectors(Collections.<ConnectorFactory>emptyList());
    } else {
      final HttpConnectorFactory serviceConnector = new HttpConnectorFactory();
      serviceConnector.setPort(httpEndpoint.getPort());
      serviceConnector.setBindHost(httpEndpoint.getHostString());
      serverFactory.setApplicationConnectors(ImmutableList.<ConnectorFactory>of(serviceConnector));

      final HttpConnectorFactory adminConnector = new HttpConnectorFactory();
      adminConnector.setPort(adminPort);
      serverFactory.setAdminConnectors(ImmutableList.<ConnectorFactory>of(adminConnector));
    }
    return serverFactory;
  }
View Full Code Here

TOP

Related Classes of io.dropwizard.jetty.HttpConnectorFactory

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.