David Black wrote:
Hi,
I'm wondering about ServiceMix/JBI and JNDI. I see from the spec and APIs
that I can get a JNDI InitialContext via ComponentContext.getNamingContext()
.... ok, so how do things get bound to that?
You need to configure JNDI using some mechanism. e.g. we tend to use
Spring to configure JNDI
I see there is a SpringInitialContextFactory which can bind the contents of
a jndi.xml file on the classpath (correct?)
Yes
or a named file, or "the
spring.xml configuration file can be specified by the [EMAIL PROTECTED]
Context#PROVIDER_URL} property" ... I don't understand this bit, where is
that property set? Also, how does a JBI component cause
SpringInitialContextFactory to do its stuff if one wishes to use it?
ServiceMix uses Spring to configure itself; so the JNDI tends to be
configured at the same time as ServiceMix in the same file. Though you
could in a component configure your own JNDI if you like.
e.g. here's an example servicemix.xml which configures a JNDI context...
http://cvs.servicemix.codehaus.org/servicemix/base/src/main/release/examples/bpel/
Beyond that, suppose I'm deploying ServiceMix on a J2EE app server and I've
got stuff in its (the app servers) JNDI tree I want to be able to access
from my JBI component - make sense? possible? nonsense?? e.g. I want to look
up a data source.
Sure - you should be able to access anything from the J2EE container's
JNDI context if you like; or use spring to dependency inject it.
--
James
-------
http://radio.weblogs.com/0112098/