Package org.jruby.rack

Examples of org.jruby.rack.SharedRackApplicationFactory


    public void init(ServletConfig config) {
        if(config.getServletContext().getAttribute(RackApplicationFactory.RACK_CONTEXT) == null){  
            System.out.println("setup rails application via jruby-rack - started . . .");
            ServletContext ctx = config.getServletContext();
            ServletRackConfig rackConfig = new RestyServletRackConfig(ctx);
            final RackApplicationFactory fac = new SharedRackApplicationFactory(new RailsRackApplicationFactory());
            ctx.setAttribute(RackApplicationFactory.FACTORY, fac);
            ServletRackContext rackContext = new ServletRackContext(rackConfig);
            ctx.setAttribute(RackApplicationFactory.RACK_CONTEXT, rackContext);
            try {
                fac.init(rackContext);
                System.out.println("setup rails application via jruby-rack - done . . .");
            } catch (Exception ex) {
                ctx.log("Error: application initialization failed", ex);
            }
        }
View Full Code Here


*/
@Deprecated
public class MerbServletContextListener extends RackServletContextListener {
    @Override
    protected RackApplicationFactory newApplicationFactory(RackConfig config) {
        return new SharedRackApplicationFactory(
            new MerbRackApplicationFactory()
        );
    }
View Full Code Here

    protected RackApplicationFactory newApplicationFactory(RackConfig config) {
        final RackApplicationFactory factory = new RailsRackApplicationFactory();
        final Integer maxRuntimes = config.getMaximumRuntimes();
        // TODO maybe after Rails 4 is out switch to shared by default as well !
        if ( maxRuntimes != null && maxRuntimes.intValue() == 1 ) {
            return new SharedRackApplicationFactory(factory);
        }
        else {
            return config.isSerialInitialization() ?
                new SerialPoolingRackApplicationFactory(factory) :
                    new PoolingRackApplicationFactory(factory) ;
View Full Code Here

TOP

Related Classes of org.jruby.rack.SharedRackApplicationFactory

Copyright © 2018 www.massapicom. 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.