MTS introduces two interfaces: IObjectControl and IObjectContext to do this magic. |
IObjectControl interface has three functions: Activate(), Deactivate() and CanBePooled(). |
MTS queries the IObjectControl interface when it instantiates the object. If this interface is supported, then MTS can use Activate() function before the instantiation of the object and Deactivate() function before the deactivation of the object. |