@Override public Continuation apply(final RequestProcessingContext context) { final RoutingContext routingContext = context.routingContext(); final Object storedResource = routingContext.peekMatchedResource(); if (storedResource == null || !storedResource.getClass().equals(methodHandler.getHandlerClass())) { Object handlerInstance = methodHandler.getInstance(context.injectionManager()); routingContext.pushMatchedResource(handlerInstance); } return Continuation.of(context, next); } }
@Override public Continuation apply(final RequestProcessingContext context) { final RoutingContext routingContext = context.routingContext(); final Object storedResource = routingContext.peekMatchedResource(); if (storedResource == null || !storedResource.getClass().equals(methodHandler.getHandlerClass())) { Object handlerInstance = methodHandler.getInstance(context.injectionManager()); routingContext.pushMatchedResource(handlerInstance); } return Continuation.of(context, next); } }
/** * Get an {@link ErrorTemplate} annotation from resource method / class the throwable was raised from. * * @return an error template annotation or {@code null} if the method is not annotated. */ private ErrorTemplate getErrorTemplate() { final ExtendedUriInfo uriInfo = uriInfoProvider.get(); final ResourceMethod matchedResourceMethod = uriInfo.getMatchedResourceMethod(); if (matchedResourceMethod != null) { final Invocable invocable = matchedResourceMethod.getInvocable(); ErrorTemplate errorTemplate = invocable.getHandlingMethod().getAnnotation(ErrorTemplate.class); if (errorTemplate == null) { Class<?> handlerClass = invocable.getHandler().getHandlerClass(); if (invocable.isInflector() && TemplateInflector.class .isAssignableFrom(invocable.getHandler().getHandlerClass())) { handlerClass = ((TemplateInflector) invocable.getHandler().getInstance(null)).getModelClass(); } errorTemplate = handlerClass.getAnnotation(ErrorTemplate.class); } return errorTemplate; } return null; }
@Override public Continuation apply(final RequestProcessingContext context) { final RoutingContext routingContext = context.routingContext(); final Object storedResource = routingContext.peekMatchedResource(); if (storedResource == null || !storedResource.getClass().equals(methodHandler.getHandlerClass())) { Object handlerInstance = methodHandler.getInstance(context.injectionManager()); routingContext.pushMatchedResource(handlerInstance); } return Continuation.of(context, next); } }
@Override public Continuation apply(final RequestProcessingContext context) { final RoutingContext routingContext = context.routingContext(); final Object storedResource = routingContext.peekMatchedResource(); if (storedResource == null || !storedResource.getClass().equals(methodHandler.getHandlerClass())) { Object handlerInstance = methodHandler.getInstance(context.serviceLocator()); routingContext.pushMatchedResource(handlerInstance); } return Continuation.of(context, next); } }
@Override public Continuation apply(final RequestProcessingContext context) { final RoutingContext routingContext = context.routingContext(); final Object storedResource = routingContext.peekMatchedResource(); if (storedResource == null || !storedResource.getClass().equals(methodHandler.getHandlerClass())) { Object handlerInstance = methodHandler.getInstance(context.injectionManager()); routingContext.pushMatchedResource(handlerInstance); } return Continuation.of(context, next); } }
@Override public Continuation apply(final RequestProcessingContext context) { final RoutingContext routingContext = context.routingContext(); final Object storedResource = routingContext.peekMatchedResource(); if (storedResource == null || !storedResource.getClass().equals(methodHandler.getHandlerClass())) { Object handlerInstance = methodHandler.getInstance(context.serviceLocator()); routingContext.pushMatchedResource(handlerInstance); } return Continuation.of(context, next); } }
@Override public Continuation apply(final RequestProcessingContext context) { final RoutingContext routingContext = context.routingContext(); final Object storedResource = routingContext.peekMatchedResource(); if (storedResource == null || !storedResource.getClass().equals(methodHandler.getHandlerClass())) { Object handlerInstance = methodHandler.getInstance(context.serviceLocator()); routingContext.pushMatchedResource(handlerInstance); } return Continuation.of(context, next); } }
/** * Get an {@link ErrorTemplate} annotation from resource method / class the throwable was raised from. * * @return an error template annotation or {@code null} if the method is not annotated. */ private ErrorTemplate getErrorTemplate() { final ExtendedUriInfo uriInfo = uriInfoProvider.get(); final ResourceMethod matchedResourceMethod = uriInfo.getMatchedResourceMethod(); if (matchedResourceMethod != null) { final Invocable invocable = matchedResourceMethod.getInvocable(); ErrorTemplate errorTemplate = invocable.getHandlingMethod().getAnnotation(ErrorTemplate.class); if (errorTemplate == null) { Class<?> handlerClass = invocable.getHandler().getHandlerClass(); if (invocable.isInflector() && TemplateInflector.class .isAssignableFrom(invocable.getHandler().getHandlerClass())) { handlerClass = ((TemplateInflector) invocable.getHandler().getInstance(null)).getModelClass(); } errorTemplate = handlerClass.getAnnotation(ErrorTemplate.class); } return errorTemplate; } return null; }
/** * Get an {@link ErrorTemplate} annotation from resource method / class the throwable was raised from. * * @return an error template annotation or {@code null} if the method is not annotated. */ private ErrorTemplate getErrorTemplate() { final ExtendedUriInfo uriInfo = uriInfoProvider.get(); final ResourceMethod matchedResourceMethod = uriInfo.getMatchedResourceMethod(); if (matchedResourceMethod != null) { final Invocable invocable = matchedResourceMethod.getInvocable(); ErrorTemplate errorTemplate = invocable.getHandlingMethod().getAnnotation(ErrorTemplate.class); if (errorTemplate == null) { Class<?> handlerClass = invocable.getHandler().getHandlerClass(); if (invocable.isInflector() && TemplateInflector.class .isAssignableFrom(invocable.getHandler().getHandlerClass())) { handlerClass = ((TemplateInflector) invocable.getHandler().getInstance(null)).getModelClass(); } errorTemplate = handlerClass.getAnnotation(ErrorTemplate.class); } return errorTemplate; } return null; }
/** * Get an {@link ErrorTemplate} annotation from resource method / class the throwable was raised from. * * @return an error template annotation or {@code null} if the method is not annotated. */ private ErrorTemplate getErrorTemplate() { final ExtendedUriInfo uriInfo = uriInfoProvider.get(); final ResourceMethod matchedResourceMethod = uriInfo.getMatchedResourceMethod(); if (matchedResourceMethod != null) { final Invocable invocable = matchedResourceMethod.getInvocable(); ErrorTemplate errorTemplate = invocable.getHandlingMethod().getAnnotation(ErrorTemplate.class); if (errorTemplate == null) { Class<?> handlerClass = invocable.getHandler().getHandlerClass(); if (invocable.isInflector() && TemplateInflector.class .isAssignableFrom(invocable.getHandler().getHandlerClass())) { handlerClass = ((TemplateInflector) invocable.getHandler().getInstance(null)).getModelClass(); } errorTemplate = handlerClass.getAnnotation(ErrorTemplate.class); } return errorTemplate; } return null; }