[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Dependencies from scoped to global

alesj do-not-reply at jboss.com
Tue Aug 19 09:30:35 EDT 2008


"kabir.khan at jboss.com" wrote : 
  | Unless you know what I have said above is wrong, I can try to reproduce with a test case.
I know what the problem is.
The problem is simple :-),
it's the solution that is not that trivial. :-(

The issue is that when you do install,
the underlying controller used in that dependency item resolution is scoped,
but when you do uninstall

  |             Set<DependencyItem> dependsOnMe = dependencies.getDependsOnMe(null);
  |             if (dependsOnMe.isEmpty() == false)
  |             {
  |                for (DependencyItem item : dependsOnMe)
  |                {
  |                   if (item.isResolved())
  |                   {
  |                      ControllerState dependentState = item.getDependentState();
  |                      if (dependentState == null || dependentState.equals(fromState))
  |                      {
  |                         if (item.unresolved(this))
  |                         {
  |                            ControllerContext dependent = getContext(item.getName(), null);
  |                            if (dependent != null)
  |                            {
  |                               ControllerState whenRequired = item.getWhenRequired();
  |                               if (whenRequired == null)
  |                                  whenRequired = ControllerState.NOT_INSTALLED;
  |                               if (isBeforeState(dependent.getState(), whenRequired) == false)
  |                                  uninstallContext(dependent, whenRequired, trace);
  |                            }
  | 
the controller (see 'this') is not scoped,
hence has no clue about scoped bean.

Dunno what kind of quick hack could fix this. :-)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4171267#4171267

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4171267



More information about the jboss-dev-forums mailing list