package io.dropwizard.jetty;

import com.codahale.metrics.MetricRegistry;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import io.dropwizard.jackson.Discoverable;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.thread.ThreadPool;

import javax.annotation.Nullable;

A factory for creating Jetty Connectors.
/** * A factory for creating Jetty {@link Connector}s. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") public interface ConnectorFactory extends Discoverable {
Create a new connector.
Params:
  • server – the application's Server instance
  • metrics – the application's metrics
  • name – the application's name
  • threadPool – the application's thread pool
Returns:a Connector
/** * Create a new connector. * * @param server the application's {@link Server} instance * @param metrics the application's metrics * @param name the application's name * @param threadPool the application's thread pool * @return a {@link Connector} */
Connector build(Server server, MetricRegistry metrics, String name, @Nullable ThreadPool threadPool); }