"bill.burke(a)jboss.com" wrote :
| FYI, my question on DependencyItem is simple. When does it get invoked upon. What
triggers it. If i know this information, then I can proceed.
I'll answer your question with some psuedo code that describes the MC algorithm :-)
| whenSomebodyInstallsANewContext()
| {
| registerItInNotInstalledState();
|
| // Go through all the states from NOT_INSTALLED TO INSTALLED
|
| for (ControllerState state : allStates)
| {
|
| // Go through all the contexts at the current state
|
| List<ControllerContext> contexts : getContextsInState(state);
| for (ControllerContext context : contexts)
| {
| List<DependencyItem> items =
context.getDependencyInfo().getDependencies(context.getNextState());
|
| // See whether the depenencies are resolved
|
| boolean readyToGoToNextState = true;
| for (DependencyItem item : items)
| {
| if (item.resolve() == false)
| readyToGoToNextState = false;
| }
|
| // If they are bump it to the next state
|
| if (readyToGoToNextState())
| doIt();
| }
| }
| }
|
Of course the real implementation is more complicated because of ControllerMode,
multithreading, recursion and error handling, but that algorthim is effectively all the MC
does.
So you can see it will check dependency items for every context that is not in a
fully installed state when somebodyinstalls a new context.
But only those dependency items that lead to the next state.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082235#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...