[Design the new POJO MicroContainer] - Wrong dependency info after module uninstall
by alesj
I've added UndeployOrderClassLoaderUnitTestCase that exposes the next problem (which Scott and me stumbled upon our OSGi demo at JBW):
We have two modules, acme1.jar and acme2.jar.
The number is the version of packages inside (org.jboss.acme.*).
And we have foobar.jar that requires o.j.a.ales#1 (meaning it's from acme1.jar) and o.j.a.scott#2 (respectively from acme2.jar).
And when I uninstall acme2.jar it does unwind foobar's deployment controller context back to Describe.
But invoking DeployerClient.checkComplete produces IncompleteDeploymentException from foobar's added dependency on the acme2.jar instead of giving the right info about o.j.a.scott#2 requirement.
We don't care about the module from where the pckg capabilities come from, so the info is misleading.
Changing RequirementDependencyItem.unresolved to override the AbstractDependencyItem's similar method does the trick since it nullifies IDependOn, hence the info will come from toString which includes requirements.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4130156#4130156
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4130156
18 years, 1 month
[Design the new POJO MicroContainer] - New ClassLoadING projects in MC trunk
by adrian@jboss.org
NEW PROJECTS
I've added the refactored classloadING projects to the MC trunk.
There are two projects, one is the basic infrastructure "classloading'
the other is the VFS plugin, including the BeanMetaDataFactory that can be
used to create an OSGi style classloader in a -beans.xml
This api is mainly taken from the deployers-impl/vfs projects and made into
a public spi with a lot more tests and a few more features.
There's the old issue with the VFS not working properly in Maven
for the classloading-vfs tests. I'll take this up in the build forum.
What's left to do?
TODO OSGi
In terms of for OSGi this method sums up what is left in the resolution process
org.jboss.classloading.spi.dependency.Domain
| /**
| * Resolve the requirement
| *
| * @param controller the controller
| * @param module the module
| * @param requirement the requirement
| * @return the resolved name or null if not resolved
| */
| protected Object resolve(Controller controller, Module module, Requirement requirement)
| {
| // TODO JBMICROCONT-182 include parent domains in requirements
| // TODO JBMICROCONT-182 check consistency of re-exports
| // TODO JBMICROCONT-182 check for self-dependency
| // TODO JBMICROCONT-182 test circularity
| for (Module other : modules)
| {
| List<Capability> capabilities = other.getCapabilities();
| if (capabilities != null)
| {
| for (Capability capability : capabilities)
| {
| if (capability.resolves(module, requirement))
| return other.getContextName();
| }
| }
| }
| return null;
| }
|
Basically instead of it resolving the capabilities based on list traversal
over the modules and requirements, it needs to look at requirements
in the round and try to resolve a consistent set for related classloaders.
This includes classloaders from different domains.
I pretty much know how to do this (there a few gotchas :-)
but this only requires changes to implementation details.
If you look at the code there's now support for re-exports and "uses"
so the other remaining detail for OSGi are the dynamic imports.
This may require a change to the ClassLoaderPolicy to make it work
properly?
TODO INTEGRATE WITH DEPLOYERS
Going beyond OSGi, the next step is to plugin this work to the deployers.
This should be fairly easy and the TopLevelClassLoaderDeployer should
get a bit nicer.
The only issue I can think are there a couple of places in the AS
using the old private version of this api. These will obviously benefit
from using a supported stable spi.
TODO JBossAS RC1
After that, the remaining classloader issues are:
* Use the classloader-vfs to modularise the AS bootstrap
* Add the management requirements that Scott asked for
* Sort out the WAR classloader properly, i.e. introduce proper support
in the deployers for subdeployments having managed child classloaders
of the main deployment classloader.
Once these issues are resolved, all the classloading requirements
for JBoss5 and OSGi will be done. Other classloading changes
should be just value add.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4130111#4130111
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4130111
18 years, 1 month