[jboss-dev-forums] [JBoss Microcontainer Development] - Re: Optimizing ControllerState

kabir.khan@jboss.com do-not-reply at jboss.com
Thu Oct 29 13:30:53 EDT 2009


Replacing the use of 'states' in AbstractController it is making the assumption in some places that NOT_INSTALLED will always be the first state, e.g.

  |    protected boolean incrementState(ControllerContext context, boolean trace)
  |    {
  |       ControllerState fromState = context.getState();
  | 
  |       Controller fromController = context.getController();
  |       Set<ControllerContext> fromContexts = null;
  | 
  |       int currentIndex = -1;
  |       if (ControllerState.ERROR.equals(fromState))
  |       {
  |          errorContexts.remove(context);
  |          Throwable error = null;
  |          unlockWrite();
  |          try
  |          {
  |             install(context, ControllerState.ERROR, ControllerState.NOT_INSTALLED);
  | 

Should this be enforced, i.e. we throw an error if someone tries to add a state before NOT_INSTALLED?

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

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



More information about the jboss-dev-forums mailing list