/** {@inheritDoc} */ @Override protected void configure() { final ExecutorService service = Executors.newCachedThreadPool(DAEMON_THREAD_FACTORY); bind(ExecutorService.class).toInstance(service); bind(ExecutorService.class).annotatedWith(Names.named("shindig.concat.executor")).toInstance(service); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { service.shutdownNow(); } }); install(new ParseModule()); install(new PreloadModule()); install(new RenderModule()); install(new RewriteModule()); install(new SubstituterModule()); install(new TemplateModule()); install(new UriModule()); // bind(Long.class).annotatedWith(Names.named("org.apache.shindig.serviceExpirationDurationMinutes")).toInstance(60l); // We perform static injection on HttpResponse for cache TTLs. requestStaticInjection(HttpResponse.class); registerGadgetHandlers(); registerConfigContributors(); registerFeatureHandlers(); }
/** {@inheritDoc} */ @Override protected void configure() { final ExecutorService service = Executors.newCachedThreadPool(DAEMON_THREAD_FACTORY); bind(ExecutorService.class).toInstance(service); bind(ExecutorService.class).annotatedWith(Names.named("shindig.concat.executor")).toInstance(service); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { service.shutdownNow(); } }); install(new ParseModule()); install(new PreloadModule()); install(new RenderModule()); install(new RewriteModule()); install(new SubstituterModule()); install(new TemplateModule()); install(new UriModule()); // bind(Long.class).annotatedWith(Names.named("org.apache.shindig.serviceExpirationDurationMinutes")).toInstance(60l); // We perform static injection on HttpResponse for cache TTLs. requestStaticInjection(HttpResponse.class); registerGadgetHandlers(); registerConfigContributors(); registerFeatureHandlers(); }
/** {@inheritDoc} */ @Override protected void configure() { bind(ExecutorService.class).to(ShindigExecutorService.class); bind(Executor.class).annotatedWith(Names.named("shindig.concat.executor")).to(ShindigExecutorService.class); bind(Authority.class).to(BasicAuthority.class); bindConstant().annotatedWith(Names.named("shindig.jsload.ttl-secs")).to(60 * 60); // 1 hour bindConstant().annotatedWith(Names.named("shindig.jsload.require-onload-with-jsload")).to(true); install(new DefaultConfigContributorModule()); install(new ParseModule()); install(new PreloadModule()); install(new RenderModule()); install(new RewriteModule()); install(new SubstituterModule()); install(new TemplateModule()); install(new UriModule()); install(new JsCompilerModule()); install(new JsServingPipelineModule()); // We perform static injection on HttpResponse for cache TTLs. requestStaticInjection(HttpResponse.class); requestStaticInjection(AbstractHttpCache.class); requestStaticInjection(ProxyUriBase.class); requestStaticInjection(GenericDigestUtils.class); requestStaticInjection(BasicBlobCrypter.class); registerGadgetHandlers(); registerFeatureHandlers(); }