Show / Hide Table of Contents

Class ExternallyControlledLifetimeManager

A LifetimeManager that holds a weak reference to it's managed instance.

Inheritance
Object
LifetimeManager
SynchronizedLifetimeManager
ExternallyControlledLifetimeManager
Implements
IDisposable
IInstanceLifetimeManager
ITypeLifetimeManager
IFactoryLifetimeManager
Inherited Members
SynchronizedLifetimeManager.ResolveTimeout
SynchronizedLifetimeManager.TryGetValue(ILifetimeContainer)
SynchronizedLifetimeManager.GetValue(ILifetimeContainer)
SynchronizedLifetimeManager.SetValue(Object, ILifetimeContainer)
SynchronizedLifetimeManager.Recover()
SynchronizedLifetimeManager.TryExit()
SynchronizedLifetimeManager.Dispose()
SynchronizedLifetimeManager.Dispose(Boolean)
LifetimeManager.NoValue
LifetimeManager.InUse
LifetimeManager.TryGet
LifetimeManager.Get
LifetimeManager.Set
LifetimeManager.CreateLifetimePolicy()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Namespace: Unity.Lifetime
Assembly: Unity.Abstractions.dll
Syntax
public class ExternallyControlledLifetimeManager : SynchronizedLifetimeManager, IDisposable, IInstanceLifetimeManager, ITypeLifetimeManager, IFactoryLifetimeManager

Methods

| Improve this Doc View Source

OnCreateLifetimeManager()

Declaration
protected override LifetimeManager OnCreateLifetimeManager()
Returns
Type Description
LifetimeManager
Overrides
LifetimeManager.OnCreateLifetimeManager()
| Improve this Doc View Source

RemoveValue(ILifetimeContainer)

Remove the given object from backing store.

Declaration
public override void RemoveValue(ILifetimeContainer container = null)
Parameters
Type Name Description
ILifetimeContainer container

The container this lifetime belongs to

Overrides
LifetimeManager.RemoveValue(ILifetimeContainer)
| Improve this Doc View Source

SynchronizedGetValue(ILifetimeContainer)

Performs the actual retrieval of a value from the backing store associated with this Lifetime policy.

Declaration
protected override object SynchronizedGetValue(ILifetimeContainer container = null)
Parameters
Type Name Description
ILifetimeContainer container

Instance of the lifetime's container

Returns
Type Description
Object

the object desired, or null if no such object is currently stored.

Overrides
SynchronizedLifetimeManager.SynchronizedGetValue(ILifetimeContainer)
Remarks

This method is invoked by GetValue(ILifetimeContainer) after it has acquired its lock.

| Improve this Doc View Source

SynchronizedSetValue(Object, ILifetimeContainer)

Performs the actual storage of the given value into backing store for retrieval later.

Declaration
protected override void SynchronizedSetValue(object newValue, ILifetimeContainer container = null)
Parameters
Type Name Description
Object newValue

The object being stored.

ILifetimeContainer container

Instance of the lifetime's container

Overrides
SynchronizedLifetimeManager.SynchronizedSetValue(Object, ILifetimeContainer)
Remarks

This method is invoked by SetValue(Object, ILifetimeContainer) before releasing its lock.

| Improve this Doc View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
String
Overrides
Object.ToString()

Implements

System.IDisposable
IInstanceLifetimeManager
ITypeLifetimeManager
IFactoryLifetimeManager

Extension Methods

InjectionMatching.Matches(Object, Type)
InjectionMatching.MatchesObject(Object, Type)
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2020 .NET Foundation and Contributors. All Rights Reserved