[JIRA] (JSSH-5) ServiceableComponent should implement AutoClose

Scott Cantor (Jira) jira at shibboleth.atlassian.net
Thu Nov 17 18:40:54 UTC 2022


Scott Cantor ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A5b78efc9-1379-42cc-a3f6-56c6ea3a0007 ) *reopened* an issue

Rod Widdowson ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=59fb32bbc24efb3c4ed3c977 ) , Reopening for clarification here because the tests are showing some issues around this.

The docs for the ServiceableComponent base class still say you have to have the object pinned to call getComponent, but of course the method was removed, so that's impossible strictly speaking. Maybe that's just documentation?

The issue with the tests is that they notice if you create objects like AttributeFilterImpl, that impements Closeable, which implies you need to try-with-resources. But if you do that, it pops off calling close(), which calls unpin, which you never did, and the unlock throws.

I think part of this relates to the fact that the implementation classes don't have any indirection between themselves and the serviceable layer perhaps. But I'm not sure.

If you think about this in Spring terms, it feels off to me that you can instantiate a singleton that would implement Closeable since nothing's going to call that. It "works" in a sense because nothing at that layer calls pinComponent either, but I'm not sure this is really accurate design-wise.

I'm not sure we can really make the components themselves implement Closeable, or at least I think it creates some oddness. It feels like maybe there would have to be an object representing the "use" of the component that would implement Closeable and then it calls back into the component to unpin it, but the caller would actually have to interact with that in the try () statement of course, which is a change.

Maybe this was a bridge too far?

Shibboleth Shared - Java ( https://shibboleth.atlassian.net/browse/JSSH?atlOrigin=eyJpIjoiMDE0NDkwNDNjNDU3NDY2MGI0OWJiNDdhZGJlZDY2MjMiLCJwIjoiaiJ9 ) / Task ( https://shibboleth.atlassian.net/browse/JSSH-5?atlOrigin=eyJpIjoiMDE0NDkwNDNjNDU3NDY2MGI0OWJiNDdhZGJlZDY2MjMiLCJwIjoiaiJ9 ) JSSH-5 ( https://shibboleth.atlassian.net/browse/JSSH-5?atlOrigin=eyJpIjoiMDE0NDkwNDNjNDU3NDY2MGI0OWJiNDdhZGJlZDY2MjMiLCJwIjoiaiJ9 ) ServiceableComponent should implement AutoClose ( https://shibboleth.atlassian.net/browse/JSSH-5?atlOrigin=eyJpIjoiMDE0NDkwNDNjNDU3NDY2MGI0OWJiNDdhZGJlZDY2MjMiLCJwIjoiaiJ9 )

Change By: Scott Cantor ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A5b78efc9-1379-42cc-a3f6-56c6ea3a0007 ) Resolution: Completed Status: Closed Reopened

( https://shibboleth.atlassian.net/browse/JSSH-5#add-comment?atlOrigin=eyJpIjoiMDE0NDkwNDNjNDU3NDY2MGI0OWJiNDdhZGJlZDY2MjMiLCJwIjoiaiJ9 ) Add Comment ( https://shibboleth.atlassian.net/browse/JSSH-5#add-comment?atlOrigin=eyJpIjoiMDE0NDkwNDNjNDU3NDY2MGI0OWJiNDdhZGJlZDY2MjMiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100210- sha1:9b34d7c )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/commits/attachments/20221117/a0de2d9a/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-comment-icon-f600d26c-d6e8-42fb-a5fc-e17af565c754
Type: image/png
Size: 1084 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20221117/a0de2d9a/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-footer-desktop-logo-e4526306-11c8-48a3-9406-2ec05d90f945
Type: image/png
Size: 10805 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20221117/a0de2d9a/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-avatar-39a210e9-8f11-4c99-8e9a-1914e7c40943
Type: image/png
Size: 468 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20221117/a0de2d9a/attachment-0005.png>


More information about the commits mailing list