Package org.apache.sling.api.resource

# Interface DynamicResourceProvider

All Superinterfaces:
  `ResourceProvider`

@Deprecated @ConsumerType public interface DynamicResourceProvider extends ResourceProvider
Deprecated.
Use the `ResourceProvider`
A dynamic resource provider is an extension of a resource provider which is only supported if the resource provider has been created through a `ResourceProviderFactory`. A dynamic resource provider supports access to systems where the connection to the system is dynamic and might go away (due to network changes, updates etc.). The `isLive()` method can be called to check whether the provider is still active. The `close()` method should be called to free any resources held by this resource provider.

Since:
  2.2 (Sling API Bundle 2.2.0)
See Also:
  - `ResourceProviderFactory.getResourceProvider(java.util.Map)`
  - `ResourceProviderFactory.getAdministrativeResourceProvider(java.util.Map)`

## Field Summary

### Fields inherited from interface org.apache.sling.api.resource.ResourceProvider

`OWNS_ROOTS, RESOURCE_TYPE_SYNTHETIC, ROOTS, SERVICE_NAME, USE_RESOURCE_ACCESS_SECURITY`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
Deprecated.
Close the resource provider.
`boolean`
`isLive()`
Deprecated.
Returns `true` if this resource provider has not been closed yet and can still be used.

### Methods inherited from interface org.apache.sling.api.resource.ResourceProvider

`getResource, getResource, listChildren`

## Method Details

### isLive

boolean isLive()
Deprecated.
Returns `true` if this resource provider has not been closed yet and can still be used.

This method will never throw an exception even after the resource provider has been closed

Returns:
  `true` if the resource provider has not been closed yet and is still active.. Once the resource provider has been closed or is not active anymore, this method returns `false`.

### close

void close()
Deprecated.
Close the resource provider. Once the resource provider is not used anymore, it should be closed with this method.