use of javax.enterprise.context.ApplicationScoped 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;
}
use of javax.enterprise.context.ApplicationScoped in project camel by apache.
the class PropertyEndpointTest method configuration.
@Produces
@ApplicationScoped
@Named("properties")
private static PropertiesComponent configuration() {
Properties properties = new Properties();
properties.put("from", "inbound");
properties.put("to", "mock:outbound");
PropertiesComponent component = new PropertiesComponent();
component.setInitialProperties(properties);
return component;
}
use of javax.enterprise.context.ApplicationScoped in project camel by apache.
the class CamelContextProducerMethod method createAndStartContext.
@Produces
@ApplicationScoped
CamelContext createAndStartContext() throws Exception {
DefaultCamelContext context = new DefaultCamelContext();
context.setName("camel-producer-method");
context.start();
return context;
}
use of javax.enterprise.context.ApplicationScoped in project oxTrust by GluuFederation.
the class AppInitializer method createCentralLdapEntryManager.
@Produces
@ApplicationScoped
@Named(LDAP_CENTRAL_ENTRY_MANAGER_NAME)
@CentralLdap
public LdapEntryManager createCentralLdapEntryManager() {
if (this.centralConnectionProvider == null) {
return null;
}
LdapEntryManager centralLdapEntryManager = new LdapEntryManager(new OperationsFacade(this.centralConnectionProvider));
log.info("Created {}: {}", new Object[] { LDAP_CENTRAL_ENTRY_MANAGER_NAME, centralLdapEntryManager.getLdapOperationService() });
return centralLdapEntryManager;
}
use of javax.enterprise.context.ApplicationScoped in project oxTrust by GluuFederation.
the class ApplicationFactory method getCacheConfiguration.
@Produces
@ApplicationScoped
public CacheConfiguration getCacheConfiguration() {
CacheConfiguration cacheConfiguration = applianceService.getAppliance().getCacheConfiguration();
if (cacheConfiguration == null || cacheConfiguration.getCacheProviderType() == null) {
log.error("Failed to read cache configuration from LDAP. Please check appliance oxCacheConfiguration attribute " + "that must contain cache configuration JSON represented by CacheConfiguration.class. Applieance DN: " + applianceService.getAppliance().getDn());
log.info("Creating fallback IN-MEMORY cache configuration ... ");
cacheConfiguration = new CacheConfiguration();
cacheConfiguration.setInMemoryConfiguration(new InMemoryConfiguration());
log.info("IN-MEMORY cache configuration is created.");
}
log.info("Cache configuration: " + cacheConfiguration);
return cacheConfiguration;
}
Aggregations