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 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)
default GroovyRatpackServerSpec
serverConfig(Closure<?> action)
GroovyRatpackServerSpec
serverConfig(ServerConfig serverConfig)
Sets the server configuration for the application.GroovyRatpackServerSpec
serverConfig(Action<? super ServerConfigBuilder> action)
-
Methods inherited from interface ratpack.core.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:RatpackServerSpec
Sets 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)
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).- Specified by:
handler
in 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:RatpackServerSpec
Sets 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 registry
will be used.- Specified by:
registry
in interfaceRatpackServerSpec
- Parameters:
function
- a function that provides the user registry- Returns:
this
-
serverConfig
GroovyRatpackServerSpec serverConfig(ServerConfig serverConfig)
Description copied from interface:RatpackServerSpec
Sets the server configuration for the application.Server configs can be created via
ServerConfig.builder()
.- Specified by:
serverConfig
in interfaceRatpackServerSpec
- Parameters:
serverConfig
- the server configuration- Returns:
this
-
serverConfig
GroovyRatpackServerSpec serverConfig(Action<? super ServerConfigBuilder> action) throws Exception
- Specified by:
serverConfig
in interfaceRatpackServerSpec
- Throws:
Exception
-
serverConfig
default GroovyRatpackServerSpec serverConfig(@DelegatesTo(value=ServerConfigBuilder.class,strategy=1) Closure<?> action) throws Exception
- Throws:
Exception
-
registryOf
default GroovyRatpackServerSpec registryOf(@DelegatesTo(value=RegistrySpec.class,strategy=1) Closure<?> action) throws Exception
- Throws:
Exception
-
-