Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

IInstantiationAwareObjectPostProcessor.PostProcessBeforeInstantiation Method

Apply this IObjectPostProcessorbefore the target object gets instantiated.

[Visual Basic]
Public Sub PostProcessBeforeInstantiation( _
   ByVal objectType As Type, _
   ByVal objectName As String _
)
[C#]
object PostProcessBeforeInstantiation(
   Type objectType,
   string objectName
);

Parameters

objectType
The Type of the target object that is to be instantiated.
objectName
The name of the target object.

Return Value

The object to expose instead of a default instance of the target object.

Remarks

The returned object may be a proxy to use instead of the target object, effectively suppressing the default instantiation of the target object.

If the object is returned by this method is not a null reference (Nothing in Visual Basic), the object creation process will be short-circuited. The returned object will not be processed any further; in particular, no further IObjectPostProcessor callbacks will be applied to it. This mechanism is mainly intended for exposing a proxy instead of an actual target object.

This callback will only be applied to object definitions with an object class. In particular, it will not be applied to objects with a "factory-method" (i.e. objects that are to be instantiated via a layer of indirection anyway).

Exceptions

Exception Type Condition
ObjectsException In the case of any errors.

See Also

IInstantiationAwareObjectPostProcessor Interface | Spring.Objects.Factory.Config Namespace | HasObjectType | FactoryMethodName