Search in sources :

Example 36 with Produces

use of javax.enterprise.inject.Produces 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 37 with Produces

use of javax.enterprise.inject.Produces 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)

Example 38 with Produces

use of javax.enterprise.inject.Produces 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;
}
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 39 with Produces

use of javax.enterprise.inject.Produces 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;
}
Also used : DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) Produces(javax.enterprise.inject.Produces) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Example 40 with Produces

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

the class CdiCamelFactory method cdiEventEndpoint.

@Produces
@SuppressWarnings("unchecked")
private static <// Qualifiers are dynamically added in CdiCamelExtension
T> CdiEventEndpoint<T> cdiEventEndpoint(InjectionPoint ip, @Any Instance<CamelContext> instance, CdiCamelExtension extension, @Any Event<Object> event) throws Exception {
    CamelContext context = selectContext(ip, instance, extension);
    Type type = Object.class;
    if (ip.getType() instanceof ParameterizedType) {
        type = ((ParameterizedType) ip.getType()).getActualTypeArguments()[0];
    }
    String uri = eventEndpointUri(type, ip.getQualifiers());
    if (context.hasEndpoint(uri) == null) {
        context.addEndpoint(uri, extension.getEventEndpoint(uri));
    }
    return context.getEndpoint(uri, CdiEventEndpoint.class);
}
Also used : CamelContext(org.apache.camel.CamelContext) ParameterizedType(java.lang.reflect.ParameterizedType) CdiSpiHelper.isAnnotationType(org.apache.camel.cdi.CdiSpiHelper.isAnnotationType) ParameterizedType(java.lang.reflect.ParameterizedType) Type(java.lang.reflect.Type) Produces(javax.enterprise.inject.Produces)

Aggregations

Produces (javax.enterprise.inject.Produces)56 Named (javax.inject.Named)32 ApplicationScoped (javax.enterprise.context.ApplicationScoped)25 Properties (java.util.Properties)12 PropertiesComponent (org.apache.camel.component.properties.PropertiesComponent)12 ArrayList (java.util.ArrayList)6 Dependent (javax.enterprise.context.Dependent)4 ParameterizedType (java.lang.reflect.ParameterizedType)3 Type (java.lang.reflect.Type)3 RequestScoped (javax.enterprise.context.RequestScoped)3 InjectableResource (org.apache.deltaspike.core.api.resourceloader.InjectableResource)3 InjectableResourceProvider (org.apache.deltaspike.core.api.resourceloader.InjectableResourceProvider)3 OperationsFacade (org.gluu.site.ldap.OperationsFacade)3 LdapEntryManager (org.gluu.site.ldap.persistence.LdapEntryManager)3 FunctionMapperImpl (com.sun.el.lang.FunctionMapperImpl)2 VariableMapperImpl (com.sun.el.lang.VariableMapperImpl)2 CompositeELResolver (javax.el.CompositeELResolver)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