blob: 2b5e06b01fad353c90fd476087457156a9cabb75 [file] [log] [blame]
// Copyright 2017 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.modular;
/// This interface is given to all components in their `ComponentContext`. Any
/// component can resolve an entity reference into an `Entity`.
[Discoverable]
protocol EntityResolver {
/// Finds and binds `entity_request` to an Entity handle for the Entity
/// referenced by `entity_reference`. If an error occurs, `entity_request`
/// will be closed.
///
/// This method is called by any component who wants to use an Entity using an
/// entity reference. A component has to get an entity reference (directly or
/// indirectly) from an agent, for example through some fidl interface. The
/// agent will create an entity reference using EntityReferenceFactory. During
/// entity resolution, that agent then provides data for the Entity
/// through an EntityProvider service it exposes. Thus, any Agent that wishes
/// to use EntityReferenceFactory to dispense entity references through its
/// agent services MUST also implement the EntityProvider service.
ResolveEntity(string entity_reference, request<Entity> entity_request);
};