[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Uninstall OnDemand context if there are no more dependen

kabir.khan@jboss.com do-not-reply at jboss.com
Wed Jul 15 05:32:21 EDT 2009


Sure, I can change it. There are several other examples of this though, or are they subtly different?

  |    protected void change(ControllerContext context, ControllerState state, boolean trace) throws Throwable
  |    {
  |          int currentIndex = states.indexOf(fromState);
  |          int requiredIndex = states.indexOf(state);
  |          ...
  |             while (currentIndex > requiredIndex)
  |             {
  |                uninstallContext(context, trace);
  |                currentIndex = states.indexOf(context.getState());
  |             }
  |    }
  | 
  |    protected void uninstallContext(ControllerContext context, ControllerState toState, boolean trace)
  |    {
  |       int targetState = states.indexOf(toState);
  |       if (targetState == -1)
  |          log.error("INTERNAL ERROR: unknown state " + toState + " states=" + states, new Exception("STACKTRACE"));
  | 
  |       while (true)
  |       {
  |          ...
  |          if (targetState > currentState)
  |             return;
  |          else
  |             uninstallContext(context, trace);
  |       }
  |    }
  | 


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

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



More information about the jboss-dev-forums mailing list