Package | Description |
---|---|
ratpack.error |
Types that deal with handling application errors.
|
ratpack.exec |
The execution management.
|
ratpack.handling |
The handling of application requests.
|
ratpack.http |
The HTTP protocol.
|
ratpack.render |
The renderer framework provides a pluggable mechanism for serializing objects to the response.
|
ratpack.server |
Objects used to start a ratpack application.
|
ratpack.service |
Services participate in the application start/stop lifecycle.
|
ratpack.websocket |
Support for Websockets.
|
Modifier and Type | Method and Description |
---|---|
default void |
ServerErrorHandler.error(Context context,
InvalidPathEncodingException exception)
Processes the given request path encoding error that occurred processing the given context.
|
void |
ServerErrorHandler.error(Context context,
java.lang.Throwable throwable)
Processes the given exception that occurred processing the given context.
|
Modifier and Type | Method and Description |
---|---|
void |
ExecStarter.start(Action<? super Execution> initialExecutionSegment)
Starts the execution, with the given action as the initial segment.
|
default void |
ExecStarter.start(Operation operation)
Starts the execution, and executes the given operation.
|
default void |
Operation.then() |
void |
Operation.then(Block block) |
Modifier and Type | Method and Description |
---|---|
default Promise<T> |
Promise.next(Action<? super T> action)
Executes the provided, potentially asynchronous,
Action with the promised value as input. |
default Operation |
Promise.operation(Action<? super T> action)
Converts this promise to an operation which is effectively
action . |
default Promise<T> |
Promise.retry(int maxAttempts,
java.time.Duration delay,
BiAction<? super java.lang.Integer,? super java.lang.Throwable> onError)
Causes
this yielding the promised value to be retried on error, after a fixed delay. |
Modifier and Type | Method and Description |
---|---|
void |
Context.byMethod(Action<? super ByMethodSpec> action)
Respond to the request based on the request method.
|
void |
Context.clientError(int statusCode)
Forwards the error to the
ClientErrorHandler in this service. |
void |
Context.error(java.lang.Throwable throwable)
Handles any error thrown during request handling.
|
void |
Handler.handle(Context ctx)
Handles the context.
|
void |
Context.insert(Handler... handlers)
Inserts some handlers into the pipeline, then delegates to the first.
|
void |
Context.insert(Registry registry,
Handler... handlers)
Inserts some handlers into the pipeline to execute with the given registry, then delegates to the first.
|
default void |
Context.lastModified(java.util.Date lastModified,
java.lang.Runnable serve)
Convenience method for handling last-modified based HTTP caching.
|
void |
Context.lastModified(java.time.Instant lastModified,
java.lang.Runnable serve)
Convenience method for handling last-modified based HTTP caching.
|
void |
Context.next()
Delegate handling to the next handler in line.
|
void |
Context.next(Registry registry)
Invokes the next handler, after adding the given registry.
|
void |
Context.render(java.lang.Object object)
Render the given object, using the rendering framework.
|
Modifier and Type | Method and Description |
---|---|
void |
Response.send()
Sends the response back to the client, with no body.
|
void |
Response.send(byte[] bytes)
Sends the response, using "
application/octet-stream " as the content type (if a content type hasn't
already been set) and the given byte array as the response body. |
void |
Response.send(io.netty.buffer.ByteBuf buffer)
Sends the response, using "
application/octet-stream " as the content type (if a content type hasn't
already been set) and the given bytes as the response body. |
void |
Response.send(java.lang.CharSequence contentType,
byte[] bytes)
Sends the response, using the given content type and byte array as the response body.
|
void |
Response.send(java.lang.CharSequence contentType,
io.netty.buffer.ByteBuf buffer)
Sends the response, using the given content type and bytes as the response body.
|
void |
Response.send(java.lang.CharSequence contentType,
java.lang.String body)
Sends the response, using the given content type and string as the response body.
|
void |
Response.send(java.lang.String text)
Sends the response, using "
text/plain " as the content type and the given string as the response body. |
void |
Response.sendFile(java.nio.file.Path file)
Sends the response, using the file as the response body.
|
void |
Response.sendStream(Publisher<? extends io.netty.buffer.ByteBuf> stream)
Sends the response, streaming the bytes emitted by the given publisher.
|
Modifier and Type | Method and Description |
---|---|
Response |
Response.beforeSend(Action<? super Response> responseFinalizer)
Register a callback to execute with the response immediately before sending it to the client.
|
Modifier and Type | Method and Description |
---|---|
void |
Renderer.render(Context context,
T object)
Render the given object to the response.
|
Modifier and Type | Method and Description |
---|---|
default void |
Service.onStart(StartEvent event)
Deprecated.
|
default void |
Service.onStop(StopEvent event)
Deprecated.
|
void |
Stopper.stop()
Initiates the shutdown process for the running application.
|
Modifier and Type | Method and Description |
---|---|
default void |
Service.onStart(StartEvent event)
Server startup event.
|
default void |
Service.onStop(StopEvent event)
Server stop event.
|
Modifier and Type | Method and Description |
---|---|
void |
WebSocket.close() |
void |
WebSocket.close(int statusCode,
java.lang.String reason) |
void |
WebSocket.send(io.netty.buffer.ByteBuf text) |
void |
WebSocket.send(java.lang.String text) |