C# Class Summer.Batch.Core.Scope.StepScopeSynchronization

Static class that keeps track of the dependencies in the step scope and synchronizes the proxies.
Afficher le fichier Open project: SummerBatch/SummerBatch Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
RegisterDestructionCallback ( string>.Tuple key, object instance ) : void

Method Details

AddProxy() public static méthode

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
Résultat void

AddStepScopeDependency() public static méthode

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
Résultat void

GetInstance() public static méthode

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
Résultat object

GetMappedType() public static méthode

Get mapped type for registered type and given name.
public static GetMappedType ( Type registeredType, string name ) : Type
registeredType System.Type
name string
Résultat System.Type

IsStepScope() public static méthode

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
Résultat bool

RemoveScopeDependency() public static méthode

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
Résultat void

ResetInstances() public static méthode

Resets the instances cache to force resolving new instances when a step changes.
public static ResetInstances ( ) : void
Résultat void