IEventProvider.Run Method
Activates the event provider to begin collecting events.
네임스페이스: Microsoft.SqlServer.NotificationServices
어셈블리: Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)
구문
‘선언
Function Run As Boolean
bool Run ()
bool Run ()
boolean Run ()
function Run () : boolean
반환 값
A Boolean value; true if the event provider is running successfully and false if the event provider is not running successfully and the provider host must call the Terminate method.
주의
The provider host calls this method to tell the continuous event provider to start collecting events.
The provider hosts starts continuous event providers when the instance of Notification Services starts, and they run continuously while the application is active. When the instance starts, the provider host calls the Initialize and Run methods on the continuous event provider just once. Once started, a continuous event provider runs and submits events until its Terminate method is called.
The event provider must return from the Run method within timeout period configured in the ADF (which has a default of five minutes), using the initial thread allocated to it by the provider host. You must program the event provider to either use a callback function, or to gather and submit events on one or more separate threads. If you choose to have multiple threads running in parallel and if event order is important to your application, make sure to synchronize the threads so that they submit events to the database in the same order in which they were created.
A continuous event provider can return false from the Run method to let the provider host know something is wrong and that it is not going to continue to run. If the continuous event provider has already returned from Run and is now submitting events on a separate thread, then it must use the StopHandler delegate to notify the provider host that something has gone wrong. This delegate is passed to the event provider as an argument to the Initialize method, so that the event provider can invoke it if it needs to be terminated.
Hosted event providers must catch and handle their own exceptions. If the exceptions are not handled, the provider host logs the unhandled error and then invokes the Terminate method on the event provider.
예
For an example of how to implement the Run method, see the IEventProvider topic.
스레드 보안
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
플랫폼
개발 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
대상 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
참고 항목
참조
IEventProvider Interface
IEventProvider Members
Microsoft.SqlServer.NotificationServices Namespace