# UTIL_CircuitBreaker.Provider

**Class** · Group: `Resilience`

Learn it: [Fast Start - Resilience](/fast-start-resilience) and [Resilience guide](/resilience-guide)

<div class="apex-member apex-class">

```apex
global interface UTIL_CircuitBreaker.Provider
```

Interface for code that needs circuit breaker protection (with return value) Implement this interface when your action needs to return data. Use ProtectedAction if no return value is needed.

**Example**

```apex
public class GetCustomerDataProvider implements UTIL_CircuitBreaker.Provider
{
    private Id customerId;
    public GetCustomerDataProvider(Id customerId)
    {
        customerId = customerId;
    }
    public Object execute()
    {
        // Make API call and return response
        HttpResponse response = makeApiCall();
        return JSON.deserialize(response.getBody(), DTO_CustomerResponse.class);
    }
}
// Usage
UTIL_CircuitBreaker.Breaker breaker = UTIL_CircuitBreaker.monitor('API_GetCustomerData');
DTO_CustomerResponse customer = (DTO_CustomerResponse)breaker.execute(new GetCustomerDataProvider(customerId));
```

</div>

---

## Methods

| Method | Description |
|--------|-------------|
| global abstract [Object](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_Object.htm) [execute](#execute)() | The code to execute with circuit breaker protection |

### execute

<div class="apex-member">

```apex
global abstract Object execute()
```

The code to execute with circuit breaker protection

**Returns** [Object](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_Object.htm) — The result of the operation (caller must cast to appropriate type)

</div>
