This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes How to Cache the file stream data in Java using normal POJO. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to Cache the file stream data in Java using normal POJO." Watch "How to Cache the file stream data in Java using normal POJO." New topic
Author

How to Cache the file stream data in Java using normal POJO.

paresh doshi
Ranch Hand

Joined: Nov 20, 2006
Posts: 81
Hi,

I have a jar file that reads the XSD file and parse the input XML through that every time. Can if be possible to load all the XSD files in Cache at once, and every request to that jar file will pick up the data from Cache, so that the performance is improved to a great extent.

Can anyone provide some idea or sample code.

Regards,
Paras.


Thanks.<br />Paresh Doshi<br />SCJP 1.4
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19693
    
  10

If I had to do that, I would write an EntityResolver that cached the schemas. Probably as DOM objects so they didn't have to be parsed over and over, but that would be expanding the time versus memory trade-off more.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to Cache the file stream data in Java using normal POJO.
 
It's not a secret anymore!