Search in sources :

Example 81 with Named

use of javax.inject.Named in project OpenAM by OpenRock.

the class OAuth2GuiceModule method getOAuth2AuditContextProviders.

@Inject
@Provides
@Singleton
@Named(OAUTH2_AUDIT_CONTEXT_PROVIDERS)
Set<OAuth2AuditContextProvider> getOAuth2AuditContextProviders(TokenStore tokenStore, OAuth2RequestFactory<?, Request> requestFactory) {
    Set<OAuth2AuditContextProvider> set = new HashSet<>();
    set.add(new OAuth2AuditAccessTokenContextProvider(tokenStore, requestFactory));
    set.add(new OAuth2AuditRefreshTokenContextProvider(tokenStore, requestFactory));
    set.add(new OAuth2AuditSSOTokenContextProvider());
    return set;
}
Also used : OAuth2AuditRefreshTokenContextProvider(org.forgerock.openam.rest.audit.OAuth2AuditRefreshTokenContextProvider) OAuth2AuditContextProvider(org.forgerock.openam.rest.audit.OAuth2AuditContextProvider) OAuth2AuditAccessTokenContextProvider(org.forgerock.openam.rest.audit.OAuth2AuditAccessTokenContextProvider) OAuth2AuditSSOTokenContextProvider(org.forgerock.openam.rest.audit.OAuth2AuditSSOTokenContextProvider) HashSet(java.util.HashSet) Inject(javax.inject.Inject) Named(javax.inject.Named) Singleton(javax.inject.Singleton) Provides(com.google.inject.Provides)

Example 82 with Named

use of javax.inject.Named in project OpenAM by OpenRock.

the class RestGuiceModule method getCrestRootRouter.

@Provides
@Named("CrestRootRouter")
@Singleton
Router getCrestRootRouter(@Named("CrestRealmRouter") Router crestRealmRouter) {
    Router crestRootRouter = new Router();
    crestRootRouter.setDefaultRoute(crestRealmRouter);
    return crestRealmRouter;
}
Also used : Router(org.forgerock.json.resource.Router) Named(javax.inject.Named) Singleton(javax.inject.Singleton) Provides(com.google.inject.Provides)

Example 83 with Named

use of javax.inject.Named in project OpenAM by OpenRock.

the class RestGuiceModule method getChfRealmRouter.

@Provides
@Named("ChfRealmRouter")
@Singleton
org.forgerock.http.routing.Router getChfRealmRouter(@Named("CrestRealmHandler") RequestHandler crestRealmHandler, ContextFilter contextFilter, CrestProtocolEnforcementFilter crestProtocolEnforcementFilter) {
    org.forgerock.http.routing.Router chfRealmRouter = new org.forgerock.http.routing.Router();
    chfRealmRouter.setDefaultRoute(Handlers.chainOf(newHttpHandler(new FilterChain(crestRealmHandler, contextFilter)), crestProtocolEnforcementFilter));
    return chfRealmRouter;
}
Also used : FilterChain(org.forgerock.json.resource.FilterChain) Router(org.forgerock.json.resource.Router) Named(javax.inject.Named) Singleton(javax.inject.Singleton) Provides(com.google.inject.Provides)

Example 84 with Named

use of javax.inject.Named in project camel by apache.

the class AdvisedRouteTest method configuration.

@Produces
@ApplicationScoped
@Named("properties")
private static PropertiesComponent configuration() {
    Properties properties = new Properties();
    properties.put("from", "inbound");
    properties.put("to", "direct:outbound");
    properties.put("header.message", "n/a");
    PropertiesComponent component = new PropertiesComponent();
    component.setInitialProperties(properties);
    return component;
}
Also used : Properties(java.util.Properties) PropertiesComponent(org.apache.camel.component.properties.PropertiesComponent) Named(javax.inject.Named) Produces(javax.enterprise.inject.Produces) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Example 85 with Named

use of javax.inject.Named in project camel by apache.

the class BeanInjectTest method configuration.

@Produces
@ApplicationScoped
@Named("properties")
private static PropertiesComponent configuration() {
    Properties properties = new Properties();
    properties.put("property", "value");
    PropertiesComponent component = new PropertiesComponent();
    component.setInitialProperties(properties);
    return component;
}
Also used : Properties(java.util.Properties) PropertiesComponent(org.apache.camel.component.properties.PropertiesComponent) Named(javax.inject.Named) Produces(javax.enterprise.inject.Produces) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Aggregations

Named (javax.inject.Named)136 Produces (javax.enterprise.inject.Produces)40 ApplicationScoped (javax.enterprise.context.ApplicationScoped)31 Test (org.junit.Test)29 Provides (com.google.inject.Provides)23 Properties (java.util.Properties)18 Singleton (javax.inject.Singleton)18 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)15 Api (com.google.api.server.spi.config.Api)15 SimpleLevelOverridingApi (com.google.api.server.spi.testing.SimpleLevelOverridingApi)15 JsonNode (com.fasterxml.jackson.databind.JsonNode)14 PropertiesComponent (org.apache.camel.component.properties.PropertiesComponent)12 Annotation (java.lang.annotation.Annotation)11 Provides (dagger.Provides)9 ArrayList (java.util.ArrayList)8 Inject (javax.inject.Inject)8 List (java.util.List)7 HashMap (java.util.HashMap)6 Method (java.lang.reflect.Method)5 ApiConfigAnnotationReader (com.google.api.server.spi.config.annotationreader.ApiConfigAnnotationReader)4