[hibernate-dev] Integrator locator

Steve Ebersole steve at hibernate.org
Mon Apr 4 20:21:46 EDT 2011


So a slight concern.  The javadocs for java.util.ServiceLoader state 
that its load(Class) method uses TCCL.  Given the recent issues we have 
had with TCCL and JBoss AS 7 I wonder if its better to use the explicit 
load(Class,ClassLoader) version?

There the question becomes what ClassLoader to use.  We do have the 
ClassLoaderService which is meant to abstract away access to the 
underlying ClassLoader(s), however its API does not allow access to 
those ClassLoader(s) themselves.


On 03/31/2011 03:51 AM, Adam Warski wrote:
>
> On Mar 30, 2011, at 8:46 PM, Steve Ebersole wrote:
>
>> To be honest not sure what this really buys you.  Basically you have to follow
>> the META-INF/service/{intf-name} pattern for naming your locator file and that
>> locator file, as far as I know, can only have a single entry naming the impl
>> class.  Which is kind of limiting.  What concrete benefits do you actually get
>> then?  The actual resolution code is trivial.
>
>
> Well, just that when users (programmers) see such a file there's a higher chance that they know what it's doing and how is the services discovery working.
> Apart from that, can't think of anything :)
>

-- 
Steve Ebersole <steve at hibernate.org>
http://hibernate.org



More information about the hibernate-dev mailing list