Skip to main content

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


Sounds like it could be a bug.  Declarative Services supports Circular Dependencies so long as at least one dependency in the cycle is optional.  If there is no optional dependency an exception should be thrown by the SCR resolver.

I can't think of a way that DS could support a cycle of Circular Dependencies without any optional dependencies - any ideas you have would be great.

Please open a bug and attach your service components that demonstrate the problem.

Thanks,
Roy

-----------------------------------------
Roy Paterson
IBM Pervasive Computing
Austin, TX
Phone: (512) 838-8898



Subbarao Meduri/Durham/IBM@IBMUS
Sent by: equinox-dev-bounces@xxxxxxxxxxx

06/28/2006 11:46 AM

Please respond to
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>

To
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
cc
Subject
[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.

Regards,
Subbarao
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


Back to the top