[jboss-user] [JBoss Microcontainer Development] New message: "Circular Dependencies and Semi-Resolve"

Adrian Brock do-not-reply at jboss.com
Fri Mar 5 10:52:04 EST 2010


User development,

A new message was posted in the thread "Circular Dependencies and Semi-Resolve":

http://community.jboss.org/message/530202#530202

Author  : Adrian Brock
Profile : http://community.jboss.org/people/adrian@jboss.org

Message:
--------------------------------------------------------------
https://jira.jboss.org/jira/browse/JBKERNEL-109
 
I've committed a prototype for circular dependencies.
This involved three main changes:
 
1) The ability to "semiResolve" a dependency which means that you know what you want to depend on,
but it is not in the correct state yet. However, if the only thing that is stopping it moving to the correct
state is a circular dependency (i.e. other things in the semi-resolved state) then it will upgraded to fully resolved.
 
2) Change AbstractDependencyItem to use an enum for the three different types of resolved states,
resolved, semi-resolved and unresolved and track the different types in AbstractDependencyInfo for optimized processing of the
different types.
 
3) A change in AbstractController to introduce an "uninstalling" set like the "installing" set, to avoid recursive
when uninstalling contexts that have circular dependencies.
 
Caveats:
 
* I haven't looked at adding ON_DEMAND processing, although it should be simple to add?
 
* The semi-resolved handling only looks at contexts in the previous state to what you require.
If they are in any earlier state then they are unresovled until they progress to the previous state.
This avoids having to do a complicated determination on whether there is a path to break the circular dependency,
rather than just advancing all the related semi-resolved contexts to the next state.

Its usage should be trivial:
 
public MyDependencyItem extends AbstractDependencyItem
{
    public boolean resolve(Controller)
    {
         // Determine the context we want to be semi-resolved on
         ControllerContext ctx = ...;
         if (ctx == null)
            return false;
 
         // Pass the handling to AbstractDependencyItem
         return semiResolve(ctx);
    }
}

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/530202#530202




More information about the jboss-user mailing list