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

The following examples show how to use org.glassfish.jersey.server.spi.internal.ValueParamProvider. 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: Pac4JValueFactoryProvider.java    From jax-rs-pac4j with Apache License 2.0 6 votes vote down vote up
@Override
protected void configure() {
    bind(profile).to(ProfileFactoryBuilder.class);
    bind(optProfile).to(OptionalProfileFactoryBuilder.class);

    if(manager == null){
        bind(DefaultProfileManagerFactoryBuilder.class)
            .to(ProfileManagerFactoryBuilder.class)
        ;
    } else {
        bind(manager).to(ProfileManagerFactoryBuilder.class);
    }

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

    bind(ProfileInjectionResolver.class)
        .to(new GenericType<InjectionResolver<Pac4JProfile>>(){})
        .in(Singleton.class);

    bind(ProfileManagerInjectionResolver.class)
        .to(new GenericType<InjectionResolver<Pac4JProfileManager>>(){})
        .in(Singleton.class);
}
 
Example #2
Source File: Pac4JValueFactoryProvider.java    From jax-rs-pac4j with Apache License 2.0 6 votes vote down vote up
@Override
protected void configure() {
    bind(profile).to(ProfileFactoryBuilder.class);
    bind(optProfile).to(OptionalProfileFactoryBuilder.class);

    if(manager == null){
        bind(DefaultProfileManagerFactoryBuilder.class)
            .to(ProfileManagerFactoryBuilder.class).in(Singleton.class);
    } else {
        bind(manager).to(ProfileManagerFactoryBuilder.class);
    }

    bindAsContract(Pac4JProfileValueFactoryProvider.class).to(ValueParamProvider.class).in(Singleton.class);

    bindAsContract(ProfileInjectionResolver.class)
        .to(new GenericType<InjectionResolver<Pac4JProfile>>(){})
        .in(Singleton.class);

    bindAsContract(ProfileManagerInjectionResolver.class)
        .to(new GenericType<InjectionResolver<Pac4JProfileManager>>(){})
        .in(Singleton.class);
}
 
Example #3
Source File: ProviderRenderUtil.java    From dropwizard-guicey with MIT License 6 votes vote down vote up
private static String renderParamInjectionResolver(final ParamInjectionResolver instance,
                                                   final boolean hkManaged,
                                                   final boolean lazy) {
    try {
        final Field field = ParamInjectionResolver.class.getDeclaredField("valueParamProvider");
        field.setAccessible(true);
        final ValueParamProvider param = (ValueParamProvider) field.get(instance);
        final Class<? extends ParamInjectionResolver> type = instance.getClass();
        return String.format("@%-30s %s using %s %s",
                instance.getAnnotation().getSimpleName(),
                RenderUtils.renderClassLine(type),
                param.getClass().getSimpleName(),
                RenderUtils.markers(collectMarkers(InjectionResolver.class, type, hkManaged, lazy)));
    } catch (Exception e) {
        throw new IllegalStateException("Failed to access provider field", e);
    }
}
 
Example #4
Source File: JooqBinder.java    From droptools with Apache License 2.0 6 votes vote down vote up
@Override
protected void configure() {
    // bind default Configuration to DSLContext
    bindFactory(new DSLContextFactory(configurationMap.values().stream().findFirst().orElse(null)))
            .to(DSLContext.class)
            .in(RequestScoped.class);

    // bind multiple instances of Configuration and ConnectionProvider for Named DSLContext(s)
    for (final Configuration configuration : configurationMap.values()) {

        bind(configuration).to(Configuration.class);

        bind(configuration.connectionProvider())
                .to(ConnectionProvider.class);
    }

    // bind a ValueParamProvider for Named DSLContext(s)
    bind(new DSLContextValueParamProvider(configurationMap))
            .to(ValueParamProvider.class);
}
 
Example #5
Source File: FernetSecretBinder.java    From fernet-java8 with Apache License 2.0 4 votes vote down vote up
protected void configure() {
    bind(FernetSecretValueParamProvider.class)
        .to(ValueParamProvider.class)
        .in(Singleton.class);
}
 
Example #6
Source File: FernetTokenBinder.java    From fernet-java8 with Apache License 2.0 4 votes vote down vote up
protected void configure() {
    bind(FernetTokenValueParamProvider.class)
        .to(ValueParamProvider.class)
        .in(Singleton.class);
}
 
Example #7
Source File: DSLContextValueParamProvider.java    From droptools with Apache License 2.0 4 votes vote down vote up
@Override
public PriorityType getPriority() {
    return ValueParamProvider.Priority.NORMAL;
}
 
Example #8
Source File: JerseyConfig.java    From dropwizard-guicey with MIT License 2 votes vote down vote up
/**
 * Show param value providers {@link ValueParamProvider}.
 *
 * @return config instance for chained calls
 */
public JerseyConfig showParamValueProviders() {
    types.add(ValueParamProvider.class);
    return this;
}