Package org.apache.sling.resourceresolver.impl.helper

# Class ResourceDecoratorTracker

java.lang.Object
org.apache.sling.resourceresolver.impl.helper.ResourceDecoratorTracker

public class ResourceDecoratorTracker extends Object
Helper class to track the resource decorators and keep them sorted by their service ranking.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final List<org.apache.sling.resourceresolver.impl.helper.ResourceDecoratorTracker.ResourceDecoratorEntry>`
`resourceDecorators`
The (optional) resource decorators, working copy.

## Constructor Summary

Constructors
Constructor
Description
`ResourceDecoratorTracker()`

## Method Summary

Modifier and Type
Method
Description
`void`
`bindResourceDecorator(org.apache.sling.api.resource.ResourceDecorator decorator, org.osgi.framework.ServiceReference<org.apache.sling.api.resource.ResourceDecorator> ref)`
Bind a resource decorator.
`void`
`close()`
`org.apache.sling.api.resource.Resource`
`decorate(org.apache.sling.api.resource.Resource resource)`
Decorate a resource.
`void`
`unbindResourceDecorator(org.apache.sling.api.resource.ResourceDecorator decorator)`
Unbind a resouce decorator.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### resourceDecorators

protected final List<org.apache.sling.resourceresolver.impl.helper.ResourceDecoratorTracker.ResourceDecoratorEntry> resourceDecorators
The (optional) resource decorators, working copy.

## Constructor Details

### ResourceDecoratorTracker

public ResourceDecoratorTracker()

## Method Details

### close

public void close()

### decorate

public org.apache.sling.api.resource.Resource decorate(org.apache.sling.api.resource.Resource resource)
Decorate a resource.

Parameters:
  `resource` - The resource
Returns:
  The decorated resource or the original

### bindResourceDecorator

public void bindResourceDecorator(org.apache.sling.api.resource.ResourceDecorator decorator, org.osgi.framework.ServiceReference<org.apache.sling.api.resource.ResourceDecorator> ref)
Bind a resource decorator.

Parameters:
  `decorator` - The decorator
  `ref` - The service reference

### unbindResourceDecorator

public void unbindResourceDecorator(org.apache.sling.api.resource.ResourceDecorator decorator)
Unbind a resouce decorator.

Parameters:
  `decorator` - The decorator