blob: e721bfc383e0c69a19c70e33ceabaea9e5be35cc [file] [log] [blame] [edit]
// Copyright 2019 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.sys.internal;
using fuchsia.io;
/// Service exposed by appmgr that enables a component (such as archivist) to listen for
/// lifecycle events of components in the realm tree.
@discoverable
protocol ComponentEventProvider {
/// Requests a hook to get lifecycle events for the realm from where this service
/// was connected to.
SetListener(resource struct {
listener client_end:ComponentEventListener;
});
};
/// Listener for events about the lifecycle of components.
///
/// If some sub-realm has a listener attached, events for components under that realm's subtree
/// won't be synthesized.
protocol ComponentEventListener {
/// Notifies the client that a component has stopped.
OnStop(struct {
component SourceIdentity;
});
/// Notifies the client that the out/diagnostics directory of a component is ready
/// and provides a handle to it.
OnDiagnosticsDirReady(resource struct {
component SourceIdentity;
directory client_end:fuchsia.io.Directory;
});
};