Search in sources :

Example 16 with Produces

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;
}
Also used : ActiveMQComponent(org.apache.activemq.camel.component.ActiveMQComponent) Produces(javax.enterprise.inject.Produces)

Example 17 with Produces

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;
}
Also used : JDBCDataSource(org.hsqldb.jdbc.JDBCDataSource) Produces(javax.enterprise.inject.Produces) LiquibaseType(liquibase.integration.cdi.annotations.LiquibaseType)

Example 18 with Produces

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);
}
Also used : InjectableResourceProvider(org.apache.deltaspike.core.api.resourceloader.InjectableResourceProvider) InjectableResource(org.apache.deltaspike.core.api.resourceloader.InjectableResource) Produces(javax.enterprise.inject.Produces) InjectableResource(org.apache.deltaspike.core.api.resourceloader.InjectableResource)

Example 19 with Produces

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;
}
Also used : InjectableResourceProvider(org.apache.deltaspike.core.api.resourceloader.InjectableResourceProvider) InjectableResource(org.apache.deltaspike.core.api.resourceloader.InjectableResource) InputStream(java.io.InputStream) Produces(javax.enterprise.inject.Produces) InjectableResource(org.apache.deltaspike.core.api.resourceloader.InjectableResource)

Example 20 with Produces

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;
}
Also used : InMemoryConfiguration(org.xdi.service.cache.InMemoryConfiguration) CacheConfiguration(org.xdi.service.cache.CacheConfiguration) Produces(javax.enterprise.inject.Produces) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Aggregations

Produces (javax.enterprise.inject.Produces)51 Named (javax.inject.Named)31 ApplicationScoped (javax.enterprise.context.ApplicationScoped)25 PropertiesComponent (org.apache.camel.component.properties.PropertiesComponent)12 Properties (java.util.Properties)10 ArrayList (java.util.ArrayList)6 Dependent (javax.enterprise.context.Dependent)4 OperationsFacade (org.gluu.site.ldap.OperationsFacade)4 LdapEntryManager (org.gluu.site.ldap.persistence.LdapEntryManager)4 InjectableResource (org.apache.deltaspike.core.api.resourceloader.InjectableResource)3 InjectableResourceProvider (org.apache.deltaspike.core.api.resourceloader.InjectableResourceProvider)3 ParameterizedType (java.lang.reflect.ParameterizedType)2 Type (java.lang.reflect.Type)2 FieldMetaData (org.fusesource.camel.component.sap.model.rfc.FieldMetaData)2 FunctionTemplate (org.fusesource.camel.component.sap.model.rfc.FunctionTemplate)2 ListFieldMetaData (org.fusesource.camel.component.sap.model.rfc.ListFieldMetaData)2 RecordMetaData (org.fusesource.camel.component.sap.model.rfc.RecordMetaData)2 OxIntializationException (org.xdi.exception.OxIntializationException)2 SmtpConfiguration (org.xdi.model.SmtpConfiguration)2 FunctionMapperImpl (com.sun.el.lang.FunctionMapperImpl)1