public abstract class GroovyChainAction extends java.lang.Object implements GroovyChain, ratpack.func.Action<ratpack.handling.Chain>
Action<GroovyChain>.
Subclasses implement the execute() method, and implicitly program against the GroovyChain DSL.
import ratpack.groovy.handling.GroovyChainAction
import ratpack.groovy.test.embed.GroovyEmbeddedApp
class Handlers extends GroovyChainAction {
public void execute() throws Exception {
path { render "root" }
prefix("foo") {
path("bar") { render "foobar" }
}
}
}
GroovyEmbeddedApp.of {
handlers new Handlers()
} test {
assert getText() == "root"
assert getText("foo/bar") == "foobar"
}
| Constructor and Description |
|---|
GroovyChainAction() |
| Modifier and Type | Method and Description |
|---|---|
GroovyChain |
all(ratpack.handling.Handler handler) |
abstract void |
execute()
Defines the handler chain.
|
void |
execute(ratpack.handling.Chain chain)
Invokes
execute() while setting the given chain as the implicit receiver. |
ratpack.registry.Registry |
getRegistry() |
ratpack.server.ServerConfig |
getServerConfig() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitall, all, chain, delete, delete, delete, delete, delete, delete, files, files, files, fileSystem, fileSystem, fileSystem, from, get, get, get, get, get, get, host, host, host, insert, insert, insert, notFound, onlyIf, onlyIf, onlyIf, onlyIf, onlyIf, onlyIf, options, options, options, options, options, options, patch, patch, patch, patch, patch, patch, path, path, path, path, path, path, post, post, post, post, post, post, prefix, prefix, prefix, put, put, put, put, put, put, redirect, register, register, register, register, register, register, register, register, register, when, when, when, when, when, when, when, when, when, when, when, when, when, when, when, when, when, whenpublic abstract void execute()
throws java.lang.Exception
java.lang.Exception - anypublic final void execute(ratpack.handling.Chain chain)
throws java.lang.Exception
execute() while setting the given chain as the implicit receiver.execute in interface ratpack.func.Action<ratpack.handling.Chain>chain - the handler chainjava.lang.Exception - anypublic GroovyChain all(ratpack.handling.Handler handler)
all in interface GroovyChainall in interface ratpack.handling.Chainpublic ratpack.server.ServerConfig getServerConfig()
getServerConfig in interface ratpack.handling.Chainpublic ratpack.registry.Registry getRegistry()
throws java.lang.IllegalStateException
getRegistry in interface ratpack.handling.Chainjava.lang.IllegalStateException