chain.doFilter( request, response );
}
}
protected void doRack(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
RackEnvironment rackEnv = null;
Ruby runtime = null;
RackApplicationComponent rackApp;
try {
runtime = this.runtimePool.borrowRuntime( "rack" );
rackApp = (RackApplicationComponent) this.componentResolver.resolve( runtime );
rackEnv = new RackEnvironment( runtime, request );
rackApp.call( rackEnv ).respond( response );
} catch (RaiseException e) {
log.error( "Error invoking Rack filter", e );
log.error( "Underlying Ruby exception", e.getCause() );
throw new ServletException( e );
} catch (Exception e) {
log.error( "Error invoking Rack filter", e );
throw new ServletException( e );
} finally {
if (rackEnv != null) {
rackEnv.close();
}
if (runtime != null) {
this.runtimePool.returnRuntime( runtime );
}