Class EventProviderService
Repository that holds all configured Event
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Events.Providers
Assembly: EPiServer.Events.dll
Version: 9.12.2Syntax
public class EventProviderService : IEventProviderAccessor, IEventBroker, IDisposable, IRegisteredObject
Constructors
EventProviderService(EventProvider, IEnumerable<EventProvider>, IEventMessageFactory, IEventMessageValidator, TaskScheduler)
Initialize a new instance of Event
Declaration
public EventProviderService(EventProvider defaultProvider, IEnumerable<EventProvider> providers, IEventMessageFactory messageFactory, IEventMessageValidator messageValidator, TaskScheduler messageSendScheduler)
Parameters
Type | Name | Description |
---|---|---|
Event |
defaultProvider | The default provider |
System. |
providers | The list of supported providers |
IEvent |
messageFactory | The factory used to create message instances to send. |
IEvent |
messageValidator | The validator that evaluates incoming messages. |
System. |
messageSendScheduler | The task scheduler used to send messages. |
Properties
DefaultProvider
Gets the default provider.
Declaration
public EventProvider DefaultProvider { get; }
Property Value
Type | Description |
---|---|
Event |
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. |
|
Instance
The singleton instance of Event
Declaration
public static EventProviderService Instance { get; }
Property Value
Type | Description |
---|---|
Event |
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. |
Providers
Gets all registered providers.
Declaration
public IEnumerable<EventProvider> Providers { get; }
Property Value
Type | Description |
---|---|
System. |
The providers. |
Methods
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System. |
disposing |
GetProvider(String)
Get the event provider registered with name
Declaration
public virtual EventProvider GetProvider(string providerName)
Parameters
Type | Name | Description |
---|---|---|
System. |
providerName | The name. |
Returns
Type | Description |
---|---|
Event |
A event provider |
Exceptions
Type | Condition |
---|---|
System. |
name |
System. |
Throw if no matching provider was found |
Initialize()
Initializes this instance.
Declaration
public virtual void Initialize()
InitializeProvidersAsync()
Starts the optional asyncronous initialization of all registered providers.
Declaration
public virtual Task[] InitializeProvidersAsync()
Returns
Type | Description |
---|---|
System. |
An array of Task objects that can be used to syncronize the execution again. |
OnEventMissed(EventMissedEventArgs)
Called when the Event
Declaration
protected virtual void OnEventMissed(EventMissedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Event |
e | The Event |
OnEventReceived(Object, EventReceivedEventArgs)
Called when any Event
Declaration
protected virtual void OnEventReceived(object sender, EventReceivedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System. |
sender | The provider that received the event message. |
Event |
e | The Event |
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. |
eventId | The event id of the event to raise. |
System. |
parameter | The event parameter to send with the event. |
Returns
Type | Description |
---|---|
System. |
A System. |
Stop(Boolean)
Requests a registered object to unregister.
Declaration
public void Stop(bool immediate)
Parameters
Type | Name | Description |
---|---|---|
System. |
immediate | true to indicate the registered object should unregister from the hosting environment before returning; otherwise, false. |
Exceptions
Type | Condition |
---|---|
System. |
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. |
EventReceived
Occurs when a remote event has been received and verified.
Declaration
public event EventHandler<EventReceivedEventArgs> EventReceived
Event Type
Type | Description |
---|---|
System. |
Explicit Interface Implementations
IEventProviderAccessor.Provider
Gets the currently configured Event
Declaration
EventProvider IEventProviderAccessor.Provider { get; }
Returns
Type | Description |
---|---|
Event |