javaee / hk2

A light-weight and dynamic dependency injection framework
https://javaee.github.io/hk2
Other
112 stars 83 forks source link

ServiceLocator shutdown does not destroy child ServiceLocators #381

Closed buko closed 6 years ago

buko commented 6 years ago

It seems like shutting down a parent ServiceLocator does not shutdown the child ServiceLocators.

This seems like a bug. In the current code not only are child ServiceLocators not shutdown but it does not even break the parent-child relationship (the child still has a reference to the now shutdown parent, all the parent does is call children.clear()).

Is this intentional behavior? Documented?

Which leads to the next question: how to retrieve all the child ServiceLocators of a given ServiceLocator method? The ServiceLocator interface has a getParent() method but there seems to be no corresponding method to receive a copy of its children list.

glassfishrobot commented 6 years ago

Closing this as this issue is migrated to https://github.com/eclipse-ee4j/glassfish-hk2/issues/382