pip_services3_container.refer.ManagedReferences module

pip_services3_container.refer.ManagedReferences

Managed references implementation.

copyright

Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.

license

MIT, see LICENSE for more details.

class pip_services3_container.refer.ManagedReferences.ManagedReferences(tuples: Sequence[Any] = None)

Bases: pip_services3_container.refer.ReferencesDecorator.ReferencesDecorator, pip_services3_commons.run.IOpenable.IOpenable

Managed references that in addition to keeping and locating references can also manage their lifecycle:
  • Auto-creation of missing component using available factories

  • Auto-linking newly added components

  • Auto-opening newly added components

  • Auto-closing removed components

close(correlation_id: Optional[str])

Closes component and frees used resources.

Parameters

correlation_id – (optional) transaction id to trace execution through call chain.

static from_tuples(*tuples: Any)pip_services3_container.refer.ManagedReferences.ManagedReferences

Creates a new ManagedReferences object filled with provided key-value pairs called tuples. Tuples parameters contain a sequence of locator1, component1, locator2, component2, … pairs.

Parameters

tuples – the tuples to fill a new ManagedReferences object.

Returns

a new ManagedReferences object.

is_open()bool

Checks if the component is opened.

Returns

true if the component has been opened and false otherwise.

open(correlation_id: Optional[str])

Opens the component.

Parameters

correlation_id – (optional) transaction id to trace execution through call chain.