Search in sources :

Example 26 with Produces

use of javax.enterprise.inject.Produces in project camel by apache.

the class Application method properties.

@Produces
@ApplicationScoped
@Named("properties")
// "properties" component bean that Camel uses to lookup properties
PropertiesComponent properties(PropertiesParser parser) {
    PropertiesComponent component = new PropertiesComponent();
    // Use DeltaSpike as configuration source for Camel CDI
    component.setPropertiesParser(parser);
    return component;
}
Also used : PropertiesComponent(org.apache.camel.component.properties.PropertiesComponent) Named(javax.inject.Named) Produces(javax.enterprise.inject.Produces) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Example 27 with Produces

use of javax.enterprise.inject.Produces in project camel by apache.

the class PropertiesConfigurationTest method propertiesComponent.

@Produces
@ApplicationScoped
@Named("properties")
private static PropertiesComponent propertiesComponent() {
    Properties configuration = new Properties();
    configuration.put("property", "value");
    PropertiesComponent component = new PropertiesComponent();
    component.setInitialProperties(configuration);
    component.setLocation("classpath:camel1.properties,classpath:camel2.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 28 with Produces

use of javax.enterprise.inject.Produces in project jetty.project by eclipse.

the class JettyWebSocketSessionProducer method getSession.

@Produces
public Session getSession(InjectionPoint injectionPoint) {
    if (LOG.isDebugEnabled()) {
        LOG.debug("getSession({})", injectionPoint);
    }
    WebSocketScopeContext ctx = WebSocketScopeContext.current();
    if (ctx == null) {
        throw new IllegalStateException("Not in a " + WebSocketScope.class.getName());
    }
    org.eclipse.jetty.websocket.api.Session sess = ctx.getSession();
    if (sess == null) {
        throw new IllegalStateException("No Session Available");
    }
    return sess;
}
Also used : Session(org.eclipse.jetty.websocket.api.Session) Produces(javax.enterprise.inject.Produces)

Example 29 with Produces

use of javax.enterprise.inject.Produces in project quickstarts by jboss-switchyard.

the class CamelSAPConnectionConfigurationProducer method create.

@Produces
@Named("sap-configuration")
public SapConnectionConfiguration create(@Named("destinationDataStore") Map<String, DestinationData> destinationDataStore, @Named("serverDataStore") Map<String, ServerData> serverDataStore) {
    SapConnectionConfiguration conf = new SapConnectionConfiguration();
    conf.setDestinationDataStore(destinationDataStore);
    conf.setServerDataStore(serverDataStore);
    return conf;
}
Also used : SapConnectionConfiguration(org.fusesource.camel.component.sap.SapConnectionConfiguration) Named(javax.inject.Named) Produces(javax.enterprise.inject.Produces)

Example 30 with Produces

use of javax.enterprise.inject.Produces in project quickstarts by jboss-switchyard.

the class DestinationMetadataProducer method createDestinationData.

@Produces
@Named("nplDestinationData")
public DestinationData createDestinationData() {
    DestinationData data = RfcFactory.eINSTANCE.createDestinationData();
    data.setAshost("nplhost");
    data.setSysnr("42");
    data.setClient("001");
    data.setUser("developer");
    data.setPasswd("ch4ngeme");
    data.setLang("en");
    return data;
}
Also used : DestinationData(org.fusesource.camel.component.sap.model.rfc.DestinationData) Named(javax.inject.Named) Produces(javax.enterprise.inject.Produces)

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