eclipse-sisu / sisu-project

Sisu Inject
https://eclipse.dev/sisu/
Eclipse Public License 2.0
18 stars 16 forks source link

Leverage com.google.inject.spi.ProvisionListener to implement Lifecycle Support #176

Open kwin opened 1 month ago

kwin commented 1 month ago

Currently the lifecycle support in relies on TypeListener for calling the post construct methods (https://github.com/eclipse-sisu/sisu-project/blob/3a8b268b246603fa53b1946aef3a663aa27fc58d/org.eclipse.sisu.inject/src/main/java/org/eclipse/sisu/bean/LifecycleModule.java#L86C39-L86C51). Instead one should use https://google.github.io/guice/api-docs/latest/javadoc/com/google/inject/spi/ProvisionListener.html being introduced with Guice 4 (compare with https://github.com/google/guice/issues/62#issuecomment-115452493).

kwin commented 1 month ago

This requires dropping support of Guice 3 (from 2011) and only support Guice 4 or newer (from 2015). Any concerns @mcculls or @cstamas?

cstamas commented 1 month ago

None from me

slachiewicz commented 1 month ago

What about jump to Guice 6?

kwin commented 1 month ago

This is only about the minimum version being supported. Newer versions are already checked in ITs and work fine.

slachiewicz commented 1 month ago

I know. I mean, bump the minimum supported version just to Guice 6 as it's relatively fresh, supports Jakarta and javax annotations.

kwin commented 1 month ago

For what reason? I wouldn’t bump without a need. There is currently no other new Guice API we need to leverage (which is only provided in 6+).

slachiewicz commented 1 month ago

Ok. One potential advantage would be the possibility to open to Jakarta namespaces.