[jboss-user] [Microcontainer] - Re: How to install a bean without affecting unrelated bean's
jaikiran
do-not-reply at jboss.com
Fri Mar 20 10:51:07 EDT 2009
"alesj" wrote :
| You don't know if it's really (un)related until you tried it.
| How else would you know that beanX is not related to beanY
|
Isn't this possible by just checking the dependencies of beanX?
"alesj" wrote :
| The recursion shouldn't be too big, since if bean has no real dependencies, it's moved to installed on first attempt, hence not hugely involved anymore in context state changing/checking.
|
I need to explain this a bit more :) The (MC) bean (=proxyfactory) has no real dependencies. Infact the question is not really about dependencies. Its more of a single install triggering a recursive installation of all other (unrelated) contexts that are available in the controller. The controller recursively installs these based on *states* and not because those are any dependencies of the bean being installed:
// This one resolves all the contexts by State. So if there are N number of contexts in
| // the ready to start state, their state will be incremented even if they are not
| // real dependencies of the original context that was passed for "install"
| protected boolean resolveContexts(ControllerState fromState, ControllerState toState, boolean trace)
| {
| boolean resolutions = false;
| Set<ControllerContext> unresolved = contextsByState.get(fromState);
| Set<ControllerContext> resolved = resolveContexts(unresolved, toState, trace);
| if (resolved.isEmpty() == false)
| {
| for (ControllerContext context : resolved)
| {
| Object name = context.getName();
| if (fromState.equals(context.getState()) == false)
| {
| if (trace)
| log.trace("Skipping already installed " + name + " for " + toState.getStateString());
| }
| else if (installing.add(context) == false)
| {
| if (trace)
| log.trace("Already installing " + name + " for " + toState.getStateString());
| }
| else
| {
| try
| {
| if (trace)
| log.trace("Dependencies resolved " + name + " for " + toState.getStateString());
|
| if (incrementState(context, trace))
|
"alesj" wrote :
| And 300+ should be the number we can handle ...
Right now not :) The application that i attached is bare minimal in terms of dependencies within the beans.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4219890#4219890
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4219890
More information about the jboss-user
mailing list