Romain, If you're using a ServletContextListener, it sounds like you're deploying your Camel app in a web app. As for CDI, a/k/a JSR-299, I have not heard of that before but upon looking, it just seems like a "JSRized" implementation of Spring Framework. I was asking about deployment to J2EE and assumed EJB was my only option, but this CDI looks promising. Since my project must use JBoss, I looked and there's a CDI implementation for JBoss, (which they call "Weld", which in turn, is part of their JSF implementation (called "Seam").
http://docs.jboss.org/weld/reference/1.0.0/en-US/html/2.html On the other hand, if you say you were able to deploy in the web tier and access container resources via JNDI - I think I'll just try that first. Thanks, -Charles ________________________________ From: Romain Manni-Bucau <[email protected]> To: [email protected]; Charles <[email protected]> Sent: Monday, July 16, 2012 1:32 PM Subject: Re: How to deploy Camel to EJB / J2EE container? Hi, typically in J2EE or JEE without spring you use standalone like app: create you context manually and manage its lifecycle. You speak about J2EE so i guess you don't have CDI but as a side note with CDI there are some project taking it into account. Personnally i used a servletcontextlistener to build-start/stop my context and used the jndiregistry to be able to get my ejbs. - Romain 2012/7/16 Charles <[email protected]> I have some Camel routes interacting with a 3rd EJB-based app. Currently this is accomplished by >acquiring a JMS topic via JNDI and starting the Camel context in a separate VM >instance, >i.e. running Camel as a regular Java application. This is not really >convenient - I'd like to >package up Camel and the defined routes in an EJB for J2EE deployment because >most of the >application is implemented as EJB's and MBeans on JBoss. >My concerns are: > >Is it even possible? I ask because I'm pretty sure Camel creates it's own >threads and maybe >uses ThreadLocal internally. I'm no an EJB expert, but I understand that >application code >should not create it's own threads. I wonder if this is true even in >stateless session beans? > >I already searched around and the only deployment options I've seen discussed >are >standalone (java app), Spring container and OSGI container - I have found >nothing about >J2EE deployment. Any ideas? > >Thanks, > >-Charles >
