use of com.tyndalehouse.step.core.guice.StepCoreModule in project step by STEPBible.
the class StepServletConfig method getInjector.
@Override
protected Injector getInjector() {
if (injector == null) {
synchronized (this) {
ServletModule servletModule = new ServletModule() {
@Override
protected void configureServlets() {
serve("/" + ExternalPoweredByFilter.EXTERNAL_PREFIX + "*").with(FrontController.class);
serve("/rest/*").with(FrontController.class);
serve("/commentary_images/*").with(ImageController.class);
serve("/search*").with(SearchPageController.class);
serve("/index.jsp").with(IndexRedirect.class);
serve("/").with(SearchPageController.class);
serve("/international/interactive.js").with(InternationalJsonController.class);
serve("/international/*").with(InternationalJsonController.class);
serve("/config.jsp").with(SetupPageController.class);
// if (Boolean.getBoolean("metrics.enabled")) {
// serve("/metrics/*").with(AdminServlet.class);
// }
serve("/sitemap_version*").with(SiteMapController.class);
serve("/SITEMAP_version*").with(SiteMapController.class);
// filters
filter("/index.jsp", "/").through(SetupRedirectFilter.class);
filter("*_escaped_fragment_*", "/").through(HashBangFragmentFilter.class);
filter("/external/*").through(ExternalPoweredByFilter.class);
}
};
// if (Boolean.getBoolean("metrics.enabled")) {
// this.injector = Guice.createInjector(new StepCoreModule(), new StepWebModule(),
// new InstrumentationModule(), servletModule);
// } else {
this.injector = Guice.createInjector(new StepCoreModule(), new StepWebModule(), servletModule);
// }
}
}
return this.injector;
}
use of com.tyndalehouse.step.core.guice.StepCoreModule in project step by STEPBible.
the class IndexModule method main.
/**
* main method
*
* @param args list of arguments
*/
public static void main(final String[] args) {
CWProject.instance().setFrontendName("step");
Injector injector = Guice.createInjector(new StepCoreModule(), new Module() {
@Override
public void configure(final Binder binder) {
binder.bind(ClientSession.class).toProvider(new Provider<ClientSession>() {
@Override
public ClientSession get() {
// TODO Auto-generated method stub
return null;
}
});
}
});
final JSwordModuleService instance = injector.getInstance(JSwordModuleService.class);
ConfigEntry.setConfigValueInterceptor(injector.getInstance(ConfigValueInterceptor.class));
System.out.println("Indexing " + args[0]);
instance.index(args[0]);
System.out.println("Finished indexing " + args[0]);
}
use of com.tyndalehouse.step.core.guice.StepCoreModule in project step by STEPBible.
the class IndexAll method main.
/**
* main method
*
* @param args list of arguments
*/
public static void main(final String[] args) {
final BibleInformationService instance = Guice.createInjector(new StepCoreModule(), new Module() {
@Override
public void configure(final Binder binder) {
binder.bind(ClientSession.class).toProvider(new Provider<ClientSession>() {
@Override
public ClientSession get() {
// TODO Auto-generated method stub
return null;
}
});
}
}).getInstance(BibleInformationService.class);
instance.indexAll();
}
Aggregations