-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pico / OCI / CDI Bridge #6499
Comments
A few comments about this PR. The ultimate implementation choice was option 4 from above. There is an observer on injection points, and when it is on the APT classpath it will code-generate activators for all OCI SDK API / services that are injected. Regarding the original requirements for this PR: (must-have) There must be a way to "bridge" and populate OCI services (from the OCI SDK jar) into the Pico services registry - without the need to (nice-to-have) bring in any CDI-dependent modules. This was done as part of the PR mentioned above. (must-have) The injectable set of services must the same set as what is available today using the OciExtension.
(must-have) There must be a way to inject pico-based, compile-time-generated Helidon singleton and/or configured services into a standard MP application. Generally speaking, this "bridge" must minimally be one-directional from Pico to CDI. This was not addressed. The MP-based approach still relies on solely the CDI extension that @ljnelson wrote. (nice-to-have? - this requirement is arguably a hazard, and we might actually want to explicitly make this an anti-requirement for the initial release) - There should be a way to inject Singleton and Application Scope services/beans from CDI (obviously in a standard MP module/application) into pico-based services in a non-MP-based application. In other words, this "bridge" should be two-directional from CDI to Pico as well. This was not addressed. At the present time, I don't think we want anything about CDI "leaking" into SE applications. (nice-to-have) There ideally should be only a single optional add-on module to accomplish all bridging between Pico and CDI, capable of whatever we decide in terms of uni or bi-directional feeds. There may, however, be an additional module(s) added for each integration (e.g., for OCI-specific SDK API integrations, etc.). (must-have; applicable for Pico -> CDI direction) In any integration with CDI, Pico must only be providing discovery of services - lifecycle should be owned & operated by CDI. We do not want to have the situation we have between Hk2 and CDI - having two different world views. Pico needs to be subservient to the "owning" platform DI model that is CDI in this case. These were not addressed. As stated, there is no bridging (yet) between CDI and Pico. |
Requirements
OciExtension
.Approach Option 1:
The
OciExtension
module + a newpico-cdi-bridge
module collectively becomes our conduit to deliver bi-directional service/bean integrations for MP and non-MP applications. Here thepico-cdi-bridge
is built overOciExtension
.OciExtension
module is refactored to be able to feed into Pico (thereby addressing requirements 3 and 4), details again are TBD.OciExtension
module).Pros:
Cons:
OciExtension
module dependency).Approach Option 2: Similar to option 1, but instead the
OciExtension
is refactored to be built on top ofpico-cdi-bridge
instead.pico-cdi-bridge
module is our (one and only?) general-purpose CDI extension module.OciExtension
is refactored in 4.x to feed to/from this new Pico bridge module.pico-maven-plugin
is enhanced to discover and generateActivators
and an OCI PicoModule
for the OCI SDK.Pros:
Cons:
OciExtension
becomes more complicated between 4.x and previous versions since the implementations become radically different between Helidon earlier 2.x/3.x versions.Approach Option 3
OciExtension
is removed in 4.x, and replaced with a pure Pico based solution.Pros & Cons are essentially the same as Approach Option 2 above.
Approach Option 4
PicoOciExtension
that eventually will emerge as a general-purposePicoExtensionSupport
module for any 3rd party integrations beyond OCI SDK integration. To avoid the problem of sidecar artifacts from Helidon, we can alternatively provide an option to have these 3rd party artifacts brought in without the need for compile-time generated class artifacts, and instead listed as a new type of PicoModule
or resource file (TBD). We would still need to perform a build-time jar via an enhancedpico-maven-plugin
(unless we want to somehow tap into classloader agent/monitoring).Pros:
Cons:
OciExtension
needs to be "figured out" (TBD).Summary (Recommendation)
It seems as though the final solution needs to be some combination of Options 1 and 4. We need to start building a general-purpose extensions module, but to the extent possible we need to target Pico services feeding into MP-based applications as seamlessly as possible. And we should strive to do this in such a way as to avoid sidecar artifact generation for 3rd party modules and SDKs. It also seems reasonable to only target a one-directional bridge for the initial phase (Pico->CDI).
Open Questions (and out-of-scope items)
The text was updated successfully, but these errors were encountered: