public final class RouteAdapter extends java.lang.Object implements Route
Constructor and Description |
---|
RouteAdapter(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> delegate) |
Modifier and Type | Method and Description |
---|---|
static RouteAdapter |
apply(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> delegate) |
static Route |
asJava(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> delegate)
Java DSL: Adapt an existing ScalaDSL Route as an Java DSL Route
|
scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> |
delegate()
INTERNAL API
|
org.apache.pekko.stream.javadsl.Flow<HttpRequest,HttpResponse,org.apache.pekko.NotUsed> |
flow(org.apache.pekko.actor.ActorSystem system,
org.apache.pekko.stream.Materializer materializer) |
org.apache.pekko.japi.function.Function<HttpRequest,java.util.concurrent.CompletionStage<HttpResponse>> |
handler(org.apache.pekko.actor.ClassicActorSystemProvider system) |
Route |
orElse(Route alternative) |
Route |
seal()
Seals a route by wrapping it with default exception handling and rejection conversion.
|
Route |
seal(RejectionHandler rejectionHandler,
ExceptionHandler exceptionHandler)
Seals a route by wrapping it with explicit exception handling and rejection conversion.
|
java.lang.String |
toString() |
public RouteAdapter(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> delegate)
public static RouteAdapter apply(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> delegate)
public static Route asJava(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> delegate)
public scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> delegate()
Route
public org.apache.pekko.stream.javadsl.Flow<HttpRequest,HttpResponse,org.apache.pekko.NotUsed> flow(org.apache.pekko.actor.ActorSystem system, org.apache.pekko.stream.Materializer materializer)
public org.apache.pekko.japi.function.Function<HttpRequest,java.util.concurrent.CompletionStage<HttpResponse>> handler(org.apache.pekko.actor.ClassicActorSystemProvider system)
handler
in interface HandlerProvider
handler
in interface Route
public Route seal()
Route
A sealed route has these properties:
- The result of the route will always be a complete response, i.e. the result of the future is a
Success(RouteResult.Complete(response))
, never a failed future and never a rejected route. These
will be already be handled using the default RejectionHandler
and ExceptionHandler
.
- Consequently, no route alternatives will be tried that were combined with this route.
public Route seal(RejectionHandler rejectionHandler, ExceptionHandler exceptionHandler)
Route
A sealed route has these properties:
- The result of the route will always be a complete response, i.e. the result of the future is a
Success(RouteResult.Complete(response))
, never a failed future and never a rejected route. These
will be already be handled using the given RejectionHandler
and ExceptionHandler
.
- Consequently, no route alternatives will be tried that were combined with this route.
public java.lang.String toString()
toString
in class java.lang.Object