[java-plugin-shibd] branch main updated: Adjust access to services to use proper interface.
Scott Cantor
cantor.2 at osu.edu
Thu Jul 11 13:41:50 UTC 2024
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-plugin-shibd.
View the commit online:
http://git.shibboleth.net/view/?p=java-plugin-shibd.git;a=commit;h=3d10f8ffc0318d4e43a81bb604f42d44556b1a00
The following commit(s) were added to refs/heads/main by this push:
new 3d10f8f Adjust access to services to use proper interface.
3d10f8f is described below
commit 3d10f8ffc0318d4e43a81bb604f42d44556b1a00
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Jul 11 09:41:47 2024 -0400
Adjust access to services to use proper interface.
---
.../main/java/net/shibboleth/sp/Application.java | 33 ++++------------------
.../net/shibboleth/sp/impl/BasicApplication.java | 27 ++++++++++--------
2 files changed, 22 insertions(+), 38 deletions(-)
diff --git a/sp-server-api/src/main/java/net/shibboleth/sp/Application.java b/sp-server-api/src/main/java/net/shibboleth/sp/Application.java
index c646207..1e34236 100644
--- a/sp-server-api/src/main/java/net/shibboleth/sp/Application.java
+++ b/sp-server-api/src/main/java/net/shibboleth/sp/Application.java
@@ -31,8 +31,7 @@ import net.shibboleth.idp.attribute.transcoding.AttributeTranscoderRegistry;
import net.shibboleth.profile.config.ProfileConfiguration;
import net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
-import net.shibboleth.shared.service.ServiceException;
-import net.shibboleth.shared.service.ServiceableComponent;
+import net.shibboleth.shared.service.ReloadableService;
/**
* A collection of resources protected by the SP and treated as a unit for the purposes of
@@ -82,49 +81,29 @@ public interface Application extends RelyingPartyConfigurationResolver {
/**
* Get {@link MetadataResolver} for this {@link Application}.
*
- * <p>The component is returned in a locked state and must be closed by the caller.</p>
- *
* @return the metadata source to use
- *
- * @throws ServiceException if no instance can be obtained
*/
- @Nonnull ServiceableComponent<MetadataResolver> getMetadataResolver()
- throws ServiceException;
+ @Nonnull ReloadableService<MetadataResolver> getMetadataResolver();
/**
* Get {@link AttributeTranscoderRegistry} for this {@link Application}.
*
- * <p>The component is returned in a locked state and must be closed by the caller.</p>
- *
- * @return the attribute filter to use
- *
- * @throws ServiceException if no instance can be obtained
+ * @return the attribute transcoder registry to use
*/
- @Nonnull ServiceableComponent<AttributeTranscoderRegistry> getAttributeTranscoderRegistry()
- throws ServiceException;
+ @Nonnull ReloadableService<AttributeTranscoderRegistry> getAttributeTranscoderRegistry();
/**
* Get {@link AttributeResolver} for this {@link Application}.
*
- * <p>The component is returned in a locked state and must be closed by the caller.</p>
- *
* @return the attribute resolver to use
- *
- * @throws ServiceException if no instance can be obtained
*/
- @Nonnull ServiceableComponent<AttributeResolver> getAttributeResolver()
- throws ServiceException;
+ @Nonnull ReloadableService<AttributeResolver> getAttributeResolver();
/**
* Get {@link AttributeFilter} for this {@link Application}.
*
- * <p>The component is returned in a locked state and must be closed by the caller.</p>
- *
* @return the attribute filter to use
- *
- * @throws ServiceException if no instance can be obtained
*/
- @Nonnull ServiceableComponent<AttributeFilter> getAttributeFilter()
- throws ServiceException;
+ @Nonnull ReloadableService<AttributeFilter> getAttributeFilter();
}
\ No newline at end of file
diff --git a/sp-server-impl/src/main/java/net/shibboleth/sp/impl/BasicApplication.java b/sp-server-impl/src/main/java/net/shibboleth/sp/impl/BasicApplication.java
index e1df613..1e59d6d 100644
--- a/sp-server-impl/src/main/java/net/shibboleth/sp/impl/BasicApplication.java
+++ b/sp-server-impl/src/main/java/net/shibboleth/sp/impl/BasicApplication.java
@@ -40,8 +40,6 @@ import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.logic.FunctionSupport;
import net.shibboleth.shared.service.ReloadableService;
-import net.shibboleth.shared.service.ServiceException;
-import net.shibboleth.shared.service.ServiceableComponent;
import net.shibboleth.sp.Application;
/**
@@ -202,8 +200,10 @@ public class BasicApplication extends DefaultRelyingPartyConfigurationResolver i
}
/** {@inheritDoc} */
- @Nonnull public ServiceableComponent<MetadataResolver> getMetadataResolver() throws ServiceException {
- return metadataResolver.getServiceableComponent();
+ @Nonnull public ReloadableService<MetadataResolver> getMetadataResolver() {
+ checkComponentActive();
+ assert metadataResolver != null;
+ return metadataResolver;
}
/**
@@ -218,9 +218,10 @@ public class BasicApplication extends DefaultRelyingPartyConfigurationResolver i
}
/** {@inheritDoc} */
- @Nonnull public ServiceableComponent<AttributeTranscoderRegistry> getAttributeTranscoderRegistry()
- throws ServiceException {
- return transcodingRegistry.getServiceableComponent();
+ @Nonnull public ReloadableService<AttributeTranscoderRegistry> getAttributeTranscoderRegistry() {
+ checkComponentActive();
+ assert transcodingRegistry != null;
+ return transcodingRegistry;
}
/**
@@ -235,8 +236,10 @@ public class BasicApplication extends DefaultRelyingPartyConfigurationResolver i
}
/** {@inheritDoc} */
- @Nonnull public ServiceableComponent<AttributeResolver> getAttributeResolver() throws ServiceException {
- return attributeResolver.getServiceableComponent();
+ @Nonnull public ReloadableService<AttributeResolver> getAttributeResolver() {
+ checkComponentActive();
+ assert attributeResolver != null;
+ return attributeResolver;
}
/**
@@ -251,8 +254,10 @@ public class BasicApplication extends DefaultRelyingPartyConfigurationResolver i
}
/** {@inheritDoc} */
- @Nonnull public ServiceableComponent<AttributeFilter> getAttributeFilter() throws ServiceException {
- return attributeFilter.getServiceableComponent();
+ @Nonnull public ReloadableService<AttributeFilter> getAttributeFilter() {
+ checkComponentActive();
+ assert attributeFilter != null;
+ return attributeFilter;
}
/**
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list