Example #1
0
 /// <summary>
 /// Get a reference to the Rabit Workspace
 /// </summary>
 /// <returns></returns>
 public static RabitWorkspace GetWorkspace()
 {
     if (rabitWorkspace == null)
     {
         rabitWorkspace = new RabitWorkspace();
     }
     return(rabitWorkspace);
 }
Example #2
0
        //***********  End of Message Queues *************
        #endregion


        protected RabitWorkspace()
        {
            rabitWorkspace         = this; //This works if the Workspace was derived from RabitWorkspace
            publishSubcribeMsgDict = new Dictionary <string, PSMsgContainer>();
            //rwlPublishSubscribeDict = new ReaderWriterLockSlim();

            messageQueueDict = new Dictionary <string, RabitMessageQueue>();
            //rwlMessageQueueDict = new ReaderWriterLockSlim();
        }
Example #3
0
 /// <summary>
 /// The Rabit Reactor.
 /// The user may optionally add their own Rabit Workspace if they have
 /// extended the workspace to add other items/features.
 /// The user workspace must be instantiated before instantiating the
 /// Rabit reactor.
 /// </summary>
 /// <param name="userGlobalWorkspace"></param>
 public RabitReactor()
 {
     //Force the rabit workspace to initialize.
     RabitWorkspace.GetWorkspace();
     listOfManagers = new List <RabitManager>();
 }
Example #4
0
 /// <summary>
 /// Add a message to a Manager's Message Queue.
 /// It is assumed the manager added the Message Queue when it
 /// was initialized.
 /// </summary>
 /// <param name="queueName"></param>
 /// <param name="msg"></param>
 /// <returns>true if error... not message queue, false otherwise</returns>
 public bool AddMessageToQueue(string queueName, Object msg)
 {
     return(RabitWorkspace.GetWorkspace().AddMessageToQueue(queueName, msg));
 }
Example #5
0
 /// <summary>
 /// A manager can register a message queue pick up event if the manager
 /// needs to know when a message has been picked up by the receiving queue.
 /// Registering events should be done in the Manager's startup code.
 /// </summary>
 /// <param name="queueName"></param>
 /// <param name="delegateFunction"></param>
 /// <returns></returns>
 public bool RegisterMsgPickedUpEvent(string queueName, PublishSubscribeMessChangedHandler delegateFunction)
 {
     return(RabitWorkspace.GetWorkspace().RegisterMsgPickedUpEvent(queueName, delegateFunction));
 }
Example #6
0
 /// <summary>
 /// Add a thread-safe message queue to the Global WorkSpace.
 /// Managers that are on the recieving end of the Queue should add the
 /// message queue to the global workspace.  Other managers may obtain
 /// references to the message queue or add messages to the queue at run
 /// time.
 /// </summary>
 /// <param name="msgQueue"></param>
 /// <returns></returns>
 public void AddManagerMessageQueue(string queueName, RabitMessageQueue msgQueue)
 {
     RabitWorkspace.GetWorkspace().AddManagerMessageQueue(queueName, msgQueue);
 }
Example #7
0
 /// <summary>
 /// Add a new message as a Publish Subscribe Message to the List
 /// of Publish Subscibe messages.
 /// </summary>
 /// <param name="messageName"></param>
 /// <param name="msg"></param>
 /// /// <returns>true if Error, false if ok.</returns>
 public bool AddPublishSubscribeMessage(string messageName, RabitMessage msg)
 {
     return(RabitWorkspace.GetWorkspace().AddPublishSubscribeMessage(messageName, msg));
 }