@Override protected void configure() { bind(ResponseRewriterRegistry.class) .annotatedWith(Names.named("shindig.accelerate.response.rewriter.registry")) .to(AccelResponseRewriterRegistry.class); }
protected void provideResponseRewriters() { mapbinder = MapBinder.newMapBinder(binder(), new TypeLiteral<RewritePath>(){}, new TypeLiteral<List<ResponseRewriter>>() {}); Provider<List<ResponseRewriter>> accelRewriterList = getResponseRewriters( ACCEL_CONTAINER, RewriteFlow.ACCELERATE); Provider<List<ResponseRewriter>> requestPipelineRewriterList = getResponseRewriters( DEFAULT_CONTAINER, RewriteFlow.REQUEST_PIPELINE); addBindingForRewritePath(DEFAULT_CONTAINER, RewriteFlow.REQUEST_PIPELINE); addBindingForRewritePath(DEFAULT_CONTAINER, RewriteFlow.DEFAULT); addBindingForRewritePath(ACCEL_CONTAINER, RewriteFlow.ACCELERATE); addBindingForRewritePath(ACCEL_CONTAINER, RewriteFlow.REQUEST_PIPELINE, requestPipelineRewriterList); addBindingForRewritePath(ACCEL_CONTAINER, RewriteFlow.DEFAULT, accelRewriterList); }
@Override protected void configure() { configureGadgetRewriters(); provideResponseRewriters(); }
protected void addBindingForRewritePath(String container, RewriteFlow rewriteFlow) { addBindingForRewritePath(container, rewriteFlow, binder().getProvider( getKey(container, rewriteFlow))); }
/** {@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(); }
protected void configureGadgetRewriters() { Multibinder<GadgetRewriter> multibinder = Multibinder.newSetBinder(binder(), GadgetRewriter.class, Names.named("shindig.rewriters.gadget.set")); multibinder.addBinding().to(PipelineDataGadgetRewriter.class); multibinder.addBinding().to(TemplateRewriter.class); multibinder.addBinding().to(AbsolutePathReferenceRewriter.class); multibinder.addBinding().to(StyleTagExtractorContentRewriter.class); multibinder.addBinding().to(StyleAdjacencyContentRewriter.class); multibinder.addBinding().to(ProxyingContentRewriter.class); multibinder.addBinding().to(CajaContentRewriter.class); multibinder.addBinding().to(SanitizingGadgetRewriter.class); multibinder.addBinding().to(RenderingGadgetRewriter.class); multibinder.addBinding().to(OpenSocialI18NGadgetRewriter.class); }
/** {@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(); }
@Override protected void configure() { bind(ResponseRewriterRegistry.class) .annotatedWith(Names.named("shindig.accelerate.response.rewriter.registry")) .to(AccelResponseRewriterRegistry.class); }