@Override public CloseableService get() { return reference.get().closeableService(); } }
@Override public AsyncContext get() { return reference.get().asyncContext(); } }
private static RuntimeException mapTargetToRuntimeEx(Throwable throwable) { if (throwable instanceof WebApplicationException) { return (WebApplicationException) throwable; } // handle all exceptions as potentially mappable (incl. ProcessingException) return new MappableException(throwable); }
@Override public UriRoutingContext get() { return reference.get().uriRoutingContext(); } }
/** * Construct a new mappable exception with the supplied message and cause. * * @param message the exception message. * @param cause the exception cause. */ public MappableException(String message, Throwable cause) { super(message, unwrap(cause)); }
private static Throwable unwrap(Throwable cause) { if (cause instanceof MappableException) { do { MappableException mce = (MappableException) cause; cause = mce.getCause(); } while (cause instanceof MappableException); } return cause; } }
@Override public Stage<ContainerResponse> createRespondingRoot() { return respondingContext.createRespondingRoot(); } }
@Override public void push(final Function<ContainerResponse, ContainerResponse> responseTransformation) { respondingContext.push(responseTransformation); }
private static RuntimeException mapTargetToRuntimeEx(Throwable throwable) { if (throwable instanceof WebApplicationException) { return (WebApplicationException) throwable; } // handle all exceptions as potentially mappable (incl. ProcessingException) return new MappableException(throwable); }
@Override public CloseableService get() { return reference.get().closeableService(); } }
@Override public AsyncContext get() { return reference.get().asyncContext(); } }
@Override public UriRoutingContext get() { return reference.get().uriRoutingContext(); } }
/** * Construct a new mappable exception with the supplied message and cause. * * @param message the exception message. * @param cause the exception cause. */ public MappableException(String message, Throwable cause) { super(message, unwrap(cause)); }
private static Throwable unwrap(Throwable cause) { if (cause instanceof MappableException) { do { MappableException mce = (MappableException) cause; cause = mce.getCause(); } while (cause instanceof MappableException); } return cause; } }
@Override public Stage<ContainerResponse> createRespondingRoot() { return respondingContext.createRespondingRoot(); } }
@Override public void push(final ChainableStage<ContainerResponse> stage) { respondingContext.push(stage); }
/** * Construct a mappable container exception. * * @param cause the cause. If the cause is an instance of * {@link MappableException} then the cause of this exception * will be obtained by recursively searching though the exception * causes until a cause is obtained that is not an instance of * {@code MappableException}. */ public MappableException(Throwable cause) { super(unwrap(cause)); }
/** * Construct a mappable container exception. * * @param cause the cause. If the cause is an instance of * {@link MappableException} then the cause of this exception * will be obtained by recursively searching though the exception * causes until a cause is obtained that is not an instance of * {@code MappableException}. */ public MappableException(Throwable cause) { super(unwrap(cause)); }