C# Класс Summer.Batch.Core.Scope.StepScopeSynchronization

Static class that keeps track of the dependencies in the step scope and synchronizes the proxies.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddProxy ( Type type, string name, IProxyObject proxy ) : void

Adds a new proxy for a dependency in the step scope.

AddStepScopeDependency ( Type registeredType, string name, IUnityContainer container, Type mappedType ) : void

Adds a new dependency in the step scope.

GetInstance ( IProxyObject proxy ) : object

Retrieves the instance of a proxy. If an instance has been cached it is returned, otherwise a new one is resolved using the Unity container.

GetMappedType ( Type registeredType, string name ) : Type

Get mapped type for registered type and given name.

IsStepScope ( Type type, string name ) : bool

Checks if a dependency is in the step scope.

RemoveScopeDependency ( Type type, string name ) : void

Removes a dependency from the step scope.

ResetInstances ( ) : void

Resets the instances cache to force resolving new instances when a step changes.

Приватные методы

Метод Описание
RegisterDestructionCallback ( string>.Tuple key, object instance ) : void

Описание методов

AddProxy() публичный статический Метод

Adds a new proxy for a dependency in the step scope.
public static AddProxy ( Type type, string name, IProxyObject proxy ) : void
type System.Type the type of the dependency
name string the name of the dependency, or null if it has no name
proxy IProxyObject the new proxy
Результат void

AddStepScopeDependency() публичный статический Метод

Adds a new dependency in the step scope.
public static AddStepScopeDependency ( Type registeredType, string name, IUnityContainer container, Type mappedType ) : void
registeredType System.Type the type of the dependency
name string the name of the dependency, or null if it has no name
container IUnityContainer the container to use for resolving the dependency
mappedType System.Type the actual type that will be resolved
Результат void

GetInstance() публичный статический Метод

Retrieves the instance of a proxy. If an instance has been cached it is returned, otherwise a new one is resolved using the Unity container.
public static GetInstance ( IProxyObject proxy ) : object
proxy IProxyObject the proxy to get the instance for
Результат object

GetMappedType() публичный статический Метод

Get mapped type for registered type and given name.
public static GetMappedType ( Type registeredType, string name ) : Type
registeredType System.Type
name string
Результат System.Type

IsStepScope() публичный статический Метод

Checks if a dependency is in the step scope.
public static IsStepScope ( Type type, string name ) : bool
type System.Type the type of the dependency
name string the name of the dependency, or null if it has no name
Результат bool

RemoveScopeDependency() публичный статический Метод

Removes a dependency from the step scope.
public static RemoveScopeDependency ( Type type, string name ) : void
type System.Type the type of the dependency
name string the name of the dependency, or null if it has no name
Результат void

ResetInstances() публичный статический Метод

Resets the instances cache to force resolving new instances when a step changes.
public static ResetInstances ( ) : void
Результат void