Defining Hosted Event Providers

Hosted event providers are hosted by the Notification Services engine. When the engine starts, it initializes and runs all enabled hosted event providers.

The information you provide in the application definition gives the engine the information required to locate, initialize, and run hosted event providers.

Types of Hosted Event Providers

A hosted event provider can be either continuous or scheduled:

  • A continuous event provider is started when the engine starts, and it is stopped when the engine stops. It manages how and when it submits events.
    If you develop a custom continuous event provider, you must implement the IEventProvider interface.
  • A scheduled event provider is started when the engine starts and is triggered to check for new events at predefined intervals.
    You provide the schedule in the application definition.
    If you develop a custom scheduled event provider, you must implement the IScheduledEventProvider interface.

Defining a Hosted Event Provider

Each application can have hosted event providers. When you define an application, you define each event provider used by the application, including properties such as the event provider name, the class that implements the event provider, the assembly that contains the class, and any arguments required to initialize the event provider.

To define a hosted event provider

If you are defining an application through XML, define hosted event providers in the Providers element of the application definition file (ADF). If you are defining an application using Notification Services Management Objects (NMO), you individually define HostedEventProvider objects and add them to a HostedEventProviderCollection using the appliction's HostedEventProviders property.

Event Provider Name

The event provider name identifies the event provider that submitted each batch of events. When you are debugging, troubleshooting, and monitoring applications, you often supply the event provider name as a parameter.

To define the event provider name

Class Name

For each hosted event provider, you must provide the name of the class that implements the event provider.

  • For custom hosted event providers, the class name must conform to the Microsoft .NET Framework naming convention of Namespace.ClassName. For more information about namespace naming conventions, see Namespace Naming Guidelines in the Microsoft MSDN Library.
  • For standard Notification Services event providers, the class name does not include the namespace. Use the class name provided in the event provider documentation. For more information, see Standard Event Providers.
To define the class name

Assembly Name

If you are defining a custom event provider, supply the name of the assembly that contains the hosted event provider class. The name must include either the fully qualified path or fully qualified assembly name.

If you are defining a standard event provider, do not define the assembly name. The classes that define the standard event providers are in the core Notification Services assembly.

To define the assembly name

System Name

The system name property specifies the name of the system that runs the hosted event provider. This value typically is the computer name. However, if the event provider is running on a failover cluster, this value is the virtual server name.

Notification Services client components must be installed on the computer and the instance must be registered on the computer.

For more information about scaling-out an application, see Scale-Out Configurations.

To define the system name

Schedule

If you are defining a continuous event provider that includes all standard event providers and any custom event provider that implements the IEventProvider interface, do not define a schedule.

If you are defining a scheduled event provider that implements the IScheduledEventProvider interface, you must define a schedule for the event provider.

A schedule has the following properties:

  • The start time property specifies a time of day (24-hour period) in UTC that Notification Services uses to calculate invocation times for the scheduled event provider. For example, if your start time is 10:00 and your interval is three hours, the scheduled event provider invocation times are 10:00, 13:00, 16:00, and so on. If the application starts at 12:32, the event provider will first run at 13:00. For more examples, see StartTime Element for HostedProvider/Schedule (ADF).
  • The interval property specifies how frequently the scheduled event provider runs.
To define a schedule for a scheduled event provider

Timeout

Each hosted event provider must complete processing within a predetermined period of time. If the hosted event provider does not complete processing within that time, the current processing interval is cancelled.

Hosted event providers have a default timeout value of five minutes. You can configure a different timeout value.

To define a timeout value for a hosted event provider

ProviderTimeout Element (ADF) (ADF)

Timeout property (NMO)

Arguments

Notification Services can pass arguments to event providers. If your hosted event provider uses arguments, provide the argument names and values in the event provider definition.

If you are using an event provider developed by a third party, the event provider should come with documentation on the required and optional arguments. For standard event provider arguments , see Standard Event Providers.

To define the event provider arguments

See Also

Concepts

Defining Non-Hosted Event Providers

Other Resources

Defining Notification Services Applications
Developing a Custom Event Provider
Defining Event Providers
Defining Event Classes
Standard Event Providers

Help and Information

Getting SQL Server 2005 Assistance