[java-identity-provider COMMIT] in /trunk/idp-core/src/main/java/net/shibboleth/idp: log/LogbackLoggingService.java s...
noreply at shibboleth.net
noreply at shibboleth.net
Sat Dec 7 12:09:33 EST 2013
Author: rdw
Date: Sat Dec 7 12:09:32 2013
New Revision: 5003
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5003&view=rev
Log:
IdP-330 Make ReloadableService an interface which can be used in profiles.
Modified:
trunk/idp-core/src/main/java/net/shibboleth/idp/log/LogbackLoggingService.java
trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractReloadableService.java
trunk/idp-core/src/main/java/net/shibboleth/idp/service/ReloadableService.java
Modified: trunk/idp-core/src/main/java/net/shibboleth/idp/log/LogbackLoggingService.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-core/src/main/java/net/shibboleth/idp/log/LogbackLoggingService.java?rev=5003&r1=5002&r2=5003&view=diff
==============================================================================
--- trunk/idp-core/src/main/java/net/shibboleth/idp/log/LogbackLoggingService.java (original)
+++ trunk/idp-core/src/main/java/net/shibboleth/idp/log/LogbackLoggingService.java Sat Dec 7 12:09:32 2013
@@ -20,8 +20,11 @@
import java.io.IOException;
import java.io.InputStream;
+import javax.annotation.Nullable;
+
import net.shibboleth.idp.service.AbstractReloadableService;
import net.shibboleth.idp.service.ServiceException;
+import net.shibboleth.idp.service.ServiceableComponent;
import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.component.ComponentValidationException;
@@ -42,7 +45,7 @@
/**
* Simple logging service that watches for logback configuration file changes and reloads the file when a change occurs.
*/
-public class LogbackLoggingService extends AbstractReloadableService {
+public class LogbackLoggingService extends AbstractReloadableService<Object> {
/** Logback logger context. */
private LoggerContext loggerContext;
@@ -194,4 +197,10 @@
super.doInitialize();
}
+
+ /** {@inheritDoc}.
+ * This service does not support a ServiceableComponent, so return null. */
+ @Nullable public ServiceableComponent<Object> getServiceableComponent() {
+ return null;
+ }
}
Modified: trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractReloadableService.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractReloadableService.java?rev=5003&r1=5002&r2=5003&view=diff
==============================================================================
--- trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractReloadableService.java (original)
+++ trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractReloadableService.java Sat Dec 7 12:09:32 2013
@@ -49,10 +49,10 @@
* {@link net.shibboleth.utilities.java.support.component.DestructableComponent}
*
* This class does <em>not</em> deal with any synchronization. That is left to implementing classes.
- *
+ * @param <T> The sort of service this implements.
*/
-public abstract class AbstractReloadableService extends AbstractDestructableIdentifiableInitializableComponent
- implements ValidatableComponent, ReloadableService, UnmodifiableComponent {
+public abstract class AbstractReloadableService<T> extends AbstractDestructableIdentifiableInitializableComponent
+ implements ValidatableComponent, ReloadableService<T>, UnmodifiableComponent {
/** Class logger. */
private Logger log = LoggerFactory.getLogger(AbstractReloadableService.class);
Modified: trunk/idp-core/src/main/java/net/shibboleth/idp/service/ReloadableService.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-core/src/main/java/net/shibboleth/idp/service/ReloadableService.java?rev=5003&r1=5002&r2=5003&view=diff
==============================================================================
--- trunk/idp-core/src/main/java/net/shibboleth/idp/service/ReloadableService.java (original)
+++ trunk/idp-core/src/main/java/net/shibboleth/idp/service/ReloadableService.java Sat Dec 7 12:09:32 2013
@@ -22,8 +22,9 @@
import org.joda.time.DateTime;
import org.springframework.context.Lifecycle;
-/** A service that supports reloading its configuration. */
-public interface ReloadableService extends Lifecycle {
+/** A service that supports reloading its configuration.
+ * @param <T> The sort of service that this implements */
+public interface ReloadableService<T> extends Lifecycle {
/**
* Gets the time when the service was last successfully reloaded.
@@ -54,4 +55,12 @@
* @throws ServiceException thrown if there is a problem reloading the service
*/
public void reload() throws ServiceException;
+
+ /** Get the serviceable component that this service supports . If
+ * The component hasn't been successfully loaded yet or if this service
+ * does not support a ServiceableComponent return null
+ * @return the component, if appropriate.
+ */
+ @Nullable public ServiceableComponent<T> getServiceableComponent();
+
}
More information about the commits
mailing list