I said when I first committed jboss-classloading that is was a bad thing that RequirementDependencyItem was in the public spi.
It shouldn't really be leaking the MC api through to the user but I couldn't think of an easy way to abstract it. So the spi is already a bit ugly. :-(
One way to do it would be to make the class package private in spi and have a factory method on the Module to construct it,
I haven't looked at whether this really works?
package org.jboss.classloading.spi;
/*package private*/ class WildcardDelegateLoader extends FilteredDelegateLoader
and
public class Module {
public DelegateLoader resolveWildcard(...)
{
WildcardDelegateLoader result = new WilcardDelegateLoader(...);
return result.resolve(...);
}
}
I'm sure you'll find a way to do it? :-)