JNDI Registry

View: New views
2 Messages — Rating Filter:   Alert me  

JNDI Registry

by DANIEL DE OLIVEIRA FERREIRA :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Reading the camel manual, I saw follow snippet:

    JndiRegistry reg = super.createRegistry();
    reg.bind("testdb", ds);
    return reg;

but, where I find createRegistry method? There is a way to registre
datasource programmatically, no spring xml?

Daniel de Oliveira Ferreira
Programador
Farmácias Pague Menos

danieloliveira@...
(85) 3255.5453
www.paguemenos.com.br



Re: JNDI Registry

by Claus Ibsen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Oct 30, 2009 at 1:38 PM, DANIEL DE OLIVEIRA FERREIRA
<danieloliveira@...> wrote:

> Hi,
>
> Reading the camel manual, I saw follow snippet:
>
>    JndiRegistry reg = super.createRegistry();
>    reg.bind("testdb", ds);
>    return reg;
>
> but, where I find createRegistry method? There is a way to registre
> datasource programmatically, no spring xml?
>

That above is for unit testing, where you use the camel-test.jar.

You can just pass in a JNDI context to the DefaultCameContext contstructor.
And there is also a dummy jndi implementation in org.apache.camel.util
you can use.

And in camel 2.1 there is a SimpleRegistry instead that is even easier to use.



> Daniel de Oliveira Ferreira
> Programador
> Farmácias Pague Menos
>
> danieloliveira@...
> (85) 3255.5453
> www.paguemenos.com.br
>
>
>



--
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus