Hi,

There is no caching involved in using the JNDI registry. What I was
suggesting was that if this POJO or set of POJO's (assuming these are in the
1-15 unique objects range) can be created upfront and stored in a registry.
The required POJO/bean could then be pulled up in a processor as follows by
referring to the registry 

public class MyProcessor implements Processor {
  public void process(Exchange exchange) throws Exception {
       MyPojo pojo = (MyPojo)
(exchange.getContext().getRegistry().lookup("ObjectName");
  }
}

Looks like Willem has resolved some of this already using threadLocal
storage. 

I am just providing a generic way to cut the cost of object creation and
using the object quickly without involving expensive caching strategies.

Sorry about any confusion... Hope this helps...

Cheers,

Ashwin...
 

waterback wrote:
> 
> I quite don't get the idea of it... Is there some sort of caching involved
> then using that JndiRegistry
> (assuming i understand that enough, to make it work :-).
> 
> When i just get the reference and it is just one object, i don't win
> anything, or am i wrong?
> 
> Thank you Ashwin,
> Good Idea: Cheers,
> Martin
> 
> 
> 
> Ashwin Karpe wrote:
>> 
>> Hi,
>> 
>> The most straightforward way I can think of is to load the Object
>> reference into a JNDI Registry and associate it with the CamelContext
>> during instantiation or by using setters methods at a later point.
>> 
>> The reference can then be looked up as and when needed to get a reference
>> to the TypeConverter. 
>> 
>> Check out the following link to see how this may be done.
>> 
>>  http://camel.apache.org/lucene.html http://camel.apache.org/lucene.html 
>> 
>> Cheers,
>> 
>> Ashwin...
>> 
>> Hope this helps.
>> 
>> Cheers,
>> 
>> Ashwin...
>> 
>> 
> 
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: 
http://old.nabble.com/Heavyweight-Converter%3A-Caching--tp27337830p27349826.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to