aerogear-controller 1.0.0.M1

org.jboss.aerogear.controller.router
Interface RouteBuilder

All Known Implementing Classes:
RouteBuilderImpl

public interface RouteBuilder

RouteBuilder builds a Route using a fluent API.

Sample Usage:
RouteBuilder routeBuilder = ...;
     routeBuilder.from("/home")
                 .on(RequestMethod.GET)
                 .to(SampleController.class).index();
     Route route = routeBuilder.build();
 


Nested Class Summary
static interface RouteBuilder.OnMethods
          A fluent API for further specializing the Route's destination/endpoint.
static interface RouteBuilder.TargetEndpoint
          Describes the target destination for the Route.
 
Method Summary
 Route build()
          Builds a Route using the information gathered from this builder.
 RouteBuilder.OnMethods from(String path)
          Specifies the request path that the Route will handle request from.
 RouteBuilder.TargetEndpoint on(Class<? extends Throwable> exception, Class<?>... exceptions)
          Specifies that this route should be able to handle any of the types of exceptions passed-in.
 

Method Detail

on

RouteBuilder.TargetEndpoint on(Class<? extends Throwable> exception,
                               Class<?>... exceptions)
Specifies that this route should be able to handle any of the types of exceptions passed-in. The method is used to define an error route.

Parameters:
exception - a single class of type, or subtype, Throwable.
exceptions - zero or more classes of type, or subtypes, of Throwable.
Returns:
RouteBuilder.TargetEndpoint to enable further configuration of the route, such as * specifying the target class and method that will be called when the exception(s) are thrown.

from

RouteBuilder.OnMethods from(String path)
Specifies the request path that the Route will handle request from.

Parameters:
path - the request path that the Route will handle request from.
Returns:
RouteBuilder.OnMethods which enables further specialization of the types of requests that can be handled by the Route.

build

Route build()
Builds a Route using the information gathered from this builder.

Returns:
Route a Route instance configured by the this builder.

aerogear-controller 1.0.0.M1

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.