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

Static class that keeps track of the dependencies in the step scope and synchronizes the proxies.
显示文件 Open project: SummerBatch/SummerBatch Class Usage Examples

Public Methods

Method 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

Method Description
RegisterDestructionCallback ( string>.Tuple key, object instance ) : void

Method Details

AddProxy() public static method

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
return void

AddStepScopeDependency() public static method

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
return void

GetInstance() public static method

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
return object

GetMappedType() public static method

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

IsStepScope() public static method

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
return bool

RemoveScopeDependency() public static method

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
return void

ResetInstances() public static method

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