Package com.google.inject.servlet

Examples of com.google.inject.servlet.ServletModule


{

    @Override
    protected Injector getInjector()
    {
        return Guice.createInjector( new ServletModule()
        {
            @Override
            protected void configureServlets()
            {
                Map<String, String> params = new HashMap<String, String>();
View Full Code Here


        handler.addServlet(DefaultServlet.class, "/");
        handler.addFilter(GuiceFilter.class, "/*", null);
        handler.addEventListener(new GuiceServletContextListener() {
            @Override
            protected Injector getInjector() {
                return Guice.createInjector(new ServletModule() {
                    @Override
                    protected void configureServlets() {
                        //need some kind of servlet to report a success
                        serve("/*").with(SomeServlet.class);
                    }
View Full Code Here

      return props;
   }

   @Override
   protected Injector getInjector() {
      return Guice.createInjector(new JDKLoggingModule(), new ServletModule() {
         @Override
         protected void configureServlets() {
            bind(new TypeLiteral<Iterable<View>>() {
            }).toInstance(GuiceServletConfig.this.views);
            serve("*.check").with(GetAllResourcesController.class);
 
View Full Code Here

@Singleton
public class StatusServer {
    static Logger log = LoggerFactory.getLogger(StatusServer.class);

    public static ServletModule createJerseyServletModule() {
        return new ServletModule() {
            @Override
            protected void configureServlets() {
                bind(HealthCheck.class);
                bind(SinkStat.class);
                bind(GuiceContainer.class).asEagerSingleton();
View Full Code Here

 
  @Test
  public void testJobCountersForKilledJob() throws Exception {
    WebResource r = resource();
    appContext = new TestAppContext(0, 1, 1, 1, true);
    injector = Guice.createInjector(new ServletModule() {
      @Override
      protected void configureServlets() {

        webApp = mock(HsWebApp.class);
        when(webApp.name()).thenReturn("hsmockwebapp");
View Full Code Here

    this.wantSSL = canonicalUrl != null && canonicalUrl.startsWith("https:");
  }

  @Override
  protected void configure() {
    install(new ServletModule() {
      @Override
      protected void configureServlets() {
        filter("/*").through(RequestCleanupFilter.class);
      }
    });
View Full Code Here

    addWebSocketServlets();

    try {
      final Injector parentInjector = injector;

      final ServletModule servletModule = getServletModule(parentInjector);

      ServletContextListener contextListener = new GuiceServletContextListener() {

        private final Injector childInjector = parentInjector.createChildInjector(servletModule);
View Full Code Here

    addServlet("/webclient/*", DefaultServlet.class);
  }

  public ServletModule getServletModule(final Injector injector) {

    return new ServletModule() {
      @Override
      protected void configureServlets() {
        // We add servlets here to override the DefaultServlet automatic registered by WebAppContext
        // in path "/" with our WaveClientServlet. Any other way to do this?
        // Related question (unanswered 08-Apr-2011)
View Full Code Here

    try {
      logger.info("Creating injector...");
      this.injector = Guice.createInjector(new AbstractModule() {
        protected void configure() {
          // Install default servlet bindings.
          install(new ServletModule());

          // Install user's module.
          if (module != null) {
            logger.info("Installing " + module + "...");
            install(module);
View Full Code Here

        super.contextInitialized(event);
    }

    @Override
    protected Injector getInjector() {
        return Guice.createInjector(new ServletModule() {
            @Override
            protected void configureServlets() {
                serve("/har", "/har/*").with(HarServlet.class);
                serve("/tests", "/tests/*").with(TestsServlet.class);
                serve("/chart").with(ChartServlet.class);
View Full Code Here

TOP

Related Classes of com.google.inject.servlet.ServletModule

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.