public class CamelExtension extends Object implements javax.enterprise.inject.spi.Extension
Constructor and Description |
---|
CamelExtension() |
Modifier and Type | Method and Description |
---|---|
protected void |
contextAwareness(javax.enterprise.inject.spi.ProcessAnnotatedType<org.apache.camel.CamelContextAware> process)
Process camel context aware bean definitions.
|
void |
detectConsumeBeans(javax.enterprise.inject.spi.ProcessBean<?> event)
Lets detect all beans annotated with @Consume and
beans of type
RouteBuilder which are annotated with ContextName
so they can be auto-registered |
void |
detectProducerRoutes(javax.enterprise.inject.spi.ProcessProducerMethod<?,?> event)
Lets detect all producer methods creating instances of
RouteBuilder which are annotated with .apache.camel.cdi.ContextName
so they can be auto-registered |
void |
detectRouteBuilderBeans(javax.enterprise.inject.spi.ProcessBean<?> event)
Lets detect all beans annotated of type
RouteBuilder
which are annotated with ContextName
so they can be auto-registered |
protected void |
detectRouteBuilders(javax.enterprise.inject.spi.ProcessAnnotatedType<?> process) |
protected void |
disableDefaultContext(javax.enterprise.inject.spi.ProcessAnnotatedType<? extends org.apache.camel.CamelContext> process)
Disable creation of default CamelContext bean and rely on context created
and managed by extension.
|
protected org.apache.camel.CamelContext |
getCamelContext(String context) |
static String |
getCamelContextName(String context,
ContextName annotation)
If no context name is specified then default it to the value from
the
ContextName annotation |
protected org.apache.camel.impl.DefaultCamelBeanPostProcessor |
getPostProcessor(String context) |
void |
inject(Object bean)
Perform injection on an existing bean such as a test case which is created directly by a testing framework.
|
protected static boolean |
injectAnnotatedField(Field field)
Returns true if this field is annotated with @Inject
|
protected boolean |
isRoutesBean(Class<?> returnType) |
void |
onInjectionTarget(javax.enterprise.inject.spi.ProcessInjectionTarget<?> event)
Lets perform injection of all beans which use Camel annotations
|
protected void |
registerManagedCamelContext(javax.enterprise.inject.spi.AfterBeanDiscovery abd,
javax.enterprise.inject.spi.BeanManager manager)
Registers managed camel bean.
|
void |
startConsumeBeans(javax.enterprise.inject.spi.AfterDeploymentValidation event,
javax.enterprise.inject.spi.BeanManager beanManager)
Lets force the CDI container to create all beans annotated with @Consume so that the consumer becomes active
|
public static String getCamelContextName(String context, ContextName annotation)
ContextName
annotationprotected void contextAwareness(@Observes javax.enterprise.inject.spi.ProcessAnnotatedType<org.apache.camel.CamelContextAware> process) throws Exception
process
- Annotated type.Exception
- In case of exceptions.protected void detectRouteBuilders(@Observes javax.enterprise.inject.spi.ProcessAnnotatedType<?> process) throws Exception
Exception
protected void disableDefaultContext(@Observes javax.enterprise.inject.spi.ProcessAnnotatedType<? extends org.apache.camel.CamelContext> process)
process
- Annotated type.protected void registerManagedCamelContext(@Observes javax.enterprise.inject.spi.AfterBeanDiscovery abd, javax.enterprise.inject.spi.BeanManager manager)
abd
- After bean discovery event.manager
- Bean manager.public void detectConsumeBeans(@Observes javax.enterprise.inject.spi.ProcessBean<?> event)
RouteBuilder
which are annotated with ContextName
so they can be auto-registeredpublic void detectRouteBuilderBeans(@Observes javax.enterprise.inject.spi.ProcessBean<?> event)
RouteBuilder
which are annotated with ContextName
so they can be auto-registeredpublic void detectProducerRoutes(@Observes javax.enterprise.inject.spi.ProcessProducerMethod<?,?> event)
RouteBuilder
which are annotated with .apache.camel.cdi.ContextName
so they can be auto-registeredpublic void startConsumeBeans(@Observes javax.enterprise.inject.spi.AfterDeploymentValidation event, javax.enterprise.inject.spi.BeanManager beanManager) throws Exception
Exception
public void onInjectionTarget(@Observes javax.enterprise.inject.spi.ProcessInjectionTarget<?> event)
public void inject(Object bean)
protected org.apache.camel.impl.DefaultCamelBeanPostProcessor getPostProcessor(String context)
protected org.apache.camel.CamelContext getCamelContext(String context)
protected static boolean injectAnnotatedField(Field field)
protected boolean isRoutesBean(Class<?> returnType)
Apache Camel