Package com.google.inject.servlet

Examples of com.google.inject.servlet.ServletModule


*/
public class GuiceServletConfig extends GuiceServletContextListener {

    @Override
    protected Injector getInjector() {
        return Guice.createInjector(new ServletModule() {

            @Override
            protected void configureServlets() {
                // Bind classes
                bind(PerRequestResource.class);
View Full Code Here


    YarnConfiguration conf = SliderUtils.createConfiguration();
    fs = FileSystem.get(new URI("file:///"), conf);
  }

  private static Injector createInjector() {
    return Guice.createInjector(new ServletModule() {
      @Override
      protected void configureServlets() {

        AppState appState = null;
        try {
View Full Code Here

public class SwaggerExampleGuiceContextListener extends GuiceServletContextListener {

    @Override
    protected Injector getInjector() {
        return Guice.createInjector(new ServletModule() {
            @Override
            protected void configureServlets() {
                bind(ServletContainer.class).in(Singleton.class);
                bind(ApiOriginFilter.class).in(Singleton.class);
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

/** Executes any pending {@link RequestCleanup} at the end of a request. */
@Singleton
public class RequestContextFilter implements Filter {
  public static Module module() {
    return new ServletModule() {
      @Override
      protected void configureServlets() {
        filter("/*").through(RequestContextFilter.class);
      }
    };
View Full Code Here

      case LDAP_BIND:
        install(new LdapAuthModule());
        break;

      case DEVELOPMENT_BECOME_ANY_ACCOUNT:
        install(new ServletModule() {
          @Override
          protected void configureServlets() {
            serve("/become").with(BecomeAnyAccountLoginServlet.class);
          }
        });
View Full Code Here

  private static final String MOUNT_POINT = "/service/extdirect";

  @Override
  protected void configure() {
    install(new ServletModule()
    {
      @Override
      protected void configureServlets() {
        Map<String, String> directServletConfig = Maps.newHashMap();
        directServletConfig.put(GlobalParameters.PROVIDERS_URL, MOUNT_POINT.substring(1));
View Full Code Here

    // re-bind context with name to avoid backwards-compat warnings from guice-servlet
    bind(ServletContext.class).annotatedWith(named("nexus")).toInstance(servletContext);
    bind(ParameterKeys.PROPERTIES).toInstance(properties);

    install(new ServletModule()
    {
      @Override
      protected void configureServlets() {
        bind(BaseUrlHolderFilter.class);
        bind(ErrorPageFilter.class);
View Full Code Here

    bind(Clock.class).toInstance(clock);

    final JsonFactory jsonFactory = new JsonFactory(new ObjectMapper());
    bind(JsonFactory.class).toInstance(jsonFactory);

    install(new ServletModule()
    {
      @Override
      protected void configureServlets() {
        bind(MetricsServlet.class);
        bind(HealthCheckServlet.class);
View Full Code Here

  protected void configure() {
    bind(filterKey("contentAuthcBasic")).to(ContentAuthenticationFilter.class).in(Singleton.class);

    bind(filterKey("contentTperms")).toProvider(ContentTargetMappingFilterProvider.class);

    install(new ServletModule()
    {
      @Override
      protected void configureServlets() {
        serve(MOUNT_POINT + "/*").with(ContentServlet.class);
        filter(MOUNT_POINT + "/*").through(SecurityFilter.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.