ResourceRegistry

Thread-safe collection of ResourceProviders. Changes are reported to addChangeListener subscribers so the HTTP transport can emit notifications/resources/list_changed; providers whose listing changes on their own call notifyChanged.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun addChangeListener(listener: () -> Unit)
Link copied to clipboard

Tell subscribers the advertised resources changed. A failing listener can't affect the others.

Link copied to clipboard
fun providerFor(uri: String, visibleTools: Set<String>): ResourceProvider?

The provider among visibleTools-visible ones that handles uri, or null.

Link copied to clipboard
Link copied to clipboard
fun register(provider: ResourceProvider)
Link copied to clipboard
fun removeChangeListener(listener: () -> Unit)
Link copied to clipboard
Link copied to clipboard