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 class PEGASUS_COMMON_LINKAGE MessageQueueService : public MessageQueue
45 {
46 public:
47
48 typedef MessageQueue Base;
49
50 MessageQueueService(const char *name, Uint32 queueID, Uint32 capabilities, Uint32 mask) ;
51
52 virtual ~MessageQueueService(void);
53
54 // don't allow derived classes to override
55 void handleEnqueue();
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 mday 1.1
65 virtual void handle_AsyncOperationStart(AsyncOperationStart *req);
66 virtual void handle_AsyncOperationResult(AsyncOperationResult *req);
67
68 // virtual Boolean accept_async(Message *message) throw(IPCException);
69 // virtual Boolean messageOK(const Message *msg) ;
70
71 // virtual Message *openEnvelope(Message *msg);
72
|
77 mday 1.1 void _enqueueAsyncResponse(AsyncRequest *request,
78 AsyncReply *reply,
79 Uint32 state,
80 Uint32 flag);
81 Boolean register_service(String name, Uint32 capabilities, Uint32 mask);
82 Boolean update_service(Uint32 capabilities, Uint32 mask);
83 Boolean deregister_service(void);
84
85 void find_services(String name,
86 Uint32 capabilities,
87 Uint32 mask,
88 Array<Uint32> *results);
89 void enumerate_service(Uint32 queue, message_module *result);
90 Uint32 get_next_xid(void);
91 AsyncOpNode *get_op(void);
92 void return_op(AsyncOpNode *op);
93 Uint32 _capabilities;
94 Uint32 _mask;
95 AtomicInt _die;
96 protected:
97
98 mday 1.1 // handle all your messages. call Base:_handle_async_msg to
99 // deal with messages you don't handle
100 virtual void _handle_async_msg(AsyncMessage *msg);
101
102
103 cimom *_meta_dispatcher;
104 private:
105
106
107 struct timeval _default_op_timeout;
108
109 static AtomicInt _xid;
110 void _handle_async_request(AsyncRequest *req);
111 void _handle_async_reply(AsyncReply *rep);
112 void _make_response(AsyncRequest *req, Uint32 code);
113 };
114
115 PEGASUS_NAMESPACE_END
116
117 #endif /* Pegasus_MessageQueue_Service_h */
118
119 mday 1.1
|