[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] Service Component circular dependencies

It appears that the Declarative Services runtime can potentially instantiate a delayed service component multiple times.

In the scenario I have, a delayed service component A is called on activate() method after it is looked up in the service registry, and as part of processing the activate code, somewhere deep in the call stack, the service for component A is looked up again (using service registry APIs). This is clearly a mandatory circular dependency that DS does not support. I would have expected an exception thrown at this time indicating a potential circular dependency. Instead, it appears that the DS runtime tries to instantiate and activate the component again, which seems like a bug.

On the other hand, IOC frameworks such as Spring/Pico seem to have a way to deal with circular references. would it be possible that DS runtime to support mandatory circular references, and not have such restriction ?

Appreciate your thoughts.