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

Dan Sirbu do-not-reply at jboss.com
Thu Sep 8 12:24:46 EDT 2011


Dan Sirbu [http://community.jboss.org/people/lmcdasi] created the discussion

"Re: META-INF/services for module extensions - question/issue"

To view the discussion, visit: http://community.jboss.org/message/625574#625574

--------------------------------------------------------------
The point is the following, the java.util.ServiceLoader is the common used and portable way of accessing services accross any java platform !
We do aggree on that I hope !

Thus, my point is the following one: if I want to have a ModuleExtension that needs to implement a service then I do not have any issue that I  need to use the ServiceLoader from jboss modules ! That I understand very well, it is a jboss-module way of doing things.

The issue to me is that if the ModuleExtension needs a service from another package that was never intended to be an extention, thus a Module only, then when I want to  access a service from that Module I should NOT need to use the jboss-module ServiceLoader API ! 
I should be able to use the java.util.ServiceLoader as does any WAR/RAR or other type of app deployed as long as the dependency is set properly!

My point is that in 7.0.0 that does NOT work ! Unless I am doing stupind things around - which is always a possibility - but I doubt since I am not the only one in my team to have the same experience ! I used all kind of setups, including the service="import" if I am not wrong !

And I think, from a design point of view, what I want to do should be correct and supported !

So, since so far I used 7.0.0 give me some time to use 7.0.1.

ServiceLoader.load(ServiceAPIClass.class) - fails;

module.loadService(ServiceAPIClass.class) - works where module is the Module object based on the identifier. No matter the dependecy.

I also tryed between others : ServiceLoader.load(ServiceAPIClass.class, TCCLSingletonService.class.getClassLoader().getParent()) - fails

I'll try what you mentioned. Give me some time. I'll try to attach the eclipse projects next time with all setup if I can.

BR,
Dan S.

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/625574#625574]

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/ab10271d/attachment.html 


More information about the jboss-dev-forums mailing list