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.1
|
44 mday 1.3 class message_module;
45
|
46 mday 1.1 class PEGASUS_COMMON_LINKAGE MessageQueueService : public MessageQueue
47 {
48 public:
49
50 typedef MessageQueue Base;
51
52 MessageQueueService(const char *name, Uint32 queueID, Uint32 capabilities, Uint32 mask) ;
53
54 virtual ~MessageQueueService(void);
55
56 virtual void handle_heartbeat_request(AsyncRequest *req);
57 virtual void handle_heartbeat_reply(AsyncReply *rep);
58
59 virtual void handle_AsyncIoctl(AsyncIoctl *req);
60 virtual void handle_CimServiceStart(CimServiceStart *req);
61 virtual void handle_CimServiceStop(CimServiceStop *req);
62 virtual void handle_CimServicePause(CimServicePause *req);
63 virtual void handle_CimServiceResume(CimServiceResume *req);
64
65 virtual void handle_AsyncOperationStart(AsyncOperationStart *req);
66 virtual void handle_AsyncOperationResult(AsyncOperationResult *req);
|
67 mday 1.4 virtual Boolean accept_async(AsyncOpNode *op);
|
68 mday 1.3 virtual Boolean messageOK(const Message *msg) ;
|
69 mday 1.1
|
70 mday 1.3 AsyncReply *SendWait(AsyncRequest *request);
|
71 mday 1.2
|
72 mday 1.3 void _completeAsyncResponse(AsyncRequest *request,
|
73 mday 1.1 AsyncReply *reply,
74 Uint32 state,
75 Uint32 flag);
76 Boolean register_service(String name, Uint32 capabilities, Uint32 mask);
77 Boolean update_service(Uint32 capabilities, Uint32 mask);
78 Boolean deregister_service(void);
|
79 mday 1.6 virtual void _shutdown_incoming_queue(void);
|
80 mday 1.1 void find_services(String name,
81 Uint32 capabilities,
82 Uint32 mask,
83 Array<Uint32> *results);
84 void enumerate_service(Uint32 queue, message_module *result);
85 Uint32 get_next_xid(void);
86 AsyncOpNode *get_op(void);
87 void return_op(AsyncOpNode *op);
88 Uint32 _capabilities;
89 Uint32 _mask;
90 AtomicInt _die;
91 protected:
|
92 mday 1.6
|
93 mday 1.4 virtual void _handle_incoming_operation(AsyncOpNode *operation);
|
94 mday 1.3 virtual void _handle_async_request(AsyncRequest *req);
95 virtual void _make_response(AsyncRequest *req, Uint32 code);
96 cimom *_meta_dispatcher;
|
97 mday 1.1
98 private:
|
99 mday 1.4 void handleEnqueue();
100 DQueue<AsyncOpNode> _pending;
|
101 mday 1.5 AsyncDQueue<AsyncOpNode> _incoming;
|
102 mday 1.3
103 static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL _req_proc(void *);
|
104 mday 1.6 AtomicInt _incoming_queue_shutdown;
105
|
106 mday 1.3 Thread _req_thread;
|
107 mday 1.1
108 struct timeval _default_op_timeout;
109
110 static AtomicInt _xid;
|
111 mday 1.6
|
112 mday 1.4
|
113 mday 1.3
114
|
115 mday 1.1 };
116
117 PEGASUS_NAMESPACE_END
118
119 #endif /* Pegasus_MessageQueue_Service_h */
120
121
|