Package | Description |
---|---|
ratpack.groovy |
Support for writing Ratpack applications in the Groovy programming language.
|
ratpack.groovy.handling |
Groovy specific extensions to classes in the
ratpack.handling package. |
ratpack.groovy.test | |
ratpack.guice |
Integration with Google Guice.
|
ratpack.handling |
The handling of application requests.
|
ratpack.test | |
ratpack.test.embed |
Support for creating embedded applications at test time, for testing Ratpack features and extensions.
|
ratpack.test.handling |
Modifier and Type | Method and Description |
---|---|
static Action<Chain> |
Groovy.chain(Closure<?> closure)
Creates a chain action implementation from the given closure.
|
static Action<Chain> |
Groovy.chainAction(Closure<?> closure)
Creates a chain action based on the given closure.
|
Modifier and Type | Method and Description |
---|---|
static void |
Groovy.chain(Chain chain,
Closure<?> closure)
|
Modifier and Type | Interface and Description |
---|---|
interface |
GroovyChain
A Groovy oriented handler chain builder DSL.
|
Modifier and Type | Method and Description |
---|---|
GroovyChain |
GroovyChain.fileSystem(String path,
Action<? super Chain> action)
Adds a handler to this chain that changes the
FileSystemBinding for the given handler chain. |
GroovyChain |
GroovyChain.host(String hostName,
Action<? super Chain> action)
Adds a handler to the chain that delegates to the given handler chain if the request has a
Host header that matches the given value exactly. |
GroovyChain |
GroovyChain.insert(Action<? super Chain> action)
Inserts the given nested handler chain.
|
GroovyChain |
GroovyChain.prefix(String prefix,
Action<? super Chain> action)
Adds a handler that delegates to the given handlers if the
relative path starts with the given
prefix . |
GroovyChain |
GroovyChain.register(Action<? super RegistrySpec> registryAction,
Action<? super Chain> chainAction)
Adds a handler that inserts the given handler chain with a registry built by the given action via
Context.insert(ratpack.registry.Registry, Handler...) . |
GroovyChain |
GroovyChain.register(Registry registry,
Action<? super Chain> action)
Adds a handler that inserts the given handler chain with the given registry via
Context.insert(ratpack.registry.Registry, Handler...) . |
Modifier and Type | Method and Description |
---|---|
static HandlingResult |
GroovyUnitTest.handle(Action<? super Chain> handlers,
Closure<?> closure)
Unit test a chain of
handlers . |
Modifier and Type | Method and Description |
---|---|
Handler |
Guice.Builder.build(Action<? super Chain> action) |
Modifier and Type | Method and Description |
---|---|
Chain |
Chain.assets(String path,
String... indexFiles)
Adds a handler that serves static assets at the given file system path, relative to the contextual file system binding.
|
Chain |
Chain.delete(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is DELETE and the path is at the current root. |
Chain |
Chain.delete(String path,
Handler handler)
Adds a handler that delegates to the given handler if
the relative
path matches the given path and the request HTTPMethod
is DELETE . |
Chain |
Chain.fileSystem(String path,
Action<? super Chain> action)
Adds a handler to this chain that changes the
FileSystemBinding for the given handler chain. |
Chain |
Chain.get(Handler handler)
Adds a handler that delegates to the given handler
if the
request HTTPMethod is GET and the path is at the
current root. |
Chain |
Chain.get(String path,
Handler handler)
Adds a handler that delegates to the given handler
if the relative
path matches the given path and the request
HTTPMethod is GET . |
Chain |
Chain.handler(Handler handler)
Adds the given handler to this.
|
Chain |
Chain.handler(String path,
Handler handler)
Adds a handler that delegates to the given handler if the relative
path
matches the given path exactly. |
Chain |
Chain.header(String headerName,
String headerValue,
Handler handler)
Adds a handler to the chain that delegates to the given handler if the request has a header with the given name and a its value matches the given value exactly.
|
Chain |
Chain.host(String hostName,
Action<? super Chain> action)
Adds a handler to the chain that delegates to the given handler chain if the request has a
Host header that matches the given value exactly. |
Chain |
Chain.insert(Action<? super Chain> action)
Inserts the given nested handler chain.
|
Chain |
Chain.patch(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is PATCH and the path is at the current root. |
Chain |
Chain.patch(String path,
Handler handler)
Adds a handler that delegates to the given handler if
the relative
path matches the given path and the request HTTPMethod
is PATCH . |
Chain |
Chain.post(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is POST and the path is at the current root. |
Chain |
Chain.post(String path,
Handler handler)
Adds a handler that delegates to the given handler if
the relative
path matches the given path and the request HTTPMethod
is POST . |
Chain |
Chain.prefix(String prefix,
Action<? super Chain> action)
Adds a handler that delegates to the given handlers if the
relative path starts with the given
prefix . |
Chain |
Chain.put(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is PUT and the path is at the current root. |
Chain |
Chain.put(String path,
Handler handler)
Adds a handler that delegates to the given handler if
the relative
path matches the given path and the request HTTPMethod
is PUT . |
Chain |
Chain.redirect(int code,
String location)
Sends an HTTP redirect to the specified location.
|
Chain |
Chain.register(Action<? super RegistrySpec> action)
Builds a new registry via the given action, then registers it via
register(Registry) . |
Chain |
Chain.register(Action<? super RegistrySpec> registryAction,
Action<? super Chain> action)
Adds a handler that inserts the given handler chain with a registry built by the given action via
Context.insert(ratpack.registry.Registry, Handler...) . |
Chain |
Chain.register(Registry registry)
Makes the contents of the given registry available for downstream handlers of the same nesting level.
|
Chain |
Chain.register(Registry registry,
Action<? super Chain> action)
Adds a handler that inserts the given handler chain with the given registry via
Context.insert(ratpack.registry.Registry, Handler...) . |
Modifier and Type | Method and Description |
---|---|
Handler |
Chain.chain(Action<? super Chain> action)
Constructs a handler using the given action to define a chain.
|
static Handler |
Handlers.chain(LaunchConfig launchConfig,
Action<? super Chain> action)
Builds a handler chain, with no backing registry.
|
static Handler |
Handlers.chain(LaunchConfig launchConfig,
Registry registry,
Action<? super Chain> action)
Builds a chain, backed by the given registry.
|
Chain |
Chain.fileSystem(String path,
Action<? super Chain> action)
Adds a handler to this chain that changes the
FileSystemBinding for the given handler chain. |
Chain |
Chain.host(String hostName,
Action<? super Chain> action)
Adds a handler to the chain that delegates to the given handler chain if the request has a
Host header that matches the given value exactly. |
Chain |
Chain.insert(Action<? super Chain> action)
Inserts the given nested handler chain.
|
Chain |
Chain.prefix(String prefix,
Action<? super Chain> action)
Adds a handler that delegates to the given handlers if the
relative path starts with the given
prefix . |
Chain |
Chain.register(Action<? super RegistrySpec> registryAction,
Action<? super Chain> action)
Adds a handler that inserts the given handler chain with a registry built by the given action via
Context.insert(ratpack.registry.Registry, Handler...) . |
Chain |
Chain.register(Registry registry,
Action<? super Chain> action)
Adds a handler that inserts the given handler chain with the given registry via
Context.insert(ratpack.registry.Registry, Handler...) . |
Modifier and Type | Method and Description |
---|---|
static HandlingResult |
UnitTest.handle(Action<? super Chain> chainAction,
Action<? super RequestFixture> requestFixtureAction)
Unit test a
Handler chain. |
Modifier and Type | Method and Description |
---|---|
static EmbeddedApp |
EmbeddedApp.fromChain(Action<? super Chain> action)
Creates an embedded application with a default launch config (no base dir, ephemeral port) and the given handler chain.
|
Modifier and Type | Method and Description |
---|---|
HandlingResult |
RequestFixture.handleChain(Action<? super Chain> chainAction)
Similar to
RequestFixture.handle(ratpack.handling.Handler) , but for testing a handler chain. |