# A2uiCoreComponentRegistry

Artifact: [androidx.a2ui:a2ui-engine](https://developer.android.com/jetpack/androidx/releases/a2ui) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/engine/platform/A2uiCoreComponentRegistry.kt+class:androidx.a2ui.engine.platform.A2uiCoreComponentRegistry) Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

*** ** * ** ***


```
public interface A2uiCoreComponentRegistry extends AutoCloseable
```

<br />

*** ** * ** ***

A registry for storing UI components. Host frameworks back this with native reactive states (e.g., SnapshotStateMap in Compose).

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/a2ui/engine/platform/A2uiCoreComponentRegistry#close()()` Instantly clears all components from the registry for deterministic teardown. |
| `abstract void` | `https://developer.android.com/reference/androidx/a2ui/engine/platform/A2uiCoreComponentRegistry#reportError(kotlin.String,androidx.a2ui.model.protocol.A2uiException)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html id, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiException exception)` Reports an error associated with a specific UI component. |
| `abstract void` | `https://developer.android.com/reference/androidx/a2ui/engine/platform/A2uiCoreComponentRegistry#update(kotlin.collections.List)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiComponentPayload> components)` Inserts or replaces UI components in the registry. |

## Public methods

### close

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
abstract void close()
```

Instantly clears all components from the registry for deterministic teardown.

### reportError

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
abstract void reportError(@NonNull String id, @NonNull A2uiException exception)
```

Reports an error associated with a specific UI component.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html id` | The unique identifier of the component that encountered the error. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiException exception` | The exception describing the component error. |

### update

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
abstract void update(@NonNull List<@NonNull A2uiComponentPayload> components)
```

Inserts or replaces UI components in the registry.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiComponentPayload> components` | The list of UI components to insert or update. |