Reformating configuration and examples for PDF (Scala, and leftovers). See #2413

This commit is contained in:
Björn Antonsson 2012-10-01 20:35:19 +02:00
parent 309bb53d98
commit 08ef942242
46 changed files with 330 additions and 191 deletions

View file

@ -12,12 +12,15 @@ import scala.Option;
public class ErrorThrowingConsumer extends UntypedConsumerActor{
private String uri;
private static Mapper<RouteDefinition, ProcessorDefinition<?>> mapper = new Mapper<RouteDefinition, ProcessorDefinition<?>>() {
public ProcessorDefinition<?> apply(RouteDefinition rd) {
// Catch any exception and handle it by returning the exception message as response
return rd.onException(Exception.class).handled(true).transform(Builder.exceptionMessage()).end();
}
};
private static Mapper<RouteDefinition, ProcessorDefinition<?>> mapper =
new Mapper<RouteDefinition, ProcessorDefinition<?>>() {
public ProcessorDefinition<?> apply(RouteDefinition rd) {
// Catch any exception and handle it by returning the exception message
// as response
return rd.onException(Exception.class).handled(true).
transform(Builder.exceptionMessage()).end();
}
};
public ErrorThrowingConsumer(String uri){
this.uri = uri;
@ -37,7 +40,8 @@ public class ErrorThrowingConsumer extends UntypedConsumerActor{
}
@Override
public Mapper<RouteDefinition, ProcessorDefinition<?>> getRouteDefinitionHandler() {
public Mapper<RouteDefinition,
ProcessorDefinition<?>> getRouteDefinitionHandler() {
return mapper;
}