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;
}
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;
}
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;
}
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;
}
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);
}
Aggregations