[weld-issues] [JBoss JIRA] Commented: (WELDSE-25) Weld class should be easier to extend to introduce custom behavior, for example the ability to replace the ResourceLoader

Peter Royle (JIRA) jira-events at lists.jboss.org
Fri May 14 08:35:27 EDT 2010

    [ https://jira.jboss.org/jira/browse/WELDSE-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12530742#action_12530742 ] 

Peter Royle commented on WELDSE-25:

Weld now contains a method configureDeployment() which is called before Weld is booted up. Developers can subclass Weld and override this method to configure the deployment programatically. Eg:

public class MyWeld extends Weld {


    protected void configureDeployment(Deployment deployment) {
       deployment.getServices().add(ResourceLoader.class, new OSGIResourceLoader(myClassloader));

I've also updated URLScanner to use either the configured ResourceLoader (if any) or an instance of DefaultResourceLoader.

Morten, if you have already improved on this level of customisation I'll be happy to incorporate any patches you have.

> Weld class should be easier to extend to introduce custom behavior, for example the ability to replace the ResourceLoader
> -------------------------------------------------------------------------------------------------------------------------
>                 Key: WELDSE-25
>                 URL: https://jira.jboss.org/jira/browse/WELDSE-25
>             Project: Weld support for Java SE
>          Issue Type: Feature Request
>    Affects Versions: 1.0.1.Final
>         Environment: Weld SE + Java 6
>            Reporter: Morten Christensen
> According to the docs "org.jboss.weld.resources.spi.ResourceLoader" is responsible for resource loading/class creation and if it worked it would appear to solve a lot of potential integration problems, f.x. with OSGI (see issue 520).
> Unfortunately, Weld SE does not apper to use ResourceLoaders and it ignores any implementations of this service that the Java SE app supplies. Even worse, Weld SE classloading behavior is hardcoded in "org.jboss.weld.environment.se.util.Reflections". This makes it impossible to use Weld SE where classloading does not work with the Thread's  context class loader such as OSGI etc.
> Weld SE should be changed to look for service implementations  of "org.jboss.weld.resources.spi.ResourceLoader" (i.e. actually work according to its own documentation).
> P.S: It would also be nice if Weld SE would allow users to supply a Classloader to the constructor for org.jboss.weld.environment.se.Weld

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the weld-issues mailing list