[jboss-dev-forums] [JBoss Microcontainer Development POJO Server] - Re: Implementing a non-flat deployment for Weld Integration
Ales Justin
do-not-reply at jboss.com
Wed Sep 29 07:33:36 EDT 2010
Ales Justin [http://community.jboss.org/people/alesj] created the discussion
"Re: Implementing a non-flat deployment for Weld Integration"
To view the discussion, visit: http://community.jboss.org/message/563878#563878
--------------------------------------------------------------
> Flavia Rainone wrote:
>
> IMO, I would move the initialization of default domain to a static block. In this block, I would also add the lib Archives after the default domain is created:
> - we know that ClasspathFactory will be loaded only when it is needed. At the time ClasspathFactory is loaded, hence, it is because we are on a deploy process and it means that we will need default domain, so no gain in initializing DefaultClasspath inside of getClasspath
> - if the libraries are loaded after ClasspathFactory, we won't enter the loop
> - if the libraries are loaded in a static block, we know that nobody is using ClasspathFactory, so we know nobody will get his hands on a DefaultClasspath that lacks the lib Archives
> - you get rid of the synchronized (DefaultDomain) block. No need to synchronize just to return something that is already initialized. As almost every request to create a classpath will recursively enter this block, this is a nice thing
>
> Regardless of whether you decide to move it to a static block, which is personal choice, if you load the DefaultClasspath prior to creating the lib archives, you will get rid of the infinite loop. The reason for this is that ArchiveInfo transparently creates a Classpath to represent the associated ClassLoader domain.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/563878#563878]
Start a new discussion in JBoss Microcontainer Development POJO Server at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2116]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20100929/78b6974d/attachment.html
More information about the jboss-dev-forums
mailing list