Class EventQueueController
EventQueueController provides business layer of event queue.
Inheritance
Namespace: DotNetNuke.Services.EventQueue
Assembly: DotNetNuke.dll
Syntax
public class EventQueueController : object
Remarks
Sometimes when your module running in DotNetNuke,and contains some operations didn't want to execute immediately. e.g: after your module installed into system, and some component you want to registered when the application restart, you can send an 'Application_Start' message, so your specific operation will be executed when application has been restart.
Examples
var oAppStartMessage = new EventMessage
{
Sender = sender,
Priority = MessagePriority.High,
ExpirationDate = DateTime.Now.AddYears(-1),
SentDate = DateTime.Now,
Body = "",
ProcessorType = "DotNetNuke.Entities.Modules.EventMessageProcessor, DotNetNuke",
ProcessorCommand = "UpdateSupportedFeatures"
};
oAppStartMessage.Attributes.Add("BusinessControllerClass", desktopModuleInfo.BusinessControllerClass);
oAppStartMessage.Attributes.Add("DesktopModuleId", desktopModuleInfo.DesktopModuleID.ToString());
EventQueueController.SendMessage(oAppStartMessage, "Application_Start");
if ((forceAppRestart))
{
Config.Touch();
}
Methods
| Improve this Doc View SourceGetMessages(String, String)
Gets the messages.
Declaration
public static EventMessageCollection GetMessages(string eventName, string subscriberId)
Parameters
Type | Name | Description |
---|---|---|
System.String | eventName | Name of the event. |
System.String | subscriberId | The subscriber ID. |
Returns
Type | Description |
---|---|
EventMessageCollection |
Remarks
Sometimes when your module running in DotNetNuke,and contains some operations didn't want to execute immediately. e.g: after your module installed into system, and some component you want to registered when the application restart, you can send an 'Application_Start' message, so your specific operation will be executed when application has been restart.
GetMessages(String)
Gets the messages.
Declaration
public static EventMessageCollection GetMessages(string eventName)
Parameters
Type | Name | Description |
---|---|---|
System.String | eventName | Name of the event. |
Returns
Type | Description |
---|---|
EventMessageCollection | event message collection. |
Remarks
Sometimes when your module running in DotNetNuke,and contains some operations didn't want to execute immediately. e.g: after your module installed into system, and some component you want to registered when the application restart, you can send an 'Application_Start' message, so your specific operation will be executed when application has been restart.
ProcessMessages(EventMessageCollection)
Processes the messages.
Declaration
public static bool ProcessMessages(EventMessageCollection eventMessages)
Parameters
Type | Name | Description |
---|---|---|
EventMessageCollection | eventMessages | The event messages. |
Returns
Type | Description |
---|---|
System.Boolean | true if any message is successfully sent, otherwise false. |
Remarks
Sometimes when your module running in DotNetNuke,and contains some operations didn't want to execute immediately. e.g: after your module installed into system, and some component you want to registered when the application restart, you can send an 'Application_Start' message, so your specific operation will be executed when application has been restart.
ProcessMessages(String, String)
Processes the messages.
Declaration
public static bool ProcessMessages(string eventName, string subscriberId)
Parameters
Type | Name | Description |
---|---|---|
System.String | eventName | Name of the event. |
System.String | subscriberId | The subscriber ID. |
Returns
Type | Description |
---|---|
System.Boolean | true if any message is successfully sent, otherwise false. |
Remarks
Sometimes when your module running in DotNetNuke,and contains some operations didn't want to execute immediately. e.g: after your module installed into system, and some component you want to registered when the application restart, you can send an 'Application_Start' message, so your specific operation will be executed when application has been restart.
ProcessMessages(String)
Processes the messages.
Declaration
public static bool ProcessMessages(string eventName)
Parameters
Type | Name | Description |
---|---|---|
System.String | eventName | Name of the event. |
Returns
Type | Description |
---|---|
System.Boolean | true if any message is successfully sent, otherwise false. |
Remarks
Sometimes when your module running in DotNetNuke,and contains some operations didn't want to execute immediately. e.g: after your module installed into system, and some component you want to registered when the application restart, you can send an 'Application_Start' message, so your specific operation will be executed when application has been restart.
SendMessage(EventMessage, String, Boolean)
EventQueueController provides business layer of event queue.
Declaration
public bool SendMessage(EventMessage message, string eventName, bool encryptMessage)
Parameters
Type | Name | Description |
---|---|---|
EventMessage | message | |
System.String | eventName | |
System.Boolean | encryptMessage |
Returns
Type | Description |
---|---|
System.Boolean |
Remarks
Sometimes when your module running in DotNetNuke,and contains some operations didn't want to execute immediately. e.g: after your module installed into system, and some component you want to registered when the application restart, you can send an 'Application_Start' message, so your specific operation will be executed when application has been restart.
Examples
var oAppStartMessage = new EventMessage
{
Sender = sender,
Priority = MessagePriority.High,
ExpirationDate = DateTime.Now.AddYears(-1),
SentDate = DateTime.Now,
Body = "",
ProcessorType = "DotNetNuke.Entities.Modules.EventMessageProcessor, DotNetNuke",
ProcessorCommand = "UpdateSupportedFeatures"
};
oAppStartMessage.Attributes.Add("BusinessControllerClass", desktopModuleInfo.BusinessControllerClass);
oAppStartMessage.Attributes.Add("DesktopModuleId", desktopModuleInfo.DesktopModuleID.ToString());
EventQueueController.SendMessage(oAppStartMessage, "Application_Start");
if ((forceAppRestart))
{
Config.Touch();
}
|
Improve this Doc
View Source
SendMessage(EventMessage, String)
Sends the message.
Declaration
public static bool SendMessage(EventMessage message, string eventName)
Parameters
Type | Name | Description |
---|---|---|
EventMessage | message | The message. |
System.String | eventName | Name of the event. |
Returns
Type | Description |
---|---|
System.Boolean | true if the message was successfully sent to all subscribers, otherwise false. |
Remarks
Sometimes when your module running in DotNetNuke,and contains some operations didn't want to execute immediately. e.g: after your module installed into system, and some component you want to registered when the application restart, you can send an 'Application_Start' message, so your specific operation will be executed when application has been restart.