"adrian(a)jboss.org" wrote : But isn't that something you already started to
workaround with the
| initial and describe visit?
|
| i.e. The visitor is already in two stages.
|
| It should simply be a case of making sure that the visited metadata uses
| the correct controller.
|
| In fact, the problem is where the visitee does
|
| | KernelControllerContext controllerContext = visitor.getControllerContext();
| | // Remember in local state
| | controller = (KernelController) controllerContext.getController();
| |
| or similar.
|
| Instead, it should just remember the ControllerContext and ask
| for the controller from the context when it needs it.
| i.e. the second line should be done lazily
Ok, Controller should be set (lazily) in the 2nd (describe) phase - where possible (and I
think it is possible in all cases).
But that is not the problem I have in mind.
e.g. When we add DependencyItem in DependsMetaData (or DependencyValueMetaData, ...), this
context waits for this to be resolved till some other bean supplies this dependency - but
it does this via AbstractController.resolveContexts which puts itself as a parameter to
DependencyInfo.resolveDependencies. So we are 'asking' the 'describe
state' Controller to resolve some bean that will actually be installed in child
Controller.
| public boolean resolve(Controller controller)
| {
| boolean previous = resolved;
| ControllerContext context;
|
| if (dependentState == null)
| context = controller.getInstalledContext(iDependOn);
| else
| {
| context = controller.getContext(iDependOn, dependentState);
| if (context == null)
| {
| if (ControllerState.INSTALLED.equals(dependentState))
| context = controller.getInstalledContext(iDependOn);
| }
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4016357#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...