public interface GroovyRatpackServerSpec extends RatpackServerSpec
| Modifier and Type | Method and Description |
|---|---|
static GroovyRatpackServerSpec |
from(RatpackServerSpec spec) |
GroovyRatpackServerSpec |
handler(Function<? super Registry,? extends Handler> handlerFactory)
Sets the root handler to the return of the given function.
|
default GroovyRatpackServerSpec |
handlers(Closure<?> handlers) |
GroovyRatpackServerSpec |
registry(Function<? super Registry,? extends Registry> function)
Sets the user registry as the return value of the given function.
|
default GroovyRatpackServerSpec |
registryOf(Closure<?> action) |
GroovyRatpackServerSpec |
serverConfig(Action<? super ServerConfigBuilder> action) |
default GroovyRatpackServerSpec |
serverConfig(Closure<?> action) |
GroovyRatpackServerSpec |
serverConfig(ServerConfig serverConfig)
Sets the server configuration for the application.
|
handler, handlers, registry, registryOf, serverConfigstatic GroovyRatpackServerSpec from(RatpackServerSpec spec)
default GroovyRatpackServerSpec handlers(@DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> handlers)
GroovyRatpackServerSpec handler(Function<? super Registry,? extends Handler> handlerFactory)
RatpackServerSpec
The given function receives the effective server registry.
This is the base registry (common Ratpack infrastructure) joined with the user registry (i.e. the registry set on this spec).
All requests will be routed to the given handler.
Generally, it is more convenient to use the RatpackServerSpec.handlers(Action) method than this as it makes it easy to build a handler chain.
The Handlers type provides handler implementations that may be of use.
If a handler is not set, the handler returned by Handlers.notFound() will be used (i.e. all requests will result in a 404).
handler in interface RatpackServerSpechandlerFactory - a factory for the root handlerthisHandlers,
RatpackServerSpec.handlers(Action)GroovyRatpackServerSpec registry(Function<? super Registry,? extends Registry> function)
RatpackServerSpecThe given function receives the “base” registry (i.e. the base infrastructure provided by Ratpack) as its argument.
If a user registry is not set, an empty registry will be used.
registry in interface RatpackServerSpecfunction - a function that provides the user registrythisGroovyRatpackServerSpec serverConfig(ServerConfig serverConfig)
RatpackServerSpec
Server configs can be created via ServerConfig.builder().
serverConfig in interface RatpackServerSpecserverConfig - the server configurationthisGroovyRatpackServerSpec serverConfig(Action<? super ServerConfigBuilder> action) throws java.lang.Exception
serverConfig in interface RatpackServerSpecjava.lang.Exceptiondefault GroovyRatpackServerSpec serverConfig(@DelegatesTo(value=ServerConfigBuilder.class,strategy=1) Closure<?> action) throws java.lang.Exception
java.lang.Exceptiondefault GroovyRatpackServerSpec registryOf(@DelegatesTo(value=RegistrySpec.class,strategy=1) Closure<?> action) throws java.lang.Exception
java.lang.Exception