SaaS CMS has officially launched! Learn more now.

Class EventProviderService

Repository that holds all configured EventProvider instances.

Inheritance
System.Object
EventProviderService
Implements
System.IDisposable
Namespace: EPiServer.Events.Providers.Internal
Assembly: EPiServer.Events.dll
Version: 12.0.3
Syntax
public class EventProviderService : Object, IEventProviderAccessor, IEventBroker, IDisposable

Constructors

EventProviderService(EventProvider, IEventMessageFactory, IEventMessageValidator)

Initialize a new instance of EventProviderService

Declaration
public EventProviderService(EventProvider provider, IEventMessageFactory messageFactory, IEventMessageValidator messageValidator)
Parameters
Type Name Description
EventProvider provider

The default provider

IEventMessageFactory messageFactory

The factory used to create message instances to send.

IEventMessageValidator messageValidator

The validator that evaluates incoming messages.

Properties

Enabled

Gets or sets a value indicating whether this instance is enabled or not. If no providers are configured this will always return false.

Declaration
public bool Enabled { get; set; }
Property Value
Type Description
System.Boolean

true if this instace is enabled otherwise, false.

IsActive

Gets a value indicating if the Service will be able to send or recieve any events.

Declaration
public virtual bool IsActive { get; }
Property Value
Type Description
System.Boolean

Methods

Dispose()

Declaration
public void Dispose()

Dispose(Boolean)

Declaration
protected void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

InitializeProvidersAsync()

Starts the optional asyncronous initialization provider.

Declaration
public virtual Task InitializeProvidersAsync()
Returns
Type Description
System.Threading.Tasks.Task

An Task object that can be used to syncronize the execution again.

OnEventMissed(EventMissedEventArgs)

Called when the EventProviderService has identified a message as missing and raises the EventMissed event.

Declaration
protected virtual void OnEventMissed(EventMissedEventArgs e)
Parameters
Type Name Description
EventMissedEventArgs e

The EventMissedEventArgs instance containing the event data.

OnEventReceived(Object, EventReceivedEventArgs)

Called when any EventProvider has recieved a message and raises the EventReceived event.

Declaration
protected virtual void OnEventReceived(object sender, EventReceivedEventArgs e)
Parameters
Type Name Description
System.Object sender

The provider that received the event message.

EventReceivedEventArgs e

The EventReceivedEventArgs instance containing the event data.

RaiseEventAsync(Guid, Object)

Raises an event remotely in an asyncrounous manner.

Declaration
public virtual Task RaiseEventAsync(Guid eventId, object parameter)
Parameters
Type Name Description
System.Guid eventId

The event id of the event to raise.

System.Object parameter

The event parameter to send with the event.

Returns
Type Description
System.Threading.Tasks.Task

A System.Threading.Tasks.Task representing the work required to raise the event.

Uninitialize()

Detaches all event handlers to provider.

Declaration
public virtual void Uninitialize()

Events

EventMissed

Occurs when it is discovered that a remote event was missed.

Declaration
public event EventHandler<EventMissedEventArgs> EventMissed
Event Type
Type Description
System.EventHandler<EventMissedEventArgs>

EventReceived

Occurs when a remote event has been received and verified.

Declaration
public event EventHandler<EventReceivedEventArgs> EventReceived
Event Type
Type Description
System.EventHandler<EventReceivedEventArgs>

Explicit Interface Implementations

IEventProviderAccessor.Provider

Gets the currently configured EventProvider.

Declaration
EventProvider IEventProviderAccessor.Provider { get; }
Returns
Type Description
EventProvider

Implements

System.IDisposable

Extension Methods