[jboss-dev-forums] [JBoss AS7 Development] - Re: META-INF/services for module extensions - question/issue

Brian Stansberry do-not-reply at jboss.com
Thu Sep 8 13:11:06 EDT 2011


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&containerType=14&container=2225]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20110908/a2d3a80d/attachment.html 


More information about the jboss-dev-forums mailing list