org.glassfish.jersey.server.spi.internal.ValueFactoryProvider Java Examples

The following examples show how to use org.glassfish.jersey.server.spi.internal.ValueFactoryProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TokenFeature.java    From robe with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public boolean configure(FeatureContext context) {
    context.register(new AbstractBinder() {
        @Override
        public void configure() {
            bind(TokenAuthenticator.class)
                    .in(Singleton.class);
            bind(TokenFactory.class)
                    .in(Singleton.class);
            bind(TokenFactoryProvider.class)
                    .to(ValueFactoryProvider.class)
                    .in(Singleton.class);
            bind(TokenParamInjectionResolver.class)
                    .to(new TypeLiteral<InjectionResolver<RobeAuth>>() {
                    })
                    .in(Singleton.class);
        }
    });
    return true;
}
 
Example #2
Source File: SingularityAuthFeature.java    From Singularity with Apache License 2.0 6 votes vote down vote up
@Override
public boolean configure(FeatureContext context) {
  context.register(
    new AbstractBinder() {

      @Override
      public void configure() {
        bind(SingularityMultiMethodAuthenticator.class)
          .to(
            new TypeLiteral<Authenticator<ContainerRequestContext, SingularityUser>>() {}
          )
          .in(Singleton.class);
        bind(SingularityAuthedUserFactory.class)
          .to(SingularityAuthedUserFactory.class)
          .in(Singleton.class);
        bind(SingularityAuthFactoryProvider.class)
          .to(ValueFactoryProvider.class)
          .in(Singleton.class);
        bind(SingularityAuthParamInjectionResolver.class)
          .to(new TypeLiteral<InjectionResolver<Auth>>() {})
          .in(Singleton.class);
      }
    }
  );
  return true;
}
 
Example #3
Source File: RateLimitBundle.java    From ratelimitj with Apache License 2.0 5 votes vote down vote up
@Override
protected void configure() {
    bind(new RateLimiterFactoryProvider(requestRateLimiterFactory)).to(RateLimiterFactoryProvider.class);
    bind(RateLimitingFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class);
    bind(RateLimitingFactoryProvider.RateLimitingInjectionResolver.class)
            .to(new TypeLiteral<InjectionResolver<RateLimiting>>() {}).in(Singleton.class);
}
 
Example #4
Source File: RateLimit429EnforcerFilterTest.java    From ratelimitj with Apache License 2.0 5 votes vote down vote up
@Override
protected void configure() {
    bind(TestRateLimitingFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class);
    bind(TestRateLimitingFactoryProvider.TestRateLimitingInjectionResolver.class).to(
            new TypeLiteral<InjectionResolver<RateLimiting>>() {
            }
    ).in(Singleton.class);
}
 
Example #5
Source File: Pac4JValueFactoryProvider.java    From jax-rs-pac4j with Apache License 2.0 5 votes vote down vote up
@Override
protected void configure() {
    bind(profile).to(ProfileFactoryBuilder.class);
    bind(optProfile).to(OptionalProfileFactoryBuilder.class);
    bind(manager).to(ProfileManagerFactoryBuilder.class);

    bind(Pac4JProfileValueFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class);

    bind(ProfileInjectionResolver.class).to(new TypeLiteral<InjectionResolver<Pac4JProfile>>() {
    }).in(Singleton.class);
    bind(ProfileManagerInjectionResolver.class).to(new TypeLiteral<InjectionResolver<Pac4JProfileManager>>() {
    }).in(Singleton.class);
}
 
Example #6
Source File: AuthResolver.java    From keywhiz with Apache License 2.0 5 votes vote down vote up
@Override protected void configure() {
  bind(clientAuthFactory);
  bind(automationClientAuthFactory);
  bind(userAuthFactory);
  bind(AuthValueFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class);
  bind(AuthInjectionResolver.class).to(new TypeLiteral<InjectionResolver<Auth>>() {}).in(Singleton.class);
}
 
Example #7
Source File: TokenFactoryProvider.java    From robe with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
protected void configure() {
    bind(new PrincipalClassProvider<>(principalClass)).to(PrincipalClassProvider.class);
    bind(TokenFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class);
    bind(TokenParamInjectionResolver.class).to(new TypeLiteral<InjectionResolver<RobeAuth>>() {
    }).in(Singleton.class);
}
 
Example #8
Source File: TypeFactory.java    From shiro-jersey with Apache License 2.0 5 votes vote down vote up
@Override
public void bind(DynamicConfiguration config) {
  Injections.addBinding(
          Injections.newFactoryBinder(this).to(type).in(Singleton.class),
          config);
  Injections.addBinding(
          Injections.newBinder(this).to(ValueFactoryProvider.class),
          config);
}
 
Example #9
Source File: HmacAuthFeature.java    From jersey-hmac-auth with Apache License 2.0 5 votes vote down vote up
protected void configure() {
    bind(PrincipalFactory.class)
            .to(PrincipalFactory.class)
            .to(new TypeLiteral<Factory<P>>() {})
            .in(Singleton.class);
    bind(PrincipalValueFactoryProvider.class)
            .to(AbstractValueFactoryProvider.class)
            .to(ValueFactoryProvider.class)
            .in(Singleton.class);
    bind(PrincipalInjectionResolver.class)
            .to(new TypeLiteral<ParamInjectionResolver<HmacAuth>>() {})
            .to(new TypeLiteral<InjectionResolver<HmacAuth>>() {})
            .in(Singleton.class);
}
 
Example #10
Source File: TypeFactory.java    From shiro-jersey with Apache License 2.0 5 votes vote down vote up
@Override
public void bind(DynamicConfiguration config) {
  Injections.addBinding(
          Injections.newFactoryBinder(this).to(type).in(Singleton.class),
          config);
  Injections.addBinding(
          Injections.newBinder(this).to(ValueFactoryProvider.class),
          config);
}
 
Example #11
Source File: SecurityCheckFactoryProvider.java    From commafeed with Apache License 2.0 5 votes vote down vote up
@Override
protected void configure() {
	bind(SecurityCheckFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class);
	bind(SecurityCheckInjectionResolver.class).to(new TypeLiteral<InjectionResolver<SecurityCheck>>() {
	}).in(Singleton.class);
	bind(userService).to(UserService.class);
}
 
Example #12
Source File: AuthValueFactoryProvider.java    From dropwizard-simpleauth with Apache License 2.0 4 votes vote down vote up
@Override
protected void configure() {
  bind(AuthValueFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class);
  bind(AuthInjectionResolver.class).to(new TypeLiteral<InjectionResolver<Auth>>() {
  }).in(Singleton.class);
}
 
Example #13
Source File: SearchFactoryProvider.java    From robe with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
protected void configure() {
    bind(SearchFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class);
    bind(SearchParamInjectionResolver.class).to(new TypeLiteral<InjectionResolver<SearchParam>>() {
    }).in(Singleton.class);
}
 
Example #14
Source File: DummyAuth.java    From dropwizard-experiment with MIT License 4 votes vote down vote up
@Override
protected void configure() {
    bind(DummyAuth.class).to(ValueFactoryProvider.class).in(Singleton.class);
}
 
Example #15
Source File: SessionHelperFactoryProvider.java    From commafeed with Apache License 2.0 4 votes vote down vote up
@Override
protected void configure() {
	bind(SessionHelperFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class);
	bind(SessionHelperInjectionResolver.class).to(new TypeLiteral<InjectionResolver<Context>>() {
	}).in(Singleton.class);
}