use of javax.enterprise.inject.Produces in project camel by apache.
the class WidgetApplication method createActiveMQComponent.
/**
* Factory to create the {@link ActiveMQComponent} which is used in this application
* to connect to the remote ActiveMQ broker.
*/
@Produces
public static ActiveMQComponent createActiveMQComponent() {
// you can set other options but this is the basic just needed
ActiveMQComponent amq = new ActiveMQComponent();
// The ActiveMQ Broker allows anonymous connection by default
// amq.setUserName("admin");
// amq.setPassword("admin");
// the url to the remote ActiveMQ broker
amq.setBrokerURL("tcp://localhost:61616");
return amq;
}
use of javax.enterprise.inject.Produces in project liquibase by liquibase.
the class CDITestProducer method createDataSource.
@Produces
@LiquibaseType
public DataSource createDataSource() throws SQLException {
JDBCDataSource ds = new JDBCDataSource();
ds.setDatabase("jdbc:hsqldb:mem:test");
ds.setUser("sa");
ds.setPassword("");
return ds;
}
use of javax.enterprise.inject.Produces in project deltaspike by apache.
the class InjectableResourceProducer method getInputStreams.
@Produces
@InjectableResource(resourceProvider = InjectableResourceProvider.class, location = "")
public List<InputStream> getInputStreams(final InjectionPoint injectionPoint) {
InjectableResource injectableResource = getAnnotation(injectionPoint);
InjectableResourceProvider provider = BeanProvider.getContextualReference(injectableResource.resourceProvider());
return provider.readStreams(injectableResource);
}
use of javax.enterprise.inject.Produces in project deltaspike by apache.
the class InjectableResourceProducer method getInputStream.
@Produces
@InjectableResource(resourceProvider = InjectableResourceProvider.class, location = "")
public InputStream getInputStream(final InjectionPoint injectionPoint) {
InjectableResource injectableResource = getAnnotation(injectionPoint);
InjectableResourceProvider provider = BeanProvider.getContextualReference(injectableResource.resourceProvider());
final InputStream is = provider.readStream(injectableResource);
return is;
}
use of javax.enterprise.inject.Produces in project oxAuth 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