congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Connector.getConnectionFactories
Code IndexAdd Tabnine to your IDE (free)

How to use
getConnectionFactories
method
in
org.eclipse.jetty.server.Connector

Best Java code snippets using org.eclipse.jetty.server.Connector.getConnectionFactories (Showing top 16 results out of 315)

origin: stackoverflow.com

 Server server = new Server(port);
for(Connector y : server.getConnectors()) {
  for(ConnectionFactory x  : y.getConnectionFactories()) {
    if(x instanceof HttpConnectionFactory) {
      ((HttpConnectionFactory)x).getHttpConfiguration().setSendServerVersion(false);
    }
  }
}
origin: org.springframework.boot/spring-boot

@Override
public void customize(Server server) {
  ForwardedRequestCustomizer customizer = new ForwardedRequestCustomizer();
  for (Connector connector : server.getConnectors()) {
    for (ConnectionFactory connectionFactory : connector
        .getConnectionFactories()) {
      if (connectionFactory instanceof HttpConfiguration.ConnectionFactory) {
        ((HttpConfiguration.ConnectionFactory) connectionFactory)
            .getHttpConfiguration().addCustomizer(customizer);
      }
    }
  }
}
origin: gocd/gocd

@Test
public void shouldNotSendAServerHeaderForSecurityReasons() throws Exception {
  HttpConnectionFactory httpConnectionFactory = getHttpConnectionFactory(sslSocketConnector.getConnector().getConnectionFactories());
  HttpConfiguration configuration = httpConnectionFactory.getHttpConfiguration();
  assertThat(configuration.getSendServerVersion(), is(false));
}
origin: line/armeria

private static Server startHttp1() throws Exception {
  final Server server = new Server(0);
  final ServletHandler handler = new ServletHandler();
  handler.addServletWithMapping(newServletHolder(thriftServlet), TSERVLET_PATH);
  handler.addServletWithMapping(newServletHolder(rootServlet), "/");
  handler.addFilterWithMapping(new FilterHolder(new ConnectionCloseFilter()), "/*",
                 EnumSet.of(DispatcherType.REQUEST));
  server.setHandler(handler);
  for (Connector c : server.getConnectors()) {
    for (ConnectionFactory f : c.getConnectionFactories()) {
      for (String p : f.getProtocols()) {
        if (p.startsWith("h2c")) {
          fail("Attempted to create a Jetty server without HTTP/2 support, but failed: " +
             f.getProtocols());
        }
      }
    }
  }
  server.start();
  return server;
}
origin: cn.home1/oss-lib-webmvc-spring-boot-1.4.1.RELEASE

@SuppressWarnings("unchecked")
static <T> Collection<T> connectorConnectionFactories(final Connector connector,
 final Class<T> ofType) {
 final Collection<T> connectionFactories = newLinkedHashSet();
 final ConnectionFactory defaultConnectionFactory = connector.getDefaultConnectionFactory();
 if (defaultConnectionFactory != null
  && ofType.isAssignableFrom(defaultConnectionFactory.getClass())) {
  connectionFactories.add((T) defaultConnectionFactory);
 }
 connectionFactories.addAll(connector.getConnectionFactories().stream()
  .filter(connectionFactory -> ofType.isAssignableFrom(connectionFactory.getClass()))
  .map(connectionFactory -> (T) connectionFactory).collect(toList()));
 return connectionFactories;
}
origin: cn.home1/oss-lib-webmvc-spring-boot-1.4.2.RELEASE

@SuppressWarnings("unchecked")
static <T> Collection<T> connectorConnectionFactories(final Connector connector,
 final Class<T> ofType) {
 final Collection<T> connectionFactories = newLinkedHashSet();
 final ConnectionFactory defaultConnectionFactory = connector.getDefaultConnectionFactory();
 if (defaultConnectionFactory != null
  && ofType.isAssignableFrom(defaultConnectionFactory.getClass())) {
  connectionFactories.add((T) defaultConnectionFactory);
 }
 connectionFactories.addAll(connector.getConnectionFactories().stream()
  .filter(connectionFactory -> ofType.isAssignableFrom(connectionFactory.getClass()))
  .map(connectionFactory -> (T) connectionFactory).collect(toList()));
 return connectionFactories;
}
origin: codeine-cd/codeine

protected int startServer(ContextHandlerCollection contexts, Server jettyServer) throws Exception {
  ((HttpConnectionFactory) jettyServer.getConnectors()[0].getConnectionFactories().iterator().next())
    .getHttpConfiguration().setRequestHeaderSize(30000);
  jettyServer.setHandler(contexts);
  if (injector.getInstance(GlobalConfigurationJsonStore.class).get().prometheus_enabled()) {
    registerPrometheus();
  }
  jettyServer.start();
  return ((ServerConnector) jettyServer.getConnectors()[0]).getLocalPort();
}
origin: airbnb/billow

  private static void configureConnectors(Server server) {
    for (Connector c : server.getConnectors()) {
      for (ConnectionFactory f : c.getConnectionFactories())
        if (f instanceof HttpConnectionFactory) {
          final HttpConfiguration httpConf =
              ((HttpConnectionFactory) f).getHttpConfiguration();
          httpConf.setSendServerVersion(false);
          httpConf.setSendDateHeader(false);
        }
    }
  }
}
origin: jenkinsci/maven-hpi-plugin

public void configureScanner() throws MojoExecutionException {
  // use a bigger buffer as Stapler traces can get pretty large on deeply nested URL
  // this can only be done after server.start() is called, which happens in AbstractJettyMojo.startJetty()
  // and this configureScanner method is one of the few places that are run afterward.
  for (Connector con : server.getConnectors()) {
    for (ConnectionFactory cf : con.getConnectionFactories()) {
      if (cf instanceof HttpConnectionFactory) {
        HttpConnectionFactory hcf = (HttpConnectionFactory) cf;
        hcf.getHttpConfiguration().setResponseHeaderSize(12*1024);
      }
    }
  }
  setUpScanList();
  scannerListeners = new ArrayList<Scanner.BulkListener>();
  scannerListeners.add(new Scanner.BulkListener() {
    public void filesChanged(List<String> changes) {
      try {
        restartWebApp(changes.contains(getProject().getFile().getCanonicalPath()));
      } catch (Exception e) {
        getLog().error("Error reconfiguring/restarting webapp after change in watched files", e);
      }
    }
  });
}
origin: org.ops4j.pax.web/pax-web-jetty

@Override
public void removeCustomizers(Collection<Customizer> customizers)	{
  Connector[] connectors = jettyServer.getConnectors();
  for (Connector connector : connectors) {
    Collection<ConnectionFactory> connectionFactories = connector.getConnectionFactories();
    for (ConnectionFactory connectionFactory : connectionFactories) {
      if (connectionFactory instanceof HttpConnectionFactory) {
        HttpConnectionFactory httpConnectionFactory = (HttpConnectionFactory) connectionFactory;
        HttpConfiguration httpConfiguration = httpConnectionFactory.getHttpConfiguration();
        List<Customizer> httpConfigurationCustomizers = httpConfiguration.getCustomizers();
        httpConfigurationCustomizers.removeAll(customizers);
      }
    }
  }
}
origin: org.ops4j.pax.web/pax-web-jetty

@Override
public void addCustomizers(Collection<Customizer> customizers) {
  Connector[] connectors = jettyServer.getConnectors();
  for (Connector connector : connectors) {
    Collection<ConnectionFactory> connectionFactories = connector.getConnectionFactories();
    for (ConnectionFactory connectionFactory : connectionFactories) {
      if (connectionFactory instanceof HttpConnectionFactory) {
        HttpConnectionFactory httpConnectionFactory = (HttpConnectionFactory) connectionFactory;
        HttpConfiguration httpConfiguration = httpConnectionFactory.getHttpConfiguration();
        if (priorityComparator == null) {
          for (Customizer customizer : customizers) {
            httpConfiguration.addCustomizer(customizer);
          }
        } else {
          List<Customizer> httpConfigurationCustomizers = httpConfiguration.getCustomizers();
          httpConfigurationCustomizers.addAll(customizers);
          @SuppressWarnings("unchecked")
          Comparator<Customizer> comparator = (Comparator<Customizer>) priorityComparator;
          Collections.sort(httpConfigurationCustomizers, comparator);
        }
      }
    }
  }
}
origin: com.ngdata/hbase-indexer-server

log.debug("REST headerBufferSize: " + headerBufferSize);        
for (Connector connector : server.getConnectors()) {
 for (org.eclipse.jetty.server.ConnectionFactory factory : connector.getConnectionFactories()) {
  if (factory instanceof HttpConnectionFactory) {
   log.debug("REST headerBufferSize forced to: " + headerBufferSize);        
origin: com.erudika/para-server

for (ConnectionFactory cf : y.getConnectionFactories()) {
  if (cf instanceof HttpConnectionFactory) {
    HttpConnectionFactory dcf = (HttpConnectionFactory) cf;
origin: Erudika/para

for (ConnectionFactory cf : y.getConnectionFactories()) {
  if (cf instanceof HttpConnectionFactory) {
    HttpConnectionFactory dcf = (HttpConnectionFactory) cf;
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server

for (ConnectionFactory f : getConnector().getConnectionFactories())
origin: jenkinsci/winstone

for (ConnectionFactory f : getConnector().getConnectionFactories())
org.eclipse.jetty.serverConnectorgetConnectionFactories

Popular methods of Connector

  • setPort
  • stop
  • getLocalPort
  • getName
  • start
  • getServer
  • setHost
    Set the hostname of the interface to bind to.
  • getPort
  • getConnectionFactory
  • getExecutor
  • getHost
  • getByteBufferPool
  • getHost,
  • getByteBufferPool,
  • close,
  • getProtocols,
  • getScheduler,
  • isConfidential,
  • isIntegral,
  • shutdown,
  • getDefaultConnectionFactory

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • addToBackStack (FragmentTransaction)
  • setScale (BigDecimal)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • ImageIO (javax.imageio)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now