I have just created a JIRA (see
http://issues.apache.org/activemq/browse/SM-495).
This feature is to provide a better and consistent way to access the JBI bus
from anywhere within the JVM.
I think that JNDI is the good way to do that.
I have already discussed that a bit with Aaron Mulder at ApacheCon EU when
we were looking at Geronimo
integration (we had also thought about using a JCA connector, but this is a
more heavyweight and limited solution).

So I propose the following:

1) create a JNDI factory to create servicemix clients and bind it to the
JNDI tree
  I' m not sure yet if we should bind a JNDI factory were you would
directly
  retrieve a new client when performing a lookup, or a "real" factory which
would enable
  the user to create a client.  The second solution can be useful to pass
additional parameters
  such as the user credentials.  I' m not sure how JNDI works with security
/ JAAS, so any
  input is welcome.

2) we may want to bind a modified implementation of the factory and bind it
to the JNDI context
   for a component.  This factory would use the ComponentContext and build
a client on top
   of it instead of creating a new client (which activate a lightweight
component).
   The only problem is that we would need to have one JNDI context per
component and this
   is not done currently (is that really needed ?)

3) we also need to define an interface implemented by the JBIContainer so
that we can also bind
   it in the JNDI tree.  I think it would be useful to access ServiceMix
specific features without
   relying on some casts like (JBIContainer) ((ComponentContextImpl)
context).getContainer()
   which is currently the only way to retrieve the JBIContainer from a
component.

Any thoughts or volunteer ;) ?

Cheers,
Guillaume Nodet

Reply via email to