blob: 755d20c188b19d55a93a136e2d41ba1b0f40f4ee [file] [log] [blame] [view]
# ComponentContext class
*[<Null safety>](https://dart.dev/null-safety)*
<p>Context information that this component received at startup.</p>
<p>The <a href="../package-fuchsia_services_services/ComponentContext-class.md">ComponentContext</a> holds references to the services and connections that
the component was launched with. Authors can use the component context to
access useful information for connecting to other components and interacting
with the framework.</p>
## Constructors
[ComponentContext](../package-fuchsia_services_services/ComponentContext/ComponentContext.md) ({required [Incoming](../package-fuchsia_services_services/Incoming-class.md) svc, required [Outgoing](../package-fuchsia_services_services/Outgoing-class.md) outgoing})
This constructor is used by the modular test harness, but should not be
used elsewhere. <a href="../package-fuchsia_services_services/ComponentContext/ComponentContext.create.md">ComponentContext.create()</a> and
<a href="../package-fuchsia_services_services/ComponentContext/ComponentContext.createAndServe.md">ComponentContext.createAndServe()</a> should typically be used instead.
[ComponentContext.create](../package-fuchsia_services_services/ComponentContext/ComponentContext.create.md) ()
Creates the component context. Users need to make sure that they call
serve after they have finished adding all their public services. _factory_
[ComponentContext.createAndServe](../package-fuchsia_services_services/ComponentContext/ComponentContext.createAndServe.md) ()
Creates a ComponentContext and immediately serves the outgoing. This
method is useful for simple programs who do not have to do any complicated
setup. _factory_
## Properties
##### [hashCode](../package-fuchsia_services_services/ComponentContext/hashCode.md) &#8594; int
The hash code for this object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [outgoing](../package-fuchsia_services_services/ComponentContext/outgoing.md) &#8594; [Outgoing](../package-fuchsia_services_services/Outgoing-class.md)
Services and data exposed to other components.
_<span class="feature">final</span>_
##### [runtimeType](../package-fuchsia_services_services/ComponentContext/runtimeType.md) &#8594; Type
A representation of the runtime type of the object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [svc](../package-fuchsia_services_services/ComponentContext/svc.md) &#8594; [Incoming](../package-fuchsia_services_services/Incoming-class.md)
Services that are available to this component.
_<span class="feature">final</span>_
## Methods
##### [noSuchMethod](../package-fuchsia_services_services/ComponentContext/noSuchMethod.md)(Invocation invocation) dynamic
Invoked when a non-existent method or property is accessed.
_<span class="feature">inherited</span>_
##### [toString](../package-fuchsia_services_services/ComponentContext/toString.md)() String
A string representation of this object.
_<span class="feature">inherited</span>_
## Operators
##### [operator ==](../package-fuchsia_services_services/ComponentContext/operator_equals.md)(Object other) bool
The equality operator.
_<span class="feature">inherited</span>_