Developing Hosted Event Providers

Notification Services has three standard hosted event providers. These event providers allow you to collect event data from XML files dropped to a folder, from Transact-SQL queries, and from MDX queries. If these event providers do not provide the necessary functionality for your application, and if you want the Notification Services engine to start, run, and stop the event provider, you can develop a custom hosted event provider.

Hosted Event Provider Interfaces

Notification Services provides two interfaces for implementing hosted event providers:

  • If you want an event provider that starts when the instance starts and runs until the instance stops, implement a continuous event provider using the IEventProvider interface. Continuous event providers manage their own state and do not get called again by Notification Services until they need to be stopped.
    Continuous event providers can use listeners so they are notified when new data is available. For example, your continuous event provider can use a file-watcher listener to monitor a directory for new or updated comma-delimited text files and then pick up and process the files.
  • If you want an event provider that runs on a schedule, implement the IScheduledEventProvider interface. The Run method of a scheduled event provider is invoked by Notification Services on a schedule configured in the application definition.
    For example, your event provider can run every five minutes and call a Web service to get the latest stock price information. You implement a scheduled event provider and then, when defining the event provider, you configure it to run every five minutes.

The IEventProvider and IScheduledEventProvider interfaces expose identical public methods. They are, however, invoked differently by Notification Services at runtime.

Using Hosted Event Providers

To use a hosted event provider, you must declare it in the application definition. For more information, see Defining Hosted Event Providers.

See Also

Concepts

Developing Non-Hosted Event Providers
Using the Managed Event Submission API
Using the XML Event Loader API
Using Event Submission Stored Procedures

Other Resources

Developing a Custom Event Provider
Defining Event Providers

Help and Information

Getting SQL Server 2005 Assistance