[jboss-dev-forums] [Design of OSGi Integration] - Re: Facade Questions

johnbailey do-not-reply at jboss.com
Mon Feb 25 09:14:01 EST 2008


Makes sense.  I wasn't sure if it would be in a state that would allow it to move directly to INSTALLED.

The getState method will simply map the ControllerState to an equivelent Bundle State.  Are the following resonable?


  |          ControllerState controllerState = getControllerContext().getState();
  |          if (ControllerState.ERROR.equals(controllerState))
  |          {
  |             bundleState = Bundle.INSTALLED; // Seems strange, but see javadoc 
  |          }
  |          else if (ControllerState.NOT_INSTALLED.equals(controllerState))
  |          {
  |             bundleState = Bundle.UNINSTALLED;
  |          }
  |          else if (ControllerState.PRE_INSTALL.equals(controllerState)
  |                || ControllerState.DESCRIBED.equals(controllerState))
  |          {
  |             bundleState = Bundle.INSTALLED;
  |          }
  |          else if (ControllerState.INSTANTIATED.equals(controllerState)
  |                || ControllerState.CONFIGURED.equals(controllerState) 
  |                || ControllerState.CREATE.equals(controllerState))
  |          {
  |             bundleState = Bundle.RESOLVED;
  |          }
  |          else if (ControllerState.START.equals(controllerState))
  |          {
  |             bundleState = Bundle.STARTING;
  |          }
  |          else if (ControllerState.INSTALLED.equals(controllerState))
  |          {
  |             bundleState = Bundle.ACTIVE;
  |          }
  | 

Want to make sure I get this correct.

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

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



More information about the jboss-dev-forums mailing list