Skip to content
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

Partial fix for issue #7698 - TlsManager support for client-side #7699

Merged

Conversation

trentjeff
Copy link
Member

@trentjeff trentjeff commented Oct 2, 2023

This provides an enhancement whereas on the same JVM, using the same config bean, you will get the same TlsManager instance. This is to prevent a proliferation of manager instances in client-side usages - which will officially be coming in a separator PR later.

Base issue is #7698

@trentjeff trentjeff added OCI 4.x Version 4.x labels Oct 2, 2023
@trentjeff trentjeff requested a review from tomas-langer October 2, 2023 17:49
@trentjeff trentjeff self-assigned this Oct 2, 2023
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Oct 2, 2023
@trentjeff trentjeff added this to the 4.x milestone Oct 2, 2023
private TlsManagerCache() {
}

static TlsManager getOrCreate(Object configBean,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The signature should be:

static <T> TlsManager getOrCreate(T configBean, Function<T, TlsManager> creator)

if this would be the way to go, as that allows you to use a method referenc for the creator

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed

* @param creator the creator to apply if not already in cache, which takes the config bean instance
* @return the tls manager instance from cache, defaulting to creation from the {@code creator} if not in cache
*/
static TlsManager getOrCreate(Config config,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is there a name and config parameter, when theser are not used in the code? Please remove them
Also update the signature to what I wrote above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking we might need them for future use. I'll remove them but at least consider that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed

@trentjeff trentjeff requested a review from tomas-langer October 4, 2023 19:31
@trentjeff trentjeff requested a review from danielkec October 5, 2023 14:48
@trentjeff trentjeff merged commit ab3bd22 into helidon-io:main Oct 9, 2023
12 checks passed
@trentjeff trentjeff deleted the issue-7698-unique-tls-manager-per-config branch October 9, 2023 19:11
dalexandrov pushed a commit to dalexandrov/helidon that referenced this pull request Oct 17, 2023
…-side (helidon-io#7699)

* Partial fix for issue helidon-io#7698 - Support for caching managers when the config is the same.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x OCA Verified All contributors have signed the Oracle Contributor Agreement. OCI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants