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

kabir.khan@jboss.com do-not-reply at jboss.com
Fri Oct 30 05:44:34 EDT 2009


"alesj" wrote : 
  | I would just have CSModel::getInitialState().
Yeah, I was thinking something along the same lines after posting.

"alesj" wrote : 
  | But AbstractKernelController::getContext could be fixed to apply this the same way. 
  | 
Will do

"alesj" wrote : 
  | About that CSModel::isValid(ControllerState), I don't think it's needed, 
  | perhaps only for sanity, but not as part of interface. 
  | 
  | As ControllerState creation should already be controlled via single CS registry, 
  | hence would almost be impossible to get an invalid instance. 
  | 
Although a state has been created via a registry, as I understand it it that does not mean it is valid in a particular controller, e.g.:

  | Controller controllerA = ..
  | Controller controllerB = ..
  | 
  | ControllerState stateA = StateRegistry.getState("A");
  | controllerA.addState(stateA, null);
  | ControllerState stateB = StateRegistry.getState("B");
  | controllerB.addState(stateB, null);
  | 
stateA will not be valid in controllerB, and vice versa. Unless the getState() belongs to the controller and adds it automatically, in which case Controller.addState() becomes superfluous.

I've fixed a problem in incrementState() where when called initially with a context in the ERROR state getting moved from ERROR->NOT_INSTALLED in the first install() call and then from ERROR->NOT_INSTALLED again in the second call to install() 



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

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



More information about the jboss-dev-forums mailing list