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

  1 mday  1.1 //%////-*-c++-*-////////////////////////////////////////////////////////////////
  2           //
  3           // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM
  4           //
  5           // Permission is hereby granted, free of charge, to any person obtaining a copy
  6           // of this software and associated documentation files (the "Software"), to
  7           // deal in the Software without restriction, including without limitation the
  8           // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9           // sell copies of the Software, and to permit persons to whom the Software is
 10           // furnished to do so, subject to the following conditions:
 11           //
 12           // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 13           // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 14           // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 15           // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 16           // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 17           // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 18           // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 19           // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 20           //
 21           //==============================================================================
 22 mday  1.1 //
 23           // Author: Mike Day (mdday@us.ibm.com)
 24           //
 25           // Modified By:
 26           //
 27           //%/////////////////////////////////////////////////////////////////////////////
 28           
 29           #ifndef Pegasus_MessageQueue_Service_h
 30           #define Pegasus_MessageQueue_Service_h
 31           
 32           #include <Pegasus/Common/Config.h>
 33           #include <Pegasus/Common/Message.h>
 34           #include <Pegasus/Common/Exception.h>
 35           #include <Pegasus/Common/IPC.h>
 36           #include <Pegasus/Common/Thread.h>
 37           #include <Pegasus/Common/AsyncOpNode.h>
 38           #include <Pegasus/Common/Cimom.h>
 39           #include <Pegasus/Common/CimomMessage.h>
 40           
 41           PEGASUS_NAMESPACE_BEGIN
 42           
 43 mday  1.10 extern const Uint32 CIMOM_Q_ID;
 44 mday  1.9  
 45 mday  1.3  class message_module;
 46            
 47 mday  1.1  class PEGASUS_COMMON_LINKAGE MessageQueueService : public MessageQueue
 48            {
 49               public:
 50            
 51                  typedef MessageQueue Base;
 52                  
 53 mday  1.10       MessageQueueService(const char *name, Uint32 queueID, 
 54            			  Uint32 capabilities = 0, 
 55            			  Uint32 mask = message_mask::type_cimom | 
 56            			  message_mask::type_service | 
 57            			  message_mask::ha_request | 
 58            			  message_mask::ha_reply | 
 59            			  message_mask::ha_async ) ;
 60 mday  1.1        
 61                  virtual ~MessageQueueService(void);
 62                  
 63                  virtual void handle_heartbeat_request(AsyncRequest *req);
 64                  virtual void handle_heartbeat_reply(AsyncReply *rep);
 65                  
 66                  virtual void handle_AsyncIoctl(AsyncIoctl *req);
 67                  virtual void handle_CimServiceStart(CimServiceStart *req);
 68                  virtual void handle_CimServiceStop(CimServiceStop *req);
 69                  virtual void handle_CimServicePause(CimServicePause *req);
 70                  virtual void handle_CimServiceResume(CimServiceResume *req);
 71                  
 72                  virtual void handle_AsyncOperationStart(AsyncOperationStart *req);
 73 mday  1.9        virtual void handle_AsyncOperationResult(AsyncOperationResult *rep);
 74                  virtual void handle_AsyncLegacyOperationStart(AsyncLegacyOperationStart *req);
 75                  virtual void handle_AsyncLegacyOperationResult(AsyncLegacyOperationResult *rep);
 76                  
 77 mday  1.10       virtual Boolean isAsync(void) {  return true;  }
 78                  
 79 mday  1.4        virtual Boolean accept_async(AsyncOpNode *op);
 80 mday  1.3        virtual Boolean messageOK(const Message *msg) ;
 81 mday  1.15       
 82                  virtual void enqueue(Message *) throw(IPCException);
 83                  
 84 mday  1.3        AsyncReply *SendWait(AsyncRequest *request);
 85 mday  1.14       Boolean SendAsync(AsyncOpNode *op, 
 86            			Uint32 destination,
 87            			void (*callback)(AsyncOpNode *, MessageQueue *, void *));
 88 mday  1.12       Boolean  SendForget(Message *msg);
 89            
 90 mday  1.3        void _completeAsyncResponse(AsyncRequest *request, 
 91 mday  1.1  				 AsyncReply *reply, 
 92            				 Uint32 state, 
 93            				 Uint32 flag);
 94                  Boolean register_service(String name, Uint32 capabilities, Uint32 mask);
 95                  Boolean update_service(Uint32 capabilities, Uint32 mask);
 96                  Boolean deregister_service(void);
 97 mday  1.6        virtual void _shutdown_incoming_queue(void);
 98 mday  1.1        void find_services(String name,
 99            			 Uint32 capabilities, 
100            			 Uint32 mask, 
101            			 Array<Uint32> *results);
102                  void enumerate_service(Uint32 queue, message_module *result);
103                  Uint32 get_next_xid(void);
104                  AsyncOpNode *get_op(void);
105                  void return_op(AsyncOpNode *op);
106 mday  1.15 
107 mday  1.1        Uint32 _mask;
108                  AtomicInt _die;
109               protected:
110 mday  1.12       virtual void handleEnqueue(void);
111                  virtual void handleEnqueue(Message *);
112 mday  1.11       virtual Boolean _enqueueResponse(Message *, Message *);
113 mday  1.7        virtual void _handle_incoming_operation(AsyncOpNode *operation, Thread *thread, MessageQueue *queue);
114 mday  1.3        virtual void _handle_async_request(AsyncRequest *req);
115 mday  1.15       virtual void _handle_async_callback(AsyncOpNode *operation);     
116 mday  1.12       virtual void _make_response(Message *req, Uint32 code);
117 mday  1.13       
118 mday  1.10       static cimom *_meta_dispatcher;
119                  static AtomicInt _service_count;
120                  static Mutex _meta_dispatcher_mutex;
121                  
122 mday  1.1  
123               private: 
124 mday  1.12       
125 mday  1.4        DQueue<AsyncOpNode> _pending;
126 mday  1.5        AsyncDQueue<AsyncOpNode> _incoming;
127 mday  1.3        
128                  static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL _req_proc(void *);
129 mday  1.6        AtomicInt _incoming_queue_shutdown;
130                  
131 mday  1.3        Thread _req_thread;
132 mday  1.1        
133                  struct timeval _default_op_timeout;
134            
135                  static AtomicInt _xid;
136 mday  1.6        
137 mday  1.4  
138 mday  1.3  
139            
140 mday  1.1  };
141            
142            PEGASUS_NAMESPACE_END
143            
144            #endif /* Pegasus_MessageQueue_Service_h */
145            
146            

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2