Uses of Interface
ratpack.core.handling.Context
-
Packages that use Context Package Description ratpack.core.error Types that deal with handling application errors.ratpack.core.handling The handling of application requests.ratpack.core.health Health checks report on the status of key components in the system and are generally used for monitoring and reporting.ratpack.core.http The HTTP protocol.ratpack.core.parse Parsing in Ratpack refers to deserializing a request body into a Java object of some type.ratpack.core.render The renderer framework provides a pluggable mechanism for serializing objects to the response.ratpack.core.sse Support for Server Sent Events.ratpack.core.websocket Support for Websockets.ratpack.dropwizard.metrics Integration with Dropwizard Metrics Library.ratpack.groovy.handling Groovy specific extensions to classes in theratpack.core.handling
package.ratpack.groovy.render Specialised Groovy support for rendering.ratpack.groovy.template Support for templating based on embedded Groovy code in text. -
-
Uses of Context in ratpack.core.error
Methods in ratpack.core.error with parameters of type Context Modifier and Type Method Description void
ClientErrorHandler. error(Context context, int statusCode)
Handle a client error.void
ServerErrorHandler. error(Context context, Throwable throwable)
Processes the given exception that occurred processing the given context.default void
ServerErrorHandler. error(Context context, InvalidPathEncodingException exception)
Processes the given request path encoding error that occurred processing the given context. -
Uses of Context in ratpack.core.handling
Fields in ratpack.core.handling with type parameters of type Context Modifier and Type Field Description static com.google.common.reflect.TypeToken<Context>
Context. TYPE
A type token for this type.Methods in ratpack.core.handling that return Context Modifier and Type Method Description Context
Context. getContext()
Returns this.default Context
Context. header(CharSequence name, Object... values)
Sets a response header.Methods in ratpack.core.handling with parameters of type Context Modifier and Type Method Description void
Handler. handle(Context ctx)
Handles the context.void
InjectionHandler. handle(Context context)
Invokes the custom "handle" method, extracting necessary parameters from the context to satisfy the call.default void
RequestLogger. handle(Context ctx)
AddsRequestLogger.log(RequestOutcome)
as acontext close action
, effectively logging the request.void
ResponseTimer. handle(Context ctx)
Adds the number of milliseconds of elapsed time betweenRequest.getTimestamp()
and when the response is ready to be sent.void
Redirector. redirect(Context context, int code, Object to)
Issues a HTTP redirect response, transforming the givento
value into a value for theLocation
header.Method parameters in ratpack.core.handling with type arguments of type Context Modifier and Type Method Description default Chain
Chain. onlyIf(Predicate<? super Context> test, Class<? extends Handler> handler)
default Chain
Chain. onlyIf(Predicate<? super Context> test, Handler handler)
Invokes the given handler only if the predicate passes.static Handler
Handlers. onlyIf(Predicate<? super Context> test, Handler handler)
Creates a handler that delegates to the given handler if the predicate applies to the context.default Chain
Chain. when(Predicate<? super Context> test, Class<? extends Action<? super Chain>> action)
default Chain
Chain. when(Predicate<? super Context> test, Class<? extends Action<? super Chain>> onTrue, Class<? extends Action<? super Chain>> onFalse)
default Chain
Chain. when(Predicate<? super Context> test, Action<? super Chain> action)
default Chain
Chain. when(Predicate<? super Context> test, Action<? super Chain> onTrue, Action<? super Chain> onFalse)
static Handler
Handlers. when(Predicate<? super Context> test, Handler handler)
Creates a handler that inserts and delegates the given handler if the predicate applies to the context.static Handler
Handlers. whenOrElse(Predicate<? super Context> test, Handler ifHandler, Handler elseHandler)
Creates a handler that inserts and delegates to the appropriate handler depending if the predicate applies to the context. -
Uses of Context in ratpack.core.health
Methods in ratpack.core.health with parameters of type Context Modifier and Type Method Description void
HealthCheckHandler. handle(Context ctx)
Renders health checks. -
Uses of Context in ratpack.core.http
Methods in ratpack.core.http with parameters of type Context Modifier and Type Method Description void
ResponseChunks. render(Context context)
Render this object to the response. -
Uses of Context in ratpack.core.parse
Methods in ratpack.core.parse with parameters of type Context Modifier and Type Method Description protected abstract <T> T
NoOptParserSupport. parse(Context context, TypedData requestBody, com.google.common.reflect.TypeToken<T> type)
The parser implementation.<T> T
NoOptParserSupport. parse(Context context, TypedData requestBody, Parse<T,Void> parse)
Delegates toNoOptParserSupport.parse(Context, TypedData, TypeToken)
, discarding the opts object of the givenparse
.<T> T
Parser. parse(Context context, TypedData requestBody, Parse<T,O> parse)
Deserializes the request body of the context into an object. -
Uses of Context in ratpack.core.render
Methods in ratpack.core.render with parameters of type Context Modifier and Type Method Description Promise<T>
RenderableDecorator. decorate(Context context, T object)
Decorates the given object on its way to being rendered.void
Renderable. render(Context context)
Render this object to the response.void
Renderer. render(Context context, T object)
Render the given object to the response.abstract void
RendererSupport. render(Context ctx, T t)
Render the given object to the response.Method parameters in ratpack.core.render with type arguments of type Context Modifier and Type Method Description static <T> RenderableDecorator<T>
RenderableDecorator. of(Class<T> type, BiFunction<? super Context,? super T,? extends T> impl)
Creates a renderable decorator implementation for the given type that uses the function as decorator.static <T> Renderer<T>
Renderer. of(Class<T> type, BiConsumer<? super Context,? super T> impl)
Creates a renderer implementation from the given arguments.static <T> RenderableDecorator<T>
RenderableDecorator. ofAsync(Class<T> type, BiFunction<? super Context,? super T,? extends Promise<T>> impl)
Creates a renderable decorator implementation for the given type that uses the function as decorator. -
Uses of Context in ratpack.core.sse
Methods in ratpack.core.sse with parameters of type Context Modifier and Type Method Description void
ServerSentEvents. render(Context context)
Render this object to the response. -
Uses of Context in ratpack.core.websocket
Methods in ratpack.core.websocket with parameters of type Context Modifier and Type Method Description static void
WebSockets. websocket(Context context, WebSocketHandler<?> handler)
static <T> WebSocketConnector<T>
WebSockets. websocket(Context context, Function<WebSocket,T> openAction)
static void
WebSockets. websocketBroadcast(Context context, Publisher<String> broadcaster)
Sets up a websocket that sends the published Strings to a client.static void
WebSockets. websocketByteBufBroadcast(Context context, Publisher<io.netty.buffer.ByteBuf> broadcaster)
Sets up a websocket that sends the published byte buffers to a client. -
Uses of Context in ratpack.dropwizard.metrics
Methods in ratpack.dropwizard.metrics with parameters of type Context Modifier and Type Method Description void
MetricsPrometheusHandler. handle(Context ctx)
void
MetricsWebsocketBroadcastHandler. handle(Context context)
-
Uses of Context in ratpack.groovy.handling
Subinterfaces of Context in ratpack.groovy.handling Modifier and Type Interface Description interface
GroovyContext
Subclass ofContext
that adds Groovy friendly variants of methods.Methods in ratpack.groovy.handling with parameters of type Context Modifier and Type Method Description static GroovyContext
GroovyContext. from(Context ctx)
Creates a Groovy context from a context.void
GroovyHandler. handle(Context context)
Delegates toGroovyHandler.handle(GroovyContext)
.Method parameters in ratpack.groovy.handling with type arguments of type Context Modifier and Type Method Description default GroovyChain
GroovyChain. onlyIf(Predicate<? super Context> test, Closure<?> handler)
default GroovyChain
GroovyChain. onlyIf(Predicate<? super Context> test, Class<? extends Handler> handler)
default GroovyChain
GroovyChain. onlyIf(Predicate<? super Context> test, Handler handler)
Invokes the given handler only if the predicate passes.default GroovyChain
GroovyChain. when(Predicate<? super Context> test, Closure<?> handlers)
default GroovyChain
GroovyChain. when(Predicate<? super Context> test, Closure<?> ifHandlers, Closure<?> elseHandlers)
default GroovyChain
GroovyChain. when(Predicate<? super Context> test, Class<? extends Action<? super Chain>> action)
default GroovyChain
GroovyChain. when(Predicate<? super Context> test, Class<? extends Action<? super Chain>> onTrue, Class<? extends Action<? super Chain>> onFalse)
default GroovyChain
GroovyChain. when(Predicate<? super Context> test, Action<? super Chain> action)
default GroovyChain
GroovyChain. when(Predicate<? super Context> test, Action<? super Chain> onTrue, Action<? super Chain> onFalse)
-
Uses of Context in ratpack.groovy.render
Methods in ratpack.groovy.render with parameters of type Context Modifier and Type Method Description void
GroovyRendererSupport. render(Context ctx, T object)
Delegates toGroovyRendererSupport.render(GroovyContext, Object)
, wrapping the givencontext
in aGroovyContext
. -
Uses of Context in ratpack.groovy.template
Methods in ratpack.groovy.template with parameters of type Context Modifier and Type Method Description void
Markup. render(Context context)
-