Skip to content

Commit 4417481

Browse files
authored
InitializesServerApplication required for calls to interface methods (#3550)
Clarify that setting InitializesServerApplication to true is actually necessary/prerequisite to receiving calls to the interface methods
1 parent b024912 commit 4417481

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xml/System.EnterpriseServices/IProcessInitializer.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
## Remarks
2929
Implement the <xref:System.EnterpriseServices.IProcessInitializer> interface methods on serviced components if you want to run initialization or shutdown code when a server process (Dllhost.exe) starts up or shuts down, respectively.
3030
31-
COM+ provides `Startup` and `Shutdown` events when Dllhost.exe starts and ends. This feature enables any COM+ components that are installed in a COM+ server application (referred to as server components hereafter) to run custom initialization and clean up code. An instance of each component that implements the <xref:System.EnterpriseServices.IProcessInitializer> interface will be created and stored for the duration of the process, and called on the interface methods during startup and shutdown. When implemented on a <xref:System.EnterpriseServices.ServicedComponent>, during registration of the component, the `InitializesServerApplication` parameter in the `COMAdminCatalogObject` within the Components collection is set to `true`.
31+
COM+ provides `Startup` and `Shutdown` events when Dllhost.exe starts and ends. This feature enables any COM+ components that are installed in a COM+ server application (referred to as server components hereafter) to run custom initialization and clean up code. An instance of each component that implements the <xref:System.EnterpriseServices.IProcessInitializer> interface will be created and stored for the duration of the process. When implemented on a <xref:System.EnterpriseServices.ServicedComponent>, the `InitializesServerApplication` parameter in the `COMAdminCatalogObject` within the Components collection needs to be set to `true` during registration of the component, in order for the interface methods to be called during startup and shutdown.
3232
3333
Using the `Startup` and `Shutdown` events, you can initialize resources, create connections, initialize shared data, and run cleanup code. However, you must not access states that are specific to COM+ because instances of server components have not yet been created. In addition, the code in the `Startup` and `Shutdown` events should return as quickly as possible, because the system waits only 90 seconds for Dllhost.exe to prepare to accept activations after the system starts the process. If Dllhost.exe does not signal that it is ready within 90 seconds, the system ends the process; thus, all initialization processing needs to be completed within this time frame. Each server component that participates in initialization must support the <xref:System.EnterpriseServices.IProcessInitializer> interface. On DllHost.exe startup, COM+ creates all server components that requested this service, calls `QueryInterface` for the <xref:System.EnterpriseServices.IProcessInitializer> interface, and calls the <xref:System.EnterpriseServices.IProcessInitializer.Startup%2A> function. Similarly, when the DllHost.exe process is shut down, it calls the <xref:System.EnterpriseServices.IProcessInitializer.Shutdown%2A> function on those previously stored interface pointers.
3434

0 commit comments

Comments
 (0)