[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Handling contexts in error
julien@jboss.com
do-not-reply at jboss.com
Wed Feb 20 09:06:29 EST 2008
ok I see.
the other use case it does not answer is that, I need to have some Container bean that list all the related failed POJO to show that it is possible to restart them so:
| public class Container
| {
| private Set<Contained> containeds = new HashSet<Contained>();
| public void addContained(Contained contained} { // trivial }
| public void removeContained(Contained contained} { // trivial }
| public Set<Contained> listContainedThatFailed() { // trivial }
| }
|
| public class Contained
| {
| private Container container;
| public void setContainer(Container container) {
| // Will be removed when it is possible to do install/uninstall on a specified state, ideally would be instantiated (instead of installed), Ales told me he is working on that feature
| if (container != null)
| {
| container.addContained(this);
| }
| else
| {
| this.container.removeContained(this);
| }
| this.container = container;
| }
|
so admin could browse the "failed" beans and attempt to restart some of them using the admin tool, or in a programmatic way
| for (Contained contained : container.listContainedThatFailed())
| {
| contained.invokeStart();
| }
|
I think that the whole point is that I need to consider a bean in the 3 following states:
stop/installed/failed
and trigger trnasitions :-)
where invokeStart() delegates to
| // Here controllerContext is the one of the failed bean
| controller.change(controllerContext, ControllerState.INSTALLED);
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4130756#4130756
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4130756
More information about the jboss-dev-forums
mailing list