cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Wheeler <rwhee...@artifact-software.com>
Subject Re: Controlling Load Order of Modules
Date Thu, 18 Feb 2016 14:01:48 GMT
Does this not depend on the classloader rather than the package being 
loaded?
http://www.javaworld.com/article/2077260/learn-java/learn-java-the-basics-of-java-class-loaders.html

It seems that any solution that take advantage of the "current" 
classloader will be fragile and subject to sudden failure if the JVM 
updates the classloader to one with a different strategy.

Can you not write your own classloader that forces the order that you want?

Never tried any of this so take these suggestions as being worth no more 
than they cost!

Ron

On 18/02/2016 5:47 AM, Jeff Hair wrote:
> Hi,
>
> We've run across an interesting case where we have the need to load a
> module before other modules. Normally this kind of thing is handled by
> putting the module up higher in the hierarchy. Our problem is that this
> module is part of core, and to make it load first we'd have to put it above
> core.
>
> Is there any established method for controlling the load order of
> sub-modules within a module? Currently they are sorted by a TreeMap using
> natural sorting. We've implemented a comparator to force our module to the
> top of the list, but this seems like a hack (though it's much better than
> giving our module the name "aaa-ourmodule".)
>
> Jeff
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


Mime
View raw message