"alesj" wrote : "thomas.diesler(a)jboss.com" wrote :
| | The MC Framework incorrectly uninstalls the bundle if there is a failure in
bundle.start()
| |
| No, that is / should be the right behavior, as you don't wanna have broken service
stuck in some middle state.
|
| The is a notion of ErrorHandler in Controller, which might be useful,
| if we decide to go down this path.
|
That is the correct way to handle it. As we discussed when designing the
ErrorHandler, the default behaviour is to assume an error during the lifecycle
is fatal. We don't know whether the object that threw the exception
is still in a consistent state, so we throw it away.
This rule comes from the EJB spec and it is a very safe assumption.
The OSGi spec takes a different (and probably incorrect :-) view.
anonymous wrote :
| Imho, the real problem is how we handle this Bundle::start.
|
| "thomas.diesler(a)jboss.com" wrote :
| | The controller context reached its required stage DESCRIBED after bundle install.
A subsequent call to bundle.start() is supposed to transition to stages CLASSLOADER and
then INSTALLED, which corresponds to the Bundle states RESOLVED and ACTIVE respectively.
| |
| Bundle::start should only be called after we're past CLASSLOADER stage.
| At least in automated mode. If the user wants to do this before, it's his choice
and potential fault.
|
No bundle.start() is no different to
change(deploymentContext, ControllerState.INSTALLED);
If the deployment was only in the DESCRIBE state, it should transistion through
all the intermediate states.
Of course, it might not be able to do it if there are missing classloading dependencies
meaning the bundle cannot be resolved.
So the solution is to add an ErrorHandler to the DeploymentControllerContext
if it is an OSGi deployment, although I'd prefer it if this was an api on the
DeploymentUnit using DeploymentStages rather than working against the
implementation details.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266338#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...