[jsword-devel] WebStart and BibleDesktop
DM Smith
dmsmith at crosswire.org
Wed Feb 27 13:59:27 MST 2013
On Feb 27, 2013, at 2:48 PM, Chris Burrell wrote:
> Hi DM
>
> The link seems broken. Is this related to our use of classloaders? I still think we shouldn't be using classloaders. Usually, one introduces classloaders to isolate parts of the application from other parts. For example Tomcat isolates different webapps from each other, but each webapp has access to the parent classloader. Or for example, within a webapp, Spring might isolate various components such as the servlets from the services declared.
>
> What stops us from doing something like:
>
> Resource r = readFileFromJSwordHomes();
> if(r == null) {
> r = readFileFromClassPath();
> }
>
> This seems much simpler. And even if it is unrelated to the bug you mention above, would reduce the complexity in JSword further.
Today, if you drop into JSWORD_HOME internationalized property files, JSword will pick them up.
So let's say, we add a new BibleNames to JSword. Rather than having to have a new release all we have to do is have an end user put
BibleNames_xxx.properties into $JSWORD_HOME.
The other thing that it allows is that BibleNames_xxx.properties can be found there in three different forms under JSword home:
BibleNames_xxx.properties
org.crosswire.jsword.versification.BibleNames_xxx.properties
org/crosswire/jsword/versification/BibleNames_xxx.properties
The second form is needed when resources for two different packages have the same name.
The last form is a pain to manage, but comes for free.
If all three are present, only one is found (according to the custom class loader's search order it is the first).
Note on our classloader we only use it to look up resources. We do not muck with a thread's classloader.
-- DM
More information about the jsword-devel
mailing list