JBoss development,
A new message was posted in the thread "JBDEPLOY-226 - DeployerClient change
extension":
http://community.jboss.org/message/528201#528201
Author : Adrian Brock
Profile :
http://community.jboss.org/people/adrian@jboss.org
Message:
--------------------------------------------------------------
alesj wrote:
I see we're on the same page -- this feature is just a nicer API, done width first.
I was just wondering if you're tackling the circular references problem.
((ab)using this thread to check up on you )
Nope. But that probably needs resolving
(pun intended) in the jboss-dependency project?
Currently a DependencyItem knows what it wants to resolve against and just checks whether
it is in the correct state.
If however this leads to a circular dependency, nothing moves.
e.g.
A depends upon B at CLASSLOADER
B depends upon A at CLASSLOADER
For A,
ControllerContext context = controller.getContext(B, CLASSLOADER);
will return null and the same for B with respect to A.
Instead, what is required is some api within the DependencyInfo/Item to say, well actually
I will return a context because
the only thing that is stopping them moving is the circular dependency.
Something like:
RequirementDependencyItem extends AbstractDependencyItem
{
public boolean resolve(Controller)
{
Module module = resolveModule();
// Now we know what we want to resolve to
if (module != null)
{
ControllerContext ctx = module.getControllerContext();
putThisDependencyInASemiResolvedStateOnContext(ctx)
boolean resolved =
doesTheOtherContextAndItsTransientsHaveCompletelyUnresolvedDependenies(ctx,
getDependentState()); // i.e. not resolved at all rather resolved or semi-resolved
// etc.
}
}
}
I can prototype this in the ClassLoading project, but I think it is a general
requirement?
NOTE: This feature is only possible for a dependency where the underlying model can handle
circular dependencies.
e.g. constructors on pojos can't do it
But the classloading can, since it can lazily wire the classloaders together using the
ClassLoaderPolicyFactory on the DelegateLoader.
--------------------------------------------------------------
To reply to this message visit the message page:
http://community.jboss.org/message/528201#528201