Brian Stansberry [
http://community.jboss.org/people/brian.stansberry] created the
discussion
"Re: META-INF/services for module extensions - question/issue"
To view the discussion, visit:
http://community.jboss.org/message/625583#625583
--------------------------------------------------------------
Yes, we completely agree that the java.util.ServiceLoader API is the correct one to use.
You shouldn't have to use any jboss-modules API.
The difference between this case and an EAR/RAR/WAR relates to the reliance on the thread
context class loader. In an EE application, what the TCCL should be is clearly mandated
in the EE spec. There is a contract the application code can rely on. In the case of an
Extension there was no such contract. In the absence of a contract, the TCCL could be
anything. In that kind of situation it's always better to use the 2 arg variant of
java.util.ServiceLoader.load().
I apologize if this issue has caused your team frustration. During development of AS7 we
didn't have cases of anyone using Extension in this way, so how the TCCL was set did
not show up as an issue. Now that we see that extension developers expect the TCCL to be
set differently than we were doing it, we've changed the AS to set the TCCL to the
Extension implementation's classloader. I'll change the Extension javadoc to state
that, which will make this an official contract that can be relied upon.
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/625583#625583]
Start a new discussion in JBoss AS7 Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]