Thanks for clarification Jacopo,
This indeed needs to be fixed then. Does this mean that the DispatchContext
name attribute and its getter must be removed?
Jacques
From: "Jacopo Cappellato" <[email protected]>
On Jul 27, 2012, at 7:14 AM, Jacques Le Roux wrote:
I was just warning *everybody* that it might not be a great idea to remove a
feature that's not broken. For which reasons BTW? Is
it blocking/breaking something?
The current mechanism is actually broken (i.e. implemented in a bad way) but
its effect are not evident because they don't
manifest with the ootb configuration; for example a use case like this would
break the system:
1) define two delegators associated to different model readers:
<delegator name="default" entity-model-reader="main" .../>
<delegator name="second" entity-model-reader="alternative" .../>
2) now if you call:
LocalDispatcher facility = ServiceContainer.getLocalDispatcher("facility",
delegator);
LocalDispatcher alternativeFacility =
ServiceContainer.getLocalDispatcher("facility", alternativeDelegator);
you will actually get the same object; i.e. the second call will get from the
cache the object created by the first call, i.e. a
dispatcher associated to the wrong delegator/model (delegator instead of
alternativeDelegator).
Regards,
Jacopo