Share via


IMAExtensible2CallExport.CloseExportConnection Method

Called at the end of an export run to disconnect the connected directory and to release resources.

Namespace: Microsoft.MetadirectoryServices
Assembly: Microsoft.MetadirectoryServicesEx (in Microsoft.MetadirectoryServicesEx.dll)

Usage

'Usage
Dim instance As IMAExtensible2CallExport
Dim exportRunStep As CloseExportConnectionRunStep

instance.CloseExportConnection(exportRunStep)

Syntax

'Declaration
Sub CloseExportConnection ( _
    exportRunStep As CloseExportConnectionRunStep _
)
void CloseExportConnection (
    CloseExportConnectionRunStep exportRunStep
)
void CloseExportConnection (
    CloseExportConnectionRunStep^ exportRunStep
)
void CloseExportConnection (
    CloseExportConnectionRunStep exportRunStep
)
function CloseExportConnection (
    exportRunStep : CloseExportConnectionRunStep
)

Parameters

Remarks

Use this method to close connections and release any resources that are obtained in the OpenExportConnection method. This method is called even if the OpenExportConnection method throws an exception.

Implement this method in all types of call-based connected data source extensions. All the exceptions that are described in this topic stop a run. If the method throws an exception that is not described in this topic, the run continues. If the run stops, the WMI Provider returns the string stopped-extension-dll-exception and generates an event log entry.

If the OpenExportConnection method throws an exception, the CloseExportConnection method is called to release the resources and disconnect the directory.

Exceptions: Return values, Errors, and Exceptions

The following is an example of CloseExportConnection:

    public void CloseExportConnection(CloseExportConnectionRunStep exportRunStep)
        {
            //
            // Close export file
            //
            if (null != m_xmlWriterExport)
            {
                m_xmlWriterExport.WriteEndElement();
 
                m_xmlWriterExport.Close();
            }
        }

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Target Platforms

Change History

See Also

Reference

IMAExtensible2CallExport Interface
IMAExtensible2CallExport Members
Microsoft.MetadirectoryServices Namespace