This idea came from David Blevins, and hopefully he'll rewrite this page if I get it wrong. The directory structure of a server is normally hardcoded or in better servers the names of directories and position is controllable within fairly strict limits. Instead of coding the directory structure in the server, each directory contains a dot file (say .xbeandir) which is a properties file which describe how the directory should be processed and the server contains a set of directory handlers which process the dot files. At startup the server scans the root directories (normally just the server base dir) and normally these root directories tell the server to recursively scan the sub directories but they don't have to. The Tomcat Style Layout could be defined using the following handlers:
None (part of boot strap)
ClassLoader name=common classesDirs=classes libDirs=i18n,lib
ClassLoader name=common parent=common classesDirs=classes libDirs=lib
This structure can easily be adapted to any existing server structure meaning that XBean can be used in more in projects and it allows an installation to emulate an existing server reducing retraining costs of administrators when switching servers.