[jboss-dev-forums] [JBoss Microcontainer Development POJO Server] - Re: VFSClassLoaderPolicy backed jboss-cl performance issue
mstruk
do-not-reply at jboss.com
Tue Aug 25 08:51:04 EDT 2009
"jaikiran" wrote : A bit more on a higher level - Assuming we have a ZipEntryContext/Handler, does it know of the entries within that zip? I see a ZipEntryContext.entries Map in the code, but haven't yet figured out whether looking directly into this would indicate the presence/absence of a resource within the zip.
|
| So if a getChild(String path) is invoked, maybe looking into this "entries" would tell us whether it's present or not?
|
Yes, ZipEntryContext.entries contains relative path of the entry within a zip as the key and EntryInfo representing the entry as the value.
It reflects the state of a zip archive in a specific point in time.
Since entries is initialized in a lazy manner you need to make sure it was initialized first - before relying on direct entries.get(path).
ensureEntries() is the method that does that and it is called from checkIfModified().
But you can call ensureEntries() directly of course - without going through checkIfModified().
There is initStatus field you can use to check that entries have been initialized:
| if (initStatus == InitializationStatus.INITIALIZED) {
| EntryInfo entry = entries.get(path);
| }
|
But again, if you want to detect changes in the underlying zip file, you have to call checkIfModified which does the reinit of entries for you if it detects a change.
- marko
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4251468#4251468
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4251468
More information about the jboss-dev-forums
mailing list