ooRexx  4.2.0-source
About: ooRexx (Open Object Rexx) is a free implementation of Object Rexx. Object Rexx is an enhancement of the classic Rexx interpreter; a full-featured programming language with a human-oriented syntax.
  Fossies Dox: ooRexx-4.2.0-source.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

QueueManager.cpp
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
4 /* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */
5 /* */
6 /* This program and the accompanying materials are made available under */
7 /* the terms of the Common Public License v1.0 which accompanies this */
8 /* distribution. A copy is also available at the following address: */
9 /* http://www.ibm.com/developerworks/oss/CPLv1.0.htm */
10 /* */
11 /* Redistribution and use in source and binary forms, with or */
12 /* without modification, are permitted provided that the following */
13 /* conditions are met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright */
16 /* notice, this list of conditions and the following disclaimer. */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in */
19 /* the documentation and/or other materials provided with the distribution. */
20 /* */
21 /* Neither the name of Rexx Language Association nor the names */
22 /* of its contributors may be used to endorse or promote products */
23 /* derived from this software without specific prior written permission. */
24 /* */
25 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
26 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
27 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
28 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
29 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
30 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
32 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
33 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
34 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
35 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 /* */
37 /*----------------------------------------------------------------------------*/
38 
39 #include "QueueManager.hpp"
40 #include "APIServer.hpp"
41 #include <time.h>
42 #include <new>
43 #include "stdio.h"
44 #include "Utilities.hpp"
45 #include "SynchronizedBlock.hpp"
46 
51 {
52  time_t timer = time(NULL);
53  struct tm *time = localtime(&timer);
54  addTime.year = time->tm_year;
55  addTime.month = time->tm_mon;
56  addTime.day = time->tm_mday;
57  addTime.hours = time->tm_hour;
58  addTime.minutes = time->tm_min;
59  addTime.seconds = time->tm_sec;
61  addTime.weekday = time->tm_wday;
62 }
63 
68 {
69  waitSem.close(); // make sure our semaphore cleans up if we've used it.
70  clear();
71  if (queueName != NULL)
72  {
73  delete [] queueName; // also delete the name
74  }
75 }
76 
81 {
82  // now clear the queue
83  QueueItem *item = firstItem;
84  while (item != NULL)
85  {
86  // move to the next one and delete
87  QueueItem *localnext = item->next;
88  delete item;
89  item = localnext;
90  }
91  firstItem = NULL;
92  lastItem = NULL;
93  itemCount = 0;
94 }
95 
102 {
103  const char *queueData = (const char *)message.getMessageData();
104  size_t itemLength = (size_t)message.parameter1;
105  size_t order = (size_t)message.parameter2;
106  // detach the message data from the message so the controller
107  // doesn't free this.
108  message.clearMessageData();
109  QueueItem *item = new QueueItem(queueData, itemLength);
110  if (order == QUEUE_LIFO)
111  {
112  addLifo(item);
113  }
114  else
115  {
116  addFifo(item);
117  }
118  message.setResult(QUEUE_ITEM_ADDED);
119 }
120 
121 
128 {
129  item->next = firstItem;
130  firstItem = item;
131  if (lastItem == NULL)
132  {
133  lastItem = item;
134  }
135  itemCount++;
136  // make sure we notify any waiters that something has arrived.
137  checkWaiters();
138 }
139 
146 {
147  if (lastItem == NULL)
148  {
149  firstItem = item;
150  lastItem = item;
151  }
152  else
153  {
154  lastItem->next = item;
155  lastItem = item;
156  }
157  itemCount++;
158  // make sure we notify any waiters that something has arrived.
159  checkWaiters();
160 }
161 
162 
170 {
171  QueueItem *item = firstItem;
172  if (item != NULL)
173  {
174  firstItem = item->next;
175  if (firstItem == NULL)
176  {
177  lastItem = NULL;
178  }
179  itemCount--;
180  }
181  return item;
182 }
183 
184 
195 {
196  Lock managerLock(manager->lock); // this needs synchronization here
197 
198  // now that we have the lock, clear the wait sem unconditionally.
199  // this should be safe, as it is either already clear, and has waiters camped
200  // on it, or it has recently been posted, and since we're going to read data,
201  // we either want it cleared for others to wait, or we're going to need to wait
202  // on it ourself.
203  waitSem.reset();
204  QueueItem *item = getFirst();
205  // if we have an item, return it.
206  if (item != NULL)
207  {
208  // make sure we pass the total length back
209  message.parameter1 = item->size;
210  // copy the time stamp into the now-unused name buffer
211  memcpy(message.nameArg, &item->addTime, sizeof(RexxQueueTime));
212  // the message will delete the queue data once it has been sent
213  // back to the client.
214  message.setMessageData((void *)item->elementData, item->size);
215  // this data needs to be freed once the result is sent back, if we allocated it
216  message.retainMessageData = false;
217  // we've taken the data from the item, so clear it out before we delete.
218  item->clear();
219  // we're done with this, let it go.
220  delete item;
221  message.setResult(QUEUE_ITEM_PULLED);
222  return true;
223  }
224  // Move along, nothing to see here....
225  return false;
226 }
227 
228 
235 {
236  // this might take multiple times if we have to wait
237  size_t noWait = (size_t)message.parameter1;
238 
239  // if the pull succeeded, return now.
240  if (pullData(manager, message))
241  {
242  return;
243  }
244 
245  // nowait value
246  if (noWait != QUEUE_WAIT_FOR_DATA)
247  {
248  message.setResult(QUEUE_EMPTY); // nada
249  return;
250  }
251  else
252  {
253  {
254  Lock managerLock(manager->lock);
255  // indicate we have another waiting queue
256  addWaiter();
257  }
258  // now keep looping until we actually get an item
259  while (true)
260  {
261  waitForData();
262  {
263  // see if this is doable now without waiting...there was a window of
264  // opportunity for an item to be added.
265  if (pullData(manager, message))
266  {
267  {
268  Lock managerLock(manager->lock);
269  // remove us as a waiter
270  removeWaiter();
271  }
272  return;
273  }
274  }
275  }
276  }
277 }
278 
287 DataQueue *QueueTable::locate(const char *name)
288 {
289  DataQueue *current = queues; // start the search
290  DataQueue *previous = NULL; // no previous one
291 
292  /* while more queues */
293  while (current != NULL)
294  {
295  // find the one we want?
296  if (Utilities::strCaselessCompare(name, current->queueName) == 0)
297  {
298  return current;
299  }
300  previous = current; /* remember this block */
301  current = current->next; /* step to the next block */
302  }
303  return NULL;
304 }
305 
315 {
316  Lock managerLock(manager->lock); // this needs synchronization here
317  return locate(name);
318 }
319 
329 {
330  DataQueue *current = queues; // start the search
331  DataQueue *previous = NULL; // no previous one
332 
333  while (current != NULL) // while more queues
334  {
335  // find the one we want?
336  if (current->session == id)
337  {
338  return current;
339  }
340  previous = current; // remember this block
341  current = current->next; // to the next block
342  }
343  return NULL; // return NULL if not located
344 }
345 
355 {
356  Lock managerLock(manager->lock); // this needs synchronization here
357  return locate(id);
358 }
359 
360 
368 DataQueue *QueueTable::remove(const char *name)
369 {
370  DataQueue *current = queues; // start the search
371  DataQueue *previous = NULL; // no previous one
372 
373  while (current != NULL) /* while more queues */
374  {
375  // find the one we want?
376  if (Utilities::strCaselessCompare(name, current->queueName) == 0)
377  {
378  // move this to the front so we find it quickly
379  removeQueue(current, previous);
380  return current;
381  }
382  previous = current; /* remember this block */
383  current = current->next; /* step to the next block */
384  }
385  return NULL;
386 }
387 
388 
395 {
396  DataQueue *current = queues; // start the search
397  DataQueue *previous = NULL; // no previous one
398 
399  while (current != NULL) /* while more queues */
400  {
401  // find the one we want?
402  if (current == q)
403  {
404  // move this to the front so we find it quickly
405  removeQueue(current, previous);
406  }
407  previous = current; /* remember this block */
408  current = current->next; /* step to the next block */
409  }
410 }
411 
420 {
421  DataQueue *current = queues; // start the search
422  DataQueue *previous = NULL; // no previous one
423 
424  while (current != NULL) // while more queues
425  {
426  // find the one we want?
427  if (current->session == id)
428  {
429  // move this to the front so we find it quickly
430  removeQueue(current, previous);
431  return current;
432  }
433  previous = current; // remember this block
434  current = current->next; // to the next block
435  }
436  current = new DataQueue(id); // create a new session queue
437  add(current); // and add it to the table.
438  return current;
439 }
440 
441 
448 {
449  queue->next = queues;
450  queues = queue;
451 }
452 
453 
454 // Add an item to the session queue. The message arguments have the
455 // following meanings:
456 //
457 // parameter1 -- length of the queue item.
458 // parameter2 -- lifo/fifo flag
459 // parameter3 -- handle of the session queue
461 {
462  // We can go directly to the referenced queue.
463  DataQueue *queue = getSessionQueue((SessionID)message.parameter3);
464  queue->add(message);
465 }
466 
467 // Add an item to a named queue. The message arguments have the
468 // following meanings:
469 //
470 // parameter1 -- length of the queue item.
471 // parameter2 -- lifo/fifo flag
472 // nameArg -- ASCII-Z name of the queue
474 {
475  DataQueue *queue = namedQueues.locate(message.nameArg);
476  // not previously created?
477  if (queue == NULL)
478  {
479  // this is an error
481  }
482  // queue exists, so add the item
483  else
484  {
485  queue->add(message);
486  }
487 }
488 
489 
490 // Pull an item from a session queue. The message arguments have the
491 // following meanings:
492 //
493 // parameter1 -- NOWAIT flag, indicating whether we should wait for data
494 // parameter2 -- the ENDWAIT flat to indicate this was a waiting process
495 // parameter3 -- session queue handle
497 {
498  DataQueue *queue = getSessionQueue((SessionID)message.parameter3);
499  queue->pull(this, message);
500 }
501 
502 
503 // Pull an item from a session queue. The message arguments have the
504 // following meanings:
505 //
506 // parameter1 -- NOWAIT flag, indicating whether we should wait for data
507 // parameter2 -- the ENDWAIT flat to indicate this was a waiting process
508 // nameArg -- ASCII-Z name of the queue
510 {
511  // we're holding the lock yet, so we need to use the locate
512  // method that grabs the lock first. If we don't, then we run
513  // the risk that the queue will be reordered while we're searching.
514  // The results will be bad, definitely very bad.
515  DataQueue *queue = namedQueues.synchronizedLocate(this, message.nameArg);
516  // not previously created?
517  if (queue == NULL)
518  {
519  // this is an error
521  }
522  // queue exists, so add the item
523  else
524  {
525  queue->pull(this, message);
526  }
527 }
528 
529 // locate a session queue from session id. This will create it, if necessary
530 //
531 // parameter1 -- caller's session id (replaced by queue handle on return);
533 {
534  // this could be redundant, but if called as a result of a PULL operation,
535  // we're not holding the lock yet. We need to nest the call.
536  Lock managerLock(lock);
537 
538  DataQueue *queue = sessionQueues.locate(session);
539  // not previously created?
540  if (queue == NULL)
541  {
542  // this is easy, just create a new queue and add it to the table
543  queue = new DataQueue(session);
544  sessionQueues.add(queue);
545  }
546  return queue;
547 }
548 
549 // Create a session queue. The message arguments have the
550 // following meanings:
551 //
552 // parameter1 -- caller's session id (replaced by queue handle on return);
554 {
555  DataQueue *queue = sessionQueues.locate(session);
556  // not previously created?
557  if (queue == NULL)
558  {
559  // this is easy, just create a new queue and add it to the table
560  queue = new DataQueue(session);
561  sessionQueues.add(queue);
562  }
563  // name collision...we need to update
564  else
565  {
566  // we have nested usage of the session queues,
567  // so we need to bump the nesting counter.
568  queue->addReference();
569  }
570 }
571 
572 // Create a session queue. The message arguments have the
573 // following meanings:
574 //
575 // parameter1 -- caller's session id (replaced by queue handle on return);
577 {
578  SessionID session = (SessionID)message.parameter1;
579  createSessionQueue(session);
580  // the session id is used as the handle
581  message.parameter1 = (uintptr_t)session;
582  message.setResult(QUEUE_CREATED);
583 }
584 
591 {
592  DataQueue *queue = new DataQueue(); // get an anonymous queue
593  // the queue pointer makes a good starting point for an anonymous tag
594  uintptr_t tag = (uintptr_t)queue;
595  for (;;) // we need to loop until we get a unique one.
596  {
597  char session[32];
598  char tagstring[32];
599 
600  // linux uses a 0x prefix for pointers, Windows doesn't. Just pull off
601  // the address characters without any "0x" prefix.
602  sprintf(session, "%p", (void *)message.parameter1);
603  sprintf(tagstring, "%p", (void *)tag);
604 
605  // message parameter1 is the session identifier.
606  sprintf(message.nameArg, "S%sQ%s", (void *)(session[1] == 'x' ? session + 2 : session),
607  (void *)(tagstring[1] == 'x' ? tagstring + 2 : tagstring));
608  if (namedQueues.locate(message.nameArg) == 0)
609  {
610  // set the name
611  queue->setName(message.nameArg);
612  // got a good one, add it and return
613  namedQueues.add(queue);
614  return;
615  }
616  tag++; // try a new number
617  }
618 }
619 
620 
621 // Create a named queue. The message arguments have the
622 // following meanings:
623 //
624 // parameter1 -- caller's session id, only used with duplicates
625 // nameArg -- ASCII-Z name of the queue
627 {
628  // no user-specified name?
629  if (strlen(message.nameArg) == 0)
630  {
631  // create a uniquely named one
632  createUniqueQueue(message);
633  message.setResult(QUEUE_CREATED);
634  return;
635  }
636 
637  DataQueue *queue = namedQueues.locate(message.nameArg);
638  // not previously created?
639  if (queue == NULL)
640  {
641  // this is easy, just create a new queue and add it to the table
642  queue = new DataQueue(message.nameArg);
643  namedQueues.add(queue);
644  message.setResult(QUEUE_CREATED);
645  return;
646  }
647  // name collision...we need to update
648  else
649  {
651  // create a uniquely named one
652  createUniqueQueue(message);
653  }
654 }
655 
656 
657 // Create a named queue. The message arguments have the
658 // following meanings:
659 //
660 // parameter1 -- caller's session id, only used with duplicates
661 // nameArg -- ASCII-Z name of the queue
663 {
664  DataQueue *queue = namedQueues.locate(message.nameArg);
665  // not previously created?
666  if (queue == NULL)
667  {
668  // this is easy, just create a new queue and add it to the table
669  queue = new DataQueue(message.nameArg);
670  namedQueues.add(queue);
671  message.setResult(QUEUE_CREATED);
672  }
673  else
674  {
675  // indicate this already exists
676  message.setResult(QUEUE_EXISTS);
677  }
678 }
679 
680 
681 // Query a named queue. The message arguments have the
682 // following meanings:
683 //
684 // parameter1 -- caller's session id, only used with duplicates
685 // nameArg -- ASCII-Z name of the queue
687 {
688  DataQueue *queue = namedQueues.locate(message.nameArg);
689  // not previously created?
690  if (queue == NULL)
691  {
692  // not here
694  }
695  else
696  {
697  // indicate this already exists
698  message.setResult(QUEUE_EXISTS);
699  }
700 }
701 
702 
703 // Increment the reference count on a session queue. The message arguments have the
704 // following meanings:
705 //
706 // parameter1 -- session queue handle
708 {
709  SessionID session = (SessionID)message.parameter2;
710  // this will create one associated with the session or force it to be
711  // nested if it doesn't exist
712  createSessionQueue(session);
713  message.parameter1 = (uintptr_t)session;
714  message.setResult(QUEUE_OK);
715 }
716 
717 
718 // Delete a session queue. The message arguments have the
719 // following meanings:
720 //
721 // parameter1 -- session queue handle
723 {
724  SessionID session = (SessionID)message.parameter1;
725  DataQueue *queue = getSessionQueue(session);
726  message.setResult(QUEUE_DELETED);
727  // do we have clients waiting for pull data?
728  if (queue->hasWaiters())
729  {
730  message.setResult(QUEUE_IN_USE);
731  }
732  // still have references?
733  else if (queue->removeReference() == 0)
734  {
735  sessionQueues.remove(queue); // remove from table and
736  delete queue; // delete this
737  }
738 }
739 
740 
741 // Delete a session queue. The message arguments have the
742 // following meanings:
743 //
744 // parameter1 -- session queue handle
746 {
747  // do we have clients waiting for pull data?
748  if (!queue->hasWaiters())
749  {
750  // still have references?
751  if (queue->removeReference() == 0)
752  {
753  sessionQueues.remove(queue); // remove from table and
754  delete queue; // delete this
755  }
756  }
757 }
758 
759 // Delete a named queue. The message arguments have the
760 // following meanings:
761 //
762 // nameArg -- ASCII-Z name of the queue
764 {
765  DataQueue *queue = namedQueues.locate(message.nameArg);
766  message.setResult(QUEUE_DELETED);
767  // not previously created?
768  if (queue == NULL)
769  {
771  }
772  else
773  {
774  // do we have clients waiting for pull data?
775  if (queue->hasWaiters())
776  {
777  message.setResult(QUEUE_IN_USE);
778  }
779  else
780  {
781  namedQueues.remove(queue); // remove the queue item
782  delete queue; // delete this
783  }
784  }
785 }
786 
787 
788 // get the count for a session queue. The message arguments have the
789 // following meanings:
790 //
791 // parameter1 -- handle of the session queue (updated to queue count on return)
793 {
794  SessionID session = (SessionID)message.parameter1;
795  DataQueue *queue = getSessionQueue(session);
796  // session queues are automatically created, so we always have
797  // an item count
798  message.parameter1 = queue->getItemCount();
799  message.setResult(QUEUE_EXISTS);
800 }
801 
802 
803 // Pull an item from a session queue. The message arguments have the
804 // following meanings:
805 //
806 // nameArg -- ASCII-Z name of the queue
808 {
809  DataQueue *queue = namedQueues.locate(message.nameArg);
810  // not previously created?
811  if (queue == NULL)
812  {
813  // this is an error
815  }
816  // queue exists, so add the item
817  else
818  {
819  message.parameter1 = queue->getItemCount();
820  message.setResult(QUEUE_EXISTS);
821  }
822 }
823 
824 
825 // clear any entries from a session queue. The message arguments have the
826 // following meanings:
827 //
828 // parameter1 -- handle of the session queue (updated to queue count on return)
830 {
831  SessionID session = (SessionID)message.parameter1;
832  DataQueue *queue = getSessionQueue(session);
833  // session queues are automatically created, so we always have
834  // an item count
835  queue->clear();
836  message.setResult(QUEUE_EXISTS);
837 }
838 
839 
840 // clear any entreis from a named queue. The message arguments have the
841 // following meanings:
842 //
843 // nameArg -- ASCII-Z name of the queue
845 {
846  DataQueue *queue = namedQueues.locate(message.nameArg);
847  // not previously created?
848  if (queue == NULL)
849  {
850  // this is an error
852  }
853  // queue exists, so add the item
854  else
855  {
856  queue->clear();
857  message.setResult(QUEUE_EXISTS);
858  }
859 }
860 
861 
868 {
869  // the pull operations might have to wait for an item to be added,
870  // so they need to control their own locking mechanisms
871  if (message.operation == PULL_FROM_NAMED_QUEUE)
872  {
873  pullFromNamedQueue(message);
874  }
875  else if (message.operation == PULL_FROM_SESSION_QUEUE)
876  {
877  pullFromSessionQueue(message);
878  }
879  else {
880  Lock managerLock(lock); // we need to synchronize on this instance
881  switch (message.operation)
882  {
883  case NEST_SESSION_QUEUE:
884  nestSessionQueue(message);
885  break;
887  createSessionQueue(message);
888  break;
889  case CREATE_NAMED_QUEUE:
890  createNamedQueue(message);
891  break;
892  case OPEN_NAMED_QUEUE:
893  openNamedQueue(message);
894  break;
895  case QUERY_NAMED_QUEUE:
896  queryNamedQueue(message);
897  break;
899  deleteSessionQueue(message);
900  break;
901  case DELETE_NAMED_QUEUE:
902  deleteNamedQueue(message);
903  break;
905  getSessionQueueCount(message);
906  break;
908  getNamedQueueCount(message);
909  break;
910  case CLEAR_SESSION_QUEUE:
911  clearSessionQueue(message);
912  break;
913  case CLEAR_NAMED_QUEUE:
914  clearNamedQueue(message);
915  break;
916  case ADD_TO_NAMED_QUEUE:
917  addToNamedQueue(message);
918  break;
920  addToSessionQueue(message);
921  break;
922  default:
923  message.setExceptionInfo(SERVER_FAILURE, "Invalid queue manager operation");
924  break;
925  }
926  }
927 }
928 
930 {
931  DataQueue *queue = sessionQueues.locate(session);
932  // if the queue exists for this session, turn this into a
933  // delete request.
934  if (queue != NULL)
935  {
936  deleteSessionQueue((DataQueue *)queue);
937  }
938 }
QueueItem::next
QueueItem * next
Definition: QueueManager.hpp:84
QUEUE_OK
Definition: ServiceMessage.hpp:173
ServerQueueManager::sessionQueues
QueueTable sessionQueues
Definition: QueueManager.hpp:276
QUEUE_ITEM_ADDED
Definition: ServiceMessage.hpp:167
DUPLICATE_QUEUE_NAME
Definition: ServiceMessage.hpp:163
ServerQueueManager
Definition: QueueManager.hpp:239
ServerQueueManager::clearNamedQueue
void clearNamedQueue(ServiceMessage &message)
Definition: QueueManager.cpp:844
ServerQueueManager::createUniqueQueue
void createUniqueQueue(ServiceMessage &message)
Definition: QueueManager.cpp:590
_RexxQueueTime::minutes
uint16_t minutes
Definition: rexx.h:239
QueueItem::elementData
const char * elementData
Definition: QueueManager.hpp:85
SysSemaphore::reset
void reset()
Definition: SysSemaphore.cpp:213
ServiceMessage::setMessageData
void setMessageData(void *data, size_t length)
Definition: ServiceMessage.hpp:371
DataQueue::pull
void pull(ServerQueueManager *manager, ServiceMessage &message)
Definition: QueueManager.cpp:234
ADD_TO_SESSION_QUEUE
Definition: ServiceMessage.hpp:117
DataQueue::session
SessionID session
Definition: QueueManager.hpp:186
GET_SESSION_QUEUE_COUNT
Definition: ServiceMessage.hpp:114
ServerQueueManager::clearSessionQueue
void clearSessionQueue(ServiceMessage &message)
Definition: QueueManager.cpp:829
_RexxQueueTime::day
uint16_t day
Definition: rexx.h:242
QueueTable::add
void add(DataQueue *queue)
Definition: QueueManager.cpp:447
ServiceMessage::nameArg
char nameArg[NAMESIZE]
Definition: ServiceMessage.hpp:426
ServiceMessage::setResult
void setResult(ServiceReturn code)
Definition: ServiceMessage.hpp:293
ServerQueueManager::dispatch
void dispatch(ServiceMessage &message)
Definition: QueueManager.cpp:867
ServerQueueManager::DataQueue
friend class DataQueue
Definition: QueueManager.hpp:241
QUEUE_EXISTS
Definition: ServiceMessage.hpp:172
QUEUE_IN_USE
Definition: ServiceMessage.hpp:175
QueueItem
Definition: QueueManager.hpp:49
DataQueue::lastItem
QueueItem * lastItem
Definition: QueueManager.hpp:184
QueueTable::removeQueue
void removeQueue(DataQueue *current, DataQueue *previous)
Definition: QueueManager.hpp:213
QUEUE_WAIT_FOR_DATA
Definition: ServiceMessage.hpp:196
QueueItem::size
size_t size
Definition: QueueManager.hpp:86
DataQueue::getFirst
QueueItem * getFirst()
Definition: QueueManager.cpp:169
DataQueue::getItemCount
size_t getItemCount()
Definition: QueueManager.hpp:174
DataQueue::itemCount
size_t itemCount
Definition: QueueManager.hpp:179
DataQueue::queueName
const char * queueName
Definition: QueueManager.hpp:185
GET_NAMED_QUEUE_COUNT
Definition: ServiceMessage.hpp:115
CREATE_SESSION_QUEUE
Definition: ServiceMessage.hpp:110
ServerQueueManager::pullFromSessionQueue
void pullFromSessionQueue(ServiceMessage &message)
Definition: QueueManager.cpp:496
APIServer.hpp
DataQueue::clear
void clear()
Definition: QueueManager.cpp:80
DataQueue::next
DataQueue * next
Definition: QueueManager.hpp:178
_RexxQueueTime::microseconds
uint32_t microseconds
Definition: rexx.h:246
DataQueue::addReference
void addReference()
Definition: QueueManager.hpp:157
SysSemaphore::close
void close()
Definition: SysSemaphore.cpp:153
_RexxQueueTime::weekday
uint16_t weekday
Definition: rexx.h:245
ServiceMessage::parameter2
uintptr_t parameter2
Definition: ServiceMessage.hpp:417
PULL_FROM_NAMED_QUEUE
Definition: ServiceMessage.hpp:118
QueueTable::queues
DataQueue * queues
Definition: QueueManager.hpp:235
DELETE_NAMED_QUEUE
Definition: ServiceMessage.hpp:113
_RexxQueueTime::hours
uint16_t hours
Definition: rexx.h:238
QueueTable::locate
DataQueue * locate(const char *name)
Definition: QueueManager.cpp:287
ServiceMessage::parameter3
uintptr_t parameter3
Definition: ServiceMessage.hpp:418
SynchronizedBlock.hpp
DataQueue::firstItem
QueueItem * firstItem
Definition: QueueManager.hpp:183
ServiceMessage::setExceptionInfo
void setExceptionInfo(ErrorCode error, const char *message)
Definition: ServiceMessage.hpp:299
DataQueue::addWaiter
void addWaiter()
Definition: QueueManager.hpp:124
ServerQueueManager::getSessionQueueCount
void getSessionQueueCount(ServiceMessage &message)
Definition: QueueManager.cpp:792
QUEUE_DOES_NOT_EXIST
Definition: ServiceMessage.hpp:174
ServerQueueManager::createNamedQueue
void createNamedQueue(ServiceMessage &message)
Definition: QueueManager.cpp:626
DataQueue::~DataQueue
~DataQueue()
Definition: QueueManager.cpp:67
Lock
Definition: SynchronizedBlock.hpp:50
ServerQueueManager::createSessionQueue
void createSessionQueue(ServiceMessage &message)
Definition: QueueManager.cpp:576
ServerQueueManager::lock
SysMutex lock
Definition: QueueManager.hpp:277
ServiceMessage::clearMessageData
void clearMessageData()
Definition: ServiceMessage.hpp:336
ServerQueueManager::addToSessionQueue
void addToSessionQueue(ServiceMessage &message)
Definition: QueueManager.cpp:460
QueueManager.hpp
QueueTable::remove
DataQueue * remove(const char *name)
Definition: QueueManager.cpp:368
DataQueue::removeReference
size_t removeReference()
Definition: QueueManager.hpp:158
DataQueue::addLifo
void addLifo(QueueItem *item)
Definition: QueueManager.cpp:127
ServiceMessage::parameter1
uintptr_t parameter1
Definition: ServiceMessage.hpp:416
_RexxQueueTime::month
uint16_t month
Definition: rexx.h:243
ServiceMessage::operation
ServerOperation operation
Definition: ServiceMessage.hpp:414
ServerQueueManager::pullFromNamedQueue
void pullFromNamedQueue(ServiceMessage &message)
Definition: QueueManager.cpp:509
ServerQueueManager::namedQueues
QueueTable namedQueues
Definition: QueueManager.hpp:275
QUEUE_DELETED
Definition: ServiceMessage.hpp:171
DataQueue
Definition: QueueManager.hpp:90
_RexxQueueTime::year
uint16_t year
Definition: rexx.h:244
DataQueue::addFifo
void addFifo(QueueItem *item)
Definition: QueueManager.cpp:145
ServerQueueManager::getNamedQueueCount
void getNamedQueueCount(ServiceMessage &message)
Definition: QueueManager.cpp:807
QUEUE_LIFO
Definition: ServiceMessage.hpp:195
QueueItem::addTime
RexxQueueTime addTime
Definition: QueueManager.hpp:87
ServerQueueManager::deleteSessionQueue
void deleteSessionQueue(ServiceMessage &message)
Definition: QueueManager.cpp:722
DataQueue::pullData
bool pullData(ServerQueueManager *manager, ServiceMessage &message)
Definition: QueueManager.cpp:194
DataQueue::waitSem
SysSemaphore waitSem
Definition: QueueManager.hpp:182
CLEAR_SESSION_QUEUE
Definition: ServiceMessage.hpp:120
OPEN_NAMED_QUEUE
Definition: ServiceMessage.hpp:122
QueueTable::synchronizedLocate
DataQueue * synchronizedLocate(ServerQueueManager *manager, const char *name)
Definition: QueueManager.cpp:314
SessionID
uintptr_t SessionID
Definition: ServiceMessage.hpp:72
QueueItem::clear
void clear()
Definition: QueueManager.hpp:76
_RexxQueueTime::seconds
uint16_t seconds
Definition: rexx.h:240
ServerQueueManager::deleteNamedQueue
void deleteNamedQueue(ServiceMessage &message)
Definition: QueueManager.cpp:763
DataQueue::add
void add(ServiceMessage &message)
Definition: QueueManager.cpp:101
ServerQueueManager::cleanupProcessResources
void cleanupProcessResources(SessionID session)
Definition: QueueManager.cpp:929
DataQueue::setName
void setName(const char *name)
Definition: QueueManager.hpp:113
ServiceMessage::retainMessageData
bool retainMessageData
Definition: ServiceMessage.hpp:425
ServerQueueManager::queryNamedQueue
void queryNamedQueue(ServiceMessage &message)
Definition: QueueManager.cpp:686
DataQueue::checkWaiters
void checkWaiters()
Definition: QueueManager.hpp:136
ServiceMessage::getMessageData
void * getMessageData()
Definition: ServiceMessage.hpp:343
DELETE_SESSION_QUEUE
Definition: ServiceMessage.hpp:112
NEST_SESSION_QUEUE
Definition: ServiceMessage.hpp:109
ServerQueueManager::openNamedQueue
void openNamedQueue(ServiceMessage &message)
Definition: QueueManager.cpp:662
QUEUE_ITEM_PULLED
Definition: ServiceMessage.hpp:168
DataQueue::hasWaiters
bool hasWaiters()
Definition: QueueManager.hpp:149
CLEAR_NAMED_QUEUE
Definition: ServiceMessage.hpp:121
QUERY_NAMED_QUEUE
Definition: ServiceMessage.hpp:123
DataQueue::waitForData
void waitForData()
Definition: QueueManager.hpp:144
SERVER_FAILURE
Definition: ServiceException.hpp:48
QUEUE_EMPTY
Definition: ServiceMessage.hpp:169
_RexxQueueTime
Definition: rexx.h:237
PULL_FROM_SESSION_QUEUE
Definition: ServiceMessage.hpp:119
Utilities.hpp
ADD_TO_NAMED_QUEUE
Definition: ServiceMessage.hpp:116
DataQueue::removeWaiter
void removeWaiter()
Definition: QueueManager.hpp:129
QueueItem::setTime
void setTime()
Definition: QueueManager.cpp:50
Utilities::strCaselessCompare
static int strCaselessCompare(const char *opt1, const char *opt2)
Definition: Utilities.cpp:82
ServerQueueManager::addToNamedQueue
void addToNamedQueue(ServiceMessage &message)
Definition: QueueManager.cpp:473
if
if(!yymsg) yymsg
CREATE_NAMED_QUEUE
Definition: ServiceMessage.hpp:111
ServiceMessage
Definition: ServiceMessage.hpp:282
ServerQueueManager::nestSessionQueue
void nestSessionQueue(ServiceMessage &message)
Definition: QueueManager.cpp:707
QUEUE_CREATED
Definition: ServiceMessage.hpp:170
ServerQueueManager::getSessionQueue
DataQueue * getSessionQueue(SessionID session)
Definition: QueueManager.cpp:532