Interface GroovyRatpackServerSpec
-
- All Superinterfaces:
RatpackServerSpec
public interface GroovyRatpackServerSpec extends RatpackServerSpec
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static GroovyRatpackServerSpecfrom(RatpackServerSpec spec)GroovyRatpackServerSpechandler(Function<? super Registry,? extends Handler> handlerFactory)Sets the root handler to the return of the given function.default GroovyRatpackServerSpechandlers(Closure<?> handlers)GroovyRatpackServerSpecregistry(Function<? super Registry,? extends Registry> function)Sets the user registry as the return value of the given function.default GroovyRatpackServerSpecregistryOf(Closure<?> action)default GroovyRatpackServerSpecserverConfig(Closure<?> action)GroovyRatpackServerSpecserverConfig(Action<? super ServerConfigBuilder> action)GroovyRatpackServerSpecserverConfig(ServerConfig serverConfig)Sets the server configuration for the application.-
Methods inherited from interface ratpack.server.RatpackServerSpec
handler, handlers, registry, registryOf, serverConfig
-
-
-
-
Method Detail
-
from
static GroovyRatpackServerSpec from(RatpackServerSpec spec)
-
handlers
default GroovyRatpackServerSpec handlers(@DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> handlers)
-
handler
GroovyRatpackServerSpec handler(Function<? super Registry,? extends Handler> handlerFactory)
Description copied from interface:RatpackServerSpecSets the root handler to the return of the given function.The given function receives the effective server registry. This is the base registry (common Ratpack infrastructure)
joinedwith 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
Handlerstype 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).- Specified by:
handlerin interfaceRatpackServerSpec- Parameters:
handlerFactory- a factory for the root handler- Returns:
this- See Also:
Handlers,RatpackServerSpec.handlers(Action)
-
registry
GroovyRatpackServerSpec registry(Function<? super Registry,? extends Registry> function)
Description copied from interface:RatpackServerSpecSets the user registry as the return value of the given function.The 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 registrywill be used.- Specified by:
registryin interfaceRatpackServerSpec- Parameters:
function- a function that provides the user registry- Returns:
this
-
serverConfig
GroovyRatpackServerSpec serverConfig(ServerConfig serverConfig)
Description copied from interface:RatpackServerSpecSets the server configuration for the application.Server configs can be created via
ServerConfig.builder().- Specified by:
serverConfigin interfaceRatpackServerSpec- Parameters:
serverConfig- the server configuration- Returns:
this
-
serverConfig
GroovyRatpackServerSpec serverConfig(Action<? super ServerConfigBuilder> action) throws java.lang.Exception
- Specified by:
serverConfigin interfaceRatpackServerSpec- Throws:
java.lang.Exception
-
serverConfig
default GroovyRatpackServerSpec serverConfig(@DelegatesTo(value=ServerConfigBuilder.class,strategy=1) Closure<?> action) throws java.lang.Exception
- Throws:
java.lang.Exception
-
registryOf
default GroovyRatpackServerSpec registryOf(@DelegatesTo(value=RegistrySpec.class,strategy=1) Closure<?> action) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-