JettyBuilder

sealed class JettyBuilder[F[_]] extends ServletContainer[F] with ServerBuilder[F]
Companion
object
class ServletContainer[F]
trait ServerBuilder[F]
trait BackendBuilder[F, Server]
class Object
trait Matchable
class Any

Type members

Types

type Self = JettyBuilder[F]

Value members

Concrete methods

override def bindSocketAddress(socketAddress: InetSocketAddress): Self
Definition Classes
ServerBuilder
override def mountFilter(filter: Filter, urlMapping: String, name: Option[String], dispatches: EnumSet[DispatcherType]): Self
Definition Classes
ServletContainer
def mountHttpApp(service: HttpApp[F], prefix: String): Self
def mountService(service: HttpRoutes[F], prefix: String): Self
override def mountServlet(servlet: HttpServlet, urlMapping: String, name: Option[String]): Self
Definition Classes
ServletContainer
def resource: Resource[F, Server]
def withAsyncTimeout(asyncTimeout: Duration): Self
def withBanner(banner: Seq[String]): Self

Enables HTTP/2 connection upgrade over plain text (no TLS). See https://webtide.com/introduction-to-http2-in-jetty

Enables HTTP/2 connection upgrade over plain text (no TLS). See https://webtide.com/introduction-to-http2-in-jetty

def withIdleTimeout(idleTimeout: Duration): Self
def withJettyHttpConfiguration(value: HttpConfiguration): Self

Provide a specific org.eclipse.jetty.server.HttpConfiguration.

Provide a specific org.eclipse.jetty.server.HttpConfiguration.

This can be used for direct low level control over many HTTP related configuration settings which http4s may not directly expose.

def withServiceErrorHandler(serviceErrorHandler: () => F): Self
override def withServletIo(servletIo: ServletIo[F]): Self
Definition Classes
ServletContainer
def withShutdownTimeout(shutdownTimeout: Duration): Self

Sets the graceful shutdown timeout for Jetty. Closing the resource will wait this long before a forcible stop.

Sets the graceful shutdown timeout for Jetty. Closing the resource will wait this long before a forcible stop.

def withSslContext(sslContext: SSLContext): Self

Configures the server with TLS, using the provided SSLContext and its default SSLParameters

Configures the server with TLS, using the provided SSLContext and its default SSLParameters

def withSslContextAndParameters(sslContext: SSLContext, sslParameters: SSLParameters): Self

Configures the server with TLS, using the provided SSLContext and its default SSLParameters

Configures the server with TLS, using the provided SSLContext and its default SSLParameters

def withThreadPoolResource(threadPoolResource: Resource[F, ThreadPool]): JettyBuilder[F]

Set the org.eclipse.jetty.util.thread.ThreadPool that Jetty will use.

Set the org.eclipse.jetty.util.thread.ThreadPool that Jetty will use.

It is recommended you use JettyThreadPools#resource to build this so that it will be gracefully shutdown when/if the Jetty server is shutdown.

Disables SSL.

Disables SSL.

Deprecated methods

@deprecated("Build an `SSLContext` from the first four parameters and use `withSslContext` (note lowercase). To also request client certificates, use `withSslContextAndParameters, calling either `.setWantClientAuth(true)` or `setNeedClientAuth(true)` on the `SSLParameters`.", "0.21.0-RC3")
def withSSL(keyStore: StoreInfo, keyManagerPassword: String, protocol: String, trustStore: Option[StoreInfo], clientAuth: SSLClientAuthMode): Self
Deprecated
@deprecated("Use `withSslContext` (note lowercase). To request client certificates, use `withSslContextAndParameters, calling either `.setWantClientAuth(true)` or `setNeedClientAuth(true)` on the `SSLParameters`.", "0.21.0-RC3")
def withSSLContext(sslContext: SSLContext, clientAuth: SSLClientAuthMode): Self
Deprecated
@deprecated(message = "Please use withThreadPoolResource instead and see JettyThreadPools.", since = "0.21.23")
def withThreadPool(threadPool: ThreadPool): JettyBuilder[F]

Set the org.eclipse.jetty.util.thread.ThreadPool that Jetty will use.

Set the org.eclipse.jetty.util.thread.ThreadPool that Jetty will use.

Note

You should prefer withThreadPoolResource instead of this method. If you invoke this method the provided org.eclipse.jetty.util.thread.ThreadPool ''will not'' be joined, stopped, or destroyed when/if the Jetty server stops. This is to preserve the <= 0.21.23 semantics.

Deprecated
[Since version 0.21.23] Please use withThreadPoolResource instead and see JettyThreadPools.

Inherited methods

def allocated: F[(Server, F[Unit])]

Returns an effect that allocates a backend and an F[Unit] to release it. The returned F waits until the backend is ready to process requests. The second element of the tuple shuts down the backend when run.

Returns an effect that allocates a backend and an F[Unit] to release it. The returned F waits until the backend is ready to process requests. The second element of the tuple shuts down the backend when run.

Unlike resource and stream, there is no automatic release of the backend. This function is intended for REPL sessions, tests, and other situations where composing a cats.effect.Resource or fs2.Stream is not tenable. resource or stream is recommended wherever possible.

Inherited from
BackendBuilder
final def bindAny(host: String): Self
Inherited from
ServerBuilder
final def bindHttp(port: Int, host: String): Self
Inherited from
ServerBuilder
final def bindLocal(port: Int): Self
Inherited from
ServerBuilder
final def serve: Stream[F, ExitCode]

Runs the server as a process that never emits. Useful for a server that runs for the rest of the JVM's life.

Runs the server as a process that never emits. Useful for a server that runs for the rest of the JVM's life.

Inherited from
ServerBuilder
final def serveWhile(terminateWhenTrue: Signal[F, Boolean], exitWith: Ref[F, ExitCode]): Stream[F, ExitCode]

Runs the server as a Stream that emits only when the terminated signal becomes true. Useful for servers with associated lifetime behaviors.

Runs the server as a Stream that emits only when the terminated signal becomes true. Useful for servers with associated lifetime behaviors.

Inherited from
ServerBuilder
def stream: Stream[F, Server]

Returns the backend as a single-element stream. The stream does not emit until the backend is ready to process requests. The backend is shut down when the stream is finalized.

Returns the backend as a single-element stream. The stream does not emit until the backend is ready to process requests. The backend is shut down when the stream is finalized.

Inherited from
BackendBuilder
final def withoutBanner: Self

Disable the banner when the server starts up

Disable the banner when the server starts up

Inherited from
ServerBuilder