# 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)

*** ** * ** ***


```
interface A2uiCoreComponentRegistry : AutoCloseable
```

<br />

*** ** * ** ***

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

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/engine/platform/A2uiCoreComponentRegistry#close()()` Instantly clears all components from the registry for deterministic teardown. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/engine/platform/A2uiCoreComponentRegistry#reportError(kotlin.String,androidx.a2ui.model.protocol.A2uiException)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiException)` Reports an error associated with a specific UI component. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/engine/platform/A2uiCoreComponentRegistry#update(kotlin.collections.List)(components: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiComponentPayload>)` Inserts or replaces UI components in the registry. |

## Public functions

### close

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

```
fun close(): Unit
```

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)

```
fun reportError(id: String, exception: A2uiException): Unit
```

Reports an error associated with a specific UI component.

| Parameters |
|---|---|
| `id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The unique identifier of the component that encountered the error. |
| `exception: https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiException` | 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)

```
fun update(components: List<A2uiComponentPayload>): Unit
```

Inserts or replaces UI components in the registry.

| Parameters |
|---|---|
| `components: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiComponentPayload>` | The list of UI components to insert or update. |