Class BackgroundTaskMessageFactory

Creates the final message for a task on completion.

Inheritance
System.Object
BackgroundTaskMessageFactory
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.Commerce.BackgroundTasks
Assembly: Mediachase.Commerce.dll
Version: 10.8.0
Syntax
public class BackgroundTaskMessageFactory

Constructors

BackgroundTaskMessageFactory()

Declaration
public BackgroundTaskMessageFactory()

Methods

CreateExceptionMessage(IBackgroundTaskMessage, Exception)

Creates a message indicating the task has failed by throwing an exception.

Declaration
public virtual IBackgroundTaskMessage CreateExceptionMessage(IBackgroundTaskMessage mostRecentMessage, Exception exception)
Parameters
Type Name Description
IBackgroundTaskMessage mostRecentMessage

The last message generated by the task.

System.Exception exception

The exception thrown by the task.

Returns
Type Description
IBackgroundTaskMessage

A final message to add to the message log for the task, or null if no additional message should be added.

CreateFailureMessage(IBackgroundTaskMessage)

Creates a message indicating the task has failed by returning false.

Declaration
public virtual IBackgroundTaskMessage CreateFailureMessage(IBackgroundTaskMessage mostRecentMessage)
Parameters
Type Name Description
IBackgroundTaskMessage mostRecentMessage

The last message generated by the task.

Returns
Type Description
IBackgroundTaskMessage

A final message to add to the message log for the task, or null if no additional message should be added.

CreateSuccessMessage(IBackgroundTaskMessage)

Creates a message indicating the task has completed successfully.

Declaration
public virtual IBackgroundTaskMessage CreateSuccessMessage(IBackgroundTaskMessage mostRecentMessage)
Parameters
Type Name Description
IBackgroundTaskMessage mostRecentMessage

The last message generated by the task.

Returns
Type Description
IBackgroundTaskMessage

A final message to add to the message log for the task, or null if no additional message should be added.