src/main/java/org/eiichiro/bootleg/Invoke.java
public boolean apply(WebContext context) {
		WebException e = null;
		
		try {
			context.result(new MethodInvocation<Object>(
					context.method(), 
					instantiate(context.method().getDeclaringClass()), 
					context.parameters().toArray()).proceed());
			return true;
		} catch (WebException exception) {
			e = exception;
		} catch (Throwable throwable) {
			e = new EndpointInvocationFailedException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, throwable);
		}
		
		logger.warn("Failed to invoke Web endpoint", e);
		
		try {
			context.response().sendError(e.status());
			return false;
		} catch (IOException exception) {
			throw new UncheckedException(exception);
		}
	}
public boolean apply(WebContext context) {
		WebException e = null;
		
		try {
			context.result(new MethodInvocation<Object>(
					context.method(), 
					instantiate(context.method().getDeclaringClass()), 
					context.parameters().toArray()).proceed());
			return true;
		} catch (WebException exception) {
			e = exception;
		} catch (Throwable throwable) {
			e = new EndpointInvocationFailedException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, throwable);
		}
		
		logger.warn("Failed to invoke Web endpoint", e);
		
		try {
			context.response().sendError(e.status());
			return false;
		} catch (IOException exception) {
			throw new UncheckedException(exception);
		}
	}
public boolean apply ( WebContext context ) { WebException e = null ; try { context . result ( new MethodInvocation < Object > ( context . method ( ) , instantiate ( context . method ( ) . getDeclaringClass ( ) ) , context . parameters ( ) . toArray ( ) ) . proceed ( ) ) ; return true ; } catch ( WebException exception ) { e = exception ; } catch ( Throwable throwable ) { e = new EndpointInvocationFailedException ( HttpServletResponse . SC_INTERNAL_SERVER_ERROR , throwable ) ; } logger . warn ( "Failed to invoke Web endpoint" , e ) ; try { context . response ( ) . sendError ( e . status ( ) ) ; return false ; } catch ( IOException exception ) { throw new UncheckedException ( exception ) ; } }
Invokes Web endpoint method.
This method processes the request as the following steps:
<ol>
<li>Gets Web endpoint class by invoking {@code Method#getDeclaringClass()}
of the Web endpoint method set on the current HTTP request processing
context and instantiates it with the {@link Instantiator} that the
{@link Configuration#instantiator()} returns.</li>
<li>Invokes Web endpoint method on the constructed instance with the
parameters set on the current HTTP request processing context and sets
the invocation result to the current HTTP request processing context.</li>
<li>If the invocation is failed with {@code WebException}, this method
sends HTTP response with the status code the exception has.</li>
<li>If the invocation is failed for any reasons, this method sends HTTP
response with the status code 500 (INTERNAL_SERVER_ERROR).</li>
</ol>

@param context HTTP request processing context.
Invokes Web endpoint method . This method processes the request as the following steps : <ol > <li > Gets Web endpoint class by invoking { @code Method#getDeclaringClass () } of the Web endpoint method set on the current HTTP request processing context and instantiates it with the { @link Instantiator } that the { @link Configuration#instantiator () } returns . < / li > <li > Invokes Web endpoint method on the constructed instance with the parameters set on the current HTTP request processing context and sets the invocation result to the current HTTP request processing context . < / li > <li > If the invocation is failed with { @code WebException } this method sends HTTP response with the status code the exception has . < / li > <li > If the invocation is failed for any reasons this method sends HTTP response with the status code 500 ( INTERNAL_SERVER_ERROR ) . < / li > < / ol >