(file) Return to MessageQueueService.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

  1 martin 1.70 //%LICENSE////////////////////////////////////////////////////////////////
  2 martin 1.71 //
  3 martin 1.70 // Licensed to The Open Group (TOG) under one or more contributor license
  4             // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
  5             // this work for additional information regarding copyright ownership.
  6             // Each contributor licenses this file to you under the OpenPegasus Open
  7             // Source License; you may not use this file except in compliance with the
  8             // License.
  9 martin 1.71 //
 10 martin 1.70 // Permission is hereby granted, free of charge, to any person obtaining a
 11             // copy of this software and associated documentation files (the "Software"),
 12             // to deal in the Software without restriction, including without limitation
 13             // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 14             // and/or sell copies of the Software, and to permit persons to whom the
 15             // Software is furnished to do so, subject to the following conditions:
 16 martin 1.71 //
 17 martin 1.70 // The above copyright notice and this permission notice shall be included
 18             // in all copies or substantial portions of the Software.
 19 martin 1.71 //
 20 martin 1.70 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21 martin 1.71 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 22 martin 1.70 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 23             // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 24             // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 25             // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 26             // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27 martin 1.71 //
 28 martin 1.70 //////////////////////////////////////////////////////////////////////////
 29 mday   1.1  //
 30             //%/////////////////////////////////////////////////////////////////////////////
 31             
 32             #ifndef Pegasus_MessageQueue_Service_h
 33             #define Pegasus_MessageQueue_Service_h
 34             
 35             #include <Pegasus/Common/Config.h>
 36             #include <Pegasus/Common/Message.h>
 37 kumpf  1.34 #include <Pegasus/Common/InternalException.h>
 38 mday   1.1  #include <Pegasus/Common/Thread.h>
 39 mike   1.54 #include <Pegasus/Common/ThreadPool.h>
 40 mday   1.1  #include <Pegasus/Common/AsyncOpNode.h>
 41             #include <Pegasus/Common/Cimom.h>
 42 mike   1.51 #include <Pegasus/Common/Mutex.h>
 43 mday   1.1  #include <Pegasus/Common/CimomMessage.h>
 44 kumpf  1.33 #include <Pegasus/Common/Linkage.h>
 45 mike   1.54 #include <Pegasus/Common/Mutex.h>
 46 mday   1.1  
 47             PEGASUS_NAMESPACE_BEGIN
 48             
 49 mday   1.3  class message_module;
 50 marek  1.56 class cimom;
 51 mday   1.3  
 52 mike   1.51 
 53 kumpf  1.59 class PEGASUS_COMMON_LINKAGE MessageQueueService :
 54 venkat.puvvada 1.75     public Linkable, public MessageQueue
 55 mday           1.1  {
 56 david.dillard  1.45 public:
 57                     
 58                         typedef MessageQueue Base;
 59 mday           1.1  
 60 kumpf          1.55     MessageQueueService(
 61 sahana.prabhakar 1.78         const char* name);
 62 david.dillard    1.45 
 63                           virtual ~MessageQueueService();
 64                       
 65                           virtual Boolean isAsync() const {  return true;  }
 66                       
 67                           virtual void enqueue(Message *);
 68                       
 69 venkat.puvvada   1.79     static AsyncReply* SendWait(AsyncRequest* request);
 70 kumpf            1.59     Boolean SendAsync(AsyncOpNode* op,
 71                               Uint32 destination,
 72                               void (*callback)(AsyncOpNode*, MessageQueue*, void*),
 73                               MessageQueue* callback_q,
 74                               void* callback_ptr);
 75 david.dillard    1.45 
 76 venkat.puvvada   1.79     static Boolean SendForget(Message* msg);
 77 david.dillard    1.45 
 78                           Boolean update_service(Uint32 capabilities, Uint32 mask);
 79                           Boolean deregister_service();
 80                       
 81 karl             1.79.6.1     static Uint32 find_service_qid(const char* name);
 82 kumpf            1.59         static AsyncOpNode* get_op();
 83 venkat.puvvada   1.79         static void return_op(AsyncOpNode* op);
 84 david.dillard    1.45     
 85 kumpf            1.59         static ThreadPool* get_thread_pool();
 86 david.dillard    1.45     
 87 venkat.puvvada   1.75         AtomicInt _die;
 88 kumpf            1.59         AtomicInt _threads;
 89                               Uint32 getIncomingCount() {return _incoming.count(); }
 90 david.dillard    1.45     
 91                           protected:
 92 kumpf            1.59         virtual Boolean accept_async(AsyncOpNode* op);
 93 david.dillard    1.45         virtual void handleEnqueue() = 0;
 94                               virtual void handleEnqueue(Message *) = 0;
 95                               Boolean _enqueueResponse(Message *, Message *);
 96                               virtual void _handle_incoming_operation(AsyncOpNode *);
 97                           
 98 kumpf            1.59         virtual void _handle_async_request(AsyncRequest* req);
 99                               virtual void _handle_async_callback(AsyncOpNode* operation);
100                               virtual void _make_response(Message* req, Uint32 code);
101                           
102 venkat.puvvada   1.69         virtual void handle_AsyncIoClose(AsyncIoClose* req);
103 kumpf            1.59         virtual void handle_CimServiceStart(CimServiceStart* req);
104                               virtual void handle_CimServiceStop(CimServiceStop* req);
105                           
106                               void _completeAsyncResponse(
107                                   AsyncRequest* request,
108 venkat.puvvada   1.67             AsyncReply* reply);
109                               void _complete_op_node(AsyncOpNode *);
110 david.dillard    1.45     
111 kumpf            1.59         static cimom* _meta_dispatcher;
112 venkat.puvvada   1.75         static AtomicInt _service_count;
113 venkat.puvvada   1.73         static Mutex _meta_dispatcher_mutex;
114 kumpf            1.59         static ThreadPool* _thread_pool;
115 venkat.puvvada   1.66         Boolean _isRunning;
116 david.dillard    1.45     private:
117 venkat.puvvada   1.79         static Boolean _sendAsync(AsyncOpNode* op,
118 venkat.puvvada   1.65             Uint32 destination,
119                                   void (*callback)(AsyncOpNode*, MessageQueue*, void*),
120                                   MessageQueue* callback_q,
121                                   void* callback_ptr,
122                                   Uint32 flags);
123                           
124 venkat.puvvada   1.75         void _removeFromPollingList(MessageQueueService *service);
125                           
126 kumpf            1.57         static ThreadReturnType PEGASUS_THREAD_CDECL polling_routine(void *);
127                           
128 mike             1.51         AsyncQueue<AsyncOpNode> _incoming;
129 david.dillard    1.45         static Thread* _polling_thread;
130                               static Semaphore _polling_sem;
131                               static AtomicInt _stop_polling;
132                           
133 venkat.puvvada   1.75         typedef List<MessageQueueService, NullLock> PollingList;
134 mike             1.51         static PollingList* _polling_list;
135 venkat.puvvada   1.75         static Mutex _polling_list_mutex;
136 david.dillard    1.45     
137 mike             1.54         static ThreadReturnType PEGASUS_THREAD_CDECL _req_proc(void *);
138 david.dillard    1.45     
139                               AtomicInt _incoming_queue_shutdown;
140                           
141                               friend class cimom;
142 mday             1.1      };
143                           
144                           PEGASUS_NAMESPACE_END
145                           
146                           #endif /* Pegasus_MessageQueue_Service_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2