Class ResourceProviderHandler
- java.lang.Object
-
- org.apache.sling.resourceresolver.impl.providers.ResourceProviderHandler
-
- All Implemented Interfaces:
Comparable<ResourceProviderHandler>
,Pathable
public class ResourceProviderHandler extends Object implements Comparable<ResourceProviderHandler>, Pathable
Holder for a resource provider service.
-
-
Constructor Summary
Constructors Constructor Description ResourceProviderHandler(org.osgi.framework.BundleContext bc, ResourceProviderInfo info)
Create a new handler
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
activate()
Activate this handler.int
compareTo(ResourceProviderHandler o)
void
deactivate()
Deactivate this handler.void
dispose()
Clear all references.ResourceProviderInfo
getInfo()
Get the resource provider infoString
getPath()
Get the path where the provider is mounted.ProviderContextImpl
getProviderContext()
Get the provider context.org.apache.sling.spi.resource.provider.ResourceProvider<Object>
getResourceProvider()
Get the resource provider.boolean
isUsed()
Check whether this provider has been used.String
toString()
void
update()
Update the providerorg.apache.sling.spi.resource.provider.ResourceProvider<Object>
useResourceProvider()
Get the resource provider and mark it as used.
-
-
-
Constructor Detail
-
ResourceProviderHandler
public ResourceProviderHandler(org.osgi.framework.BundleContext bc, ResourceProviderInfo info)
Create a new handler- Parameters:
bc
- Bundle context to get the service.info
- Resource provider info.
-
-
Method Detail
-
getInfo
public ResourceProviderInfo getInfo()
Get the resource provider info- Returns:
- The resource provider info or
null
if this handler has been deactivated.
-
activate
public boolean activate()
Activate this handler. Get the resource provider service from the service registry.- Returns:
true
if the provider could be activated,false
otherwise.
-
deactivate
public void deactivate()
Deactivate this handler. Unget the provider service.
-
dispose
public void dispose()
Clear all references.
-
getResourceProvider
public org.apache.sling.spi.resource.provider.ResourceProvider<Object> getResourceProvider()
Get the resource provider.- Returns:
- The resource provider or
null
if it is not active.
-
useResourceProvider
public org.apache.sling.spi.resource.provider.ResourceProvider<Object> useResourceProvider()
Get the resource provider and mark it as used.- Returns:
- The resource provider or
null
if it is not active.
-
isUsed
public boolean isUsed()
Check whether this provider has been used.- Returns:
-
compareTo
public int compareTo(ResourceProviderHandler o)
- Specified by:
compareTo
in interfaceComparable<ResourceProviderHandler>
-
getPath
public String getPath()
Get the path where the provider is mounted.
-
update
public void update()
Update the provider
-
getProviderContext
public ProviderContextImpl getProviderContext()
Get the provider context.- Returns:
- The provider context
-
-