Package net.shibboleth.shared.service

# Interface ReloadableService<T>

Type Parameters:
  `T` - The sort of service that this implements

All Superinterfaces:
  `Component`, `InitializableComponent`

All Known Subinterfaces:
  `LoggingService`

All Known Implementing Classes:
  `AbstractReloadableService`, `LogbackLoggingService`, `MockReloadableService`, `ReloadableSpringService`

public interface ReloadableService<T> extends InitializableComponent
A service that supports reloading its configuration.

## Method Summary

Modifier and Type
Method
Description
`Instant`
`getLastReloadAttemptInstant()`
Gets the time when the service last attempted to reload.
`Instant`
`getLastSuccessfulReloadInstant()`
Gets the time when the service was last successfully reloaded.
`Throwable`
`getReloadFailureCause()`
Gets the reason the last reload failed.
`ServiceableComponent<T>`
`getServiceableComponent()`
Get the serviceable component that this service supports.
`void`
`reload()`
Reloads the configuration of the service.

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

## Method Details

### getLastSuccessfulReloadInstant

@Nullable Instant getLastSuccessfulReloadInstant()
Gets the time when the service was last successfully reloaded. Returns null if the service has never reloaded.

Returns:
  time when the service was last successfully reloaded

### getLastReloadAttemptInstant

@Nullable Instant getLastReloadAttemptInstant()
Gets the time when the service last attempted to reload. If the reload was successful this time should match the time given by `getLastSuccessfulReloadInstant()`.

Returns:
  time when the service last attempted to reload

### getReloadFailureCause

@Nullable Throwable getReloadFailureCause()
Gets the reason the last reload failed.

Returns:
  reason the last reload failed or null if the last reload was successful

### reload

void reload()
Reloads the configuration of the service. Whether internal state is maintained between reloads is implementation dependent.

Throws:
  `ServiceException` - thrown if there is a problem reloading the service

### getServiceableComponent

@Nonnull ServiceableComponent<T> getServiceableComponent() 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, a `ServiceException` is raised.

On a non-null value, the returned component will be pinned and MUST be closed. This can be done by exploiting the fact that a ServiceableComponent implements `AutoCloseable`

Returns:
  the component, if appropriate.
Throws:
  `ServiceException` - if the component is not available