[jboss-user] [JBoss Microcontainer] New message: "Re: Classloaders: How to hide classes from the DefaultDomain?"

Gilles Compienne do-not-reply at jboss.com
Thu Feb 11 13:20:21 EST 2010


User development,

A new message was posted in the thread "Classloaders: How to hide classes from the DefaultDomain?":

http://community.jboss.org/message/525846#525846

Author  : Gilles Compienne
Profile : http://community.jboss.org/people/gcompienne

Message:
--------------------------------------------------------------
Ok, I have applied what is described in the JavaLobby document. So I have created a separate JAR with a single bean, which I use to create the domain "JavaDomain".
 
 public JavaDomainCreator() {
     log.info("Starting JavaDomainCreator.");
     clSystem = ClassLoaderSystem.getInstance();
     log.info("CLS = " + clSystem);
     clDomain = clSystem.createAndRegisterDomain("JavaDomain");  
 }
 
Then, I have changed the classloader deployment descriptor for my application jar in order to make it use the "JavaDomain" as a parent:
 
<classloading domain="InfinispanCacheDomain" xmlns="urn:jboss:classloading:1.0" 
              import-all="false" parent-first="false" parent-domain="JavaDomain" top-level-classloader="true">
     
 <requirements>
  <package name="test.api"/>
 </requirements>  
 <capabilities>
  <package name="test.service.infinispan_impl"/>
 </capabilities>
   
</classloading>
Now, I can see that my classloader has no visibility of the things that are inside the "/jboss-5.1.0.GA/server/zzz" folder. It still has visibility of the "/jboss-5.1.0.GA/lib", but I suspect this is because these are made part of the bootstrap classpath (which is fine with me, but still something to keep in mind).
 
Now I need to check how I can get this to work in a single JAR file (issue that I need to create the Domain before the "jboss-classloader.xml" probably becomes active), but hopefully I will not have too many issues.
 
Thanks for your help.
 
Regards,
 
Gilles.

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

To reply to this message visit the message page: http://community.jboss.org/message/525846#525846




More information about the jboss-user mailing list