C# Class Spring.Objects.Factory.Support.MethodInjectingInstantiationStrategy

Inheritance: SimpleInstantiationStrategy
显示文件 Open project: spring-projects/spring-net

Protected Methods

Method Description
InstantiateWithMethodInjection ( Spring.Objects.Factory.Support.RootObjectDefinition definition, string objectName, IObjectFactory factory ) : object

Instantiate an instance of the object described by the supplied definition from the supplied factory, injecting methods as appropriate.

InstantiateWithMethodInjection ( Spring.Objects.Factory.Support.RootObjectDefinition definition, string objectName, IObjectFactory factory, ConstructorInfo constructor, object arguments ) : object

Instantiate an instance of the object described by the supplied definition from the supplied factory, injecting methods as appropriate.

Private Methods

Method Description
DoInstantiate ( Spring.Objects.Factory.Support.RootObjectDefinition definition, string objectName, IObjectFactory factory, Type ctorParameterTypes, object arguments ) : object

Instantiate an instance of the object described by the supplied definition from the supplied factory, injecting methods as appropriate.

This method dynamically generates a subclass that supports method injection for the supplied definition. It then instantiates an new instance of said type using the constructor identified by the supplied ctorParameterTypes, passing the supplied arguments to said constructor. It then manually injects (generic) method replacement and method lookup instances (of System.Type Spring.Objects.Factory.Support.IMethodReplacer) into the new instance: those methods that are 'method-injected' will then delegate to the approriate Spring.Objects.Factory.Support.IMethodReplacer instance to effect the actual method injection.

GetGeneratedType ( string objectName, Spring.Objects.Factory.Support.RootObjectDefinition definition ) : Type

Method Details

InstantiateWithMethodInjection() protected method

Instantiate an instance of the object described by the supplied definition from the supplied factory, injecting methods as appropriate.
protected InstantiateWithMethodInjection ( Spring.Objects.Factory.Support.RootObjectDefinition definition, string objectName, IObjectFactory factory ) : object
definition Spring.Objects.Factory.Support.RootObjectDefinition /// The definition of the object that is to be instantiated. ///
objectName string /// The name associated with the object definition. The name can be the /// or zero length string if we're autowiring an /// object that doesn't belong to the supplied /// . ///
factory IObjectFactory /// The owning ///
return object

InstantiateWithMethodInjection() protected method

Instantiate an instance of the object described by the supplied definition from the supplied factory, injecting methods as appropriate.
protected InstantiateWithMethodInjection ( Spring.Objects.Factory.Support.RootObjectDefinition definition, string objectName, IObjectFactory factory, ConstructorInfo constructor, object arguments ) : object
definition Spring.Objects.Factory.Support.RootObjectDefinition /// The definition of the object that is to be instantiated. ///
objectName string /// The name associated with the object definition. The name can be the /// or zero length string if we're autowiring an /// object that doesn't belong to the supplied /// . ///
factory IObjectFactory /// The owning ///
constructor System.Reflection.ConstructorInfo /// The to be used to instantiate /// the object. ///
arguments object /// Any arguments to the supplied . May be null. ///
return object