Examples of RackEnvironment


Examples of com.github.kevwil.aspen.RackEnvironment

    @Test
    public void shouldReturnAnEnvironmentWrapper()
    {
        httpRequest = new DefaultHttpRequest( HttpVersion.HTTP_1_1, HttpMethod.GET, "/" );
        req = new Request( ctx, httpRequest, _runtime );
        RackEnvironment env = req.getEnv();
        assertNotNull( env );
    }
View Full Code Here

Examples of com.squareup.rack.RackEnvironment

    while (attributeNames.hasMoreElements()) {
      String name = attributeNames.nextElement();
      content.put(name, request.getAttribute(name));
    }

    return new RackEnvironment(content.build());
  }
View Full Code Here

Examples of com.squareup.rack.RackEnvironment

    this.rackResponsePropagator = rackResponsePropagator;
  }

  @Override protected void service(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    RackEnvironment rackEnvironment = rackEnvironmentBuilder.build(request);

    try {
      RackResponse rackResponse = rackApplication.call(rackEnvironment);
      rackResponsePropagator.propagate(rackResponse, response);
    } finally {
      rackEnvironment.closeRackInput();
    }
  }
View Full Code Here

Examples of org.torquebox.web.rack.RackEnvironment

    }
   
    @Test
    public void testCall() throws Exception {
        RackApplicationComponent component = new RackApplicationComponent( this.rackApp );
        RackEnvironment env = mock( RackEnvironment.class );
        RubyHash envHash = RubyHash.newHash( this.ruby );
        when(env.getEnv()).thenReturn( envHash );
       
        Object response = component.call( env );
       
        assertNotNull( response );
       
View Full Code Here

Examples of org.torquebox.web.rack.RackEnvironment

            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 );
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.