Class ActivityDispatcher
The ActivityDispatcher is a component responsible for processing activities that are dispatched to it by the ActivityReceiver. Every activity dispatched to the ActivityDispatcher is further dispatched to all default Activity Streams handlers, and any externally registered ActivityHandlers.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Social.ActivityStreams
Assembly: EPiServer.Social.ActivityStreams.dll
Version: 1.5.4Syntax
public class ActivityDispatcher : IActivityDispatcher
Methods
Dispatch(Activity, Object)
Further dispatches the activity received to all default handlers and registered activity handlers capable of processing an activity type that matches the type of the extension parameter.
Declaration
public void Dispatch(Activity activity, object extension)
Parameters
| Type | Name | Description |
|---|---|---|
| Activity | activity | An activity that is dispatched to the ActivityDispatcher |
| System.Object | extension | The payload of an activity that is dispatched to the ActivityDispatcher |
Register(IActivityHandler<Object>)
Registers a default activity handler. The specified activity handler is added to the default ActivityStreams handlers list. All default ActivityStreams handlers are invoked by the system when an activity is dispatched to the IActivityDispatcher.
Declaration
public void Register(IActivityHandler<object> defaultHandler)
Parameters
| Type | Name | Description |
|---|---|---|
| IActivityHandler<System.Object> | defaultHandler | The activity handler to add to the default ActivityStreams handlers |
Register<TExtension>(IActivityHandler<TExtension>)
Registers an activity handler capable of processing an activity of type TExtension.
Declaration
public void Register<TExtension>(IActivityHandler<TExtension> handler)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| IActivityHandler<TExtension> | handler | The activity handler to be registered |
Type Parameters
| Name | Description |
|---|---|
| TExtension | The type of activity for which the handler should be registered |