[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Handling contexts in error

adrian@jboss.org do-not-reply at jboss.com
Wed Feb 20 09:35:53 EST 2008


I don't really understand what you are trying to do?
Guessing...

INSTALL - MC wiring

The add/removeContained looks like either the install or installCallback stuff.
However, if a bean goes to the error state then it will have its uninstall or
uninstallCallback invoked. There's no notion of holding onto a broken bean
(except for error reporting - see above).

CONTROLLER - a bit more control for yourself

If you want to control the states manually then consider writing your own
facade over the MC controller, e.g. take a look at what the ServiceController 
(in the jbossas system-jmx project)  does to support the legacy JMX api.

i.e. http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/trunk/system-jmx/src/main/org/jboss/system/ServiceController.java?revision=64966&view=markup

* stopping and starting mbeans from the mbean's own jmx operations
mbeanserver.invoke() -> mbean.stop() -> servicecontroller.stop() -> MC

* emulating the old SAR deployer or programmatic use of the ServiceController
to manually change the mbean states

* maintaining the legacy ServiceContext and listing them by state
[url]http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/trunk/system-jmx/src/main/org/jboss/system/ServiceContext.java?revision=65327&view=markup[url]
e.g. List listIncompletelyDeployed() {...}
etc.

For your usecase, it doesn't sound like it needs to be as complicated
as the JMX stuff, but the "invokeStart() delegates to" sounds like a facade/wrapper
to me?

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

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



More information about the jboss-dev-forums mailing list