camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashwin Karpe <aska...@progress.com>
Subject Re: Heavyweight Converter: Caching?
Date Thu, 28 Jan 2010 01:13:43 GMT

Hi,

No, the JNDI Registry is not designed for caching objects but to store
object references (TypeConverter instances included..). What I was trying to
say was that if it is expensive to constantly create instances of the object
you need, you could store the reference(s) of all said
TypeConverters(assuming there are not too many of them :)) and then pull it
up and use it on demand without incurring the cost of object creation.

If you need a true cache for your solution to work, there is a Camel Cache
component that allows any objects that is capable of storing serializable
objects. If your Type converters implement Serializable, they could be
stored in the Cache and then used via Camel processors on demand.

Cheers,

Ashwin...


http://camel.apache.org/cache.html http://camel.apache.org/cache.html 



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--tp27337830p27349593.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message