[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: JarEntry as VFS root does not return empty vfspath

adrian@jboss.org do-not-reply at jboss.com
Wed Mar 26 05:23:39 EDT 2008


"mstruk" wrote : 
  | Ok, I'm trying another thing first - 'set parent to null' approach, that won't require any additional fields. I see two ways of doing it. One is to propagate some extra info based on which each handler can determine - as it's being created - if it is a root handler or not. That approach is processor intensive and requires small changes in many places. Another approach is to introduce setParent(VirtualFileHandler) or setAsContextRoot() method and call it on only one handler as it's assigned to be context root. That approach requires one extra method and one extra call - very elegant. But ... makes handler creation a two-phase process for handlers that become root and makes these handlers mutable.  Looking at AbstractVirtualFileHandler I find no reliance on immutability so I don't expect problems. 
  | 
  | 
  | I'm testing a fix made using this approach, and so far everything is working nicely.
  | 
  | 
  | In the end I'll remove more code cleaning out the current quick fix than add new code for a proper solution :)
  | 
  | 
  |  - marko
  | 

Sounds overly complicated. The problem with complicated things
is that they generally need workarounds when they don't work as expected
leading to workarounds for workarounds (like the state you are in now :-)

Why can't a JarEntryHandler just be a root in its own right
with JarContext knowing how to properly construct a root handler for a jar entry?

Looks to me like "laziness" in that all the code to do the entry handling
requires a top level JarHandler where it does the initJarFile()
and once that is done, it just does findChild().
i.e. you don't really have a VFS Context for the entry, its for the jar.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4138899#4138899

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4138899



More information about the jboss-dev-forums mailing list