1 martin 1.36 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.37 //
|
3 martin 1.36 // 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.37 //
|
10 martin 1.36 // 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.37 //
|
17 martin 1.36 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.37 //
|
20 martin 1.36 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.37 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.36 // 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.37 //
|
28 martin 1.36 //////////////////////////////////////////////////////////////////////////
|
29 mday 1.1 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
|
32 kumpf 1.30 #ifndef Pegasus_Cimom_h
33 #define Pegasus_Cimom_h
|
34 mday 1.1
35 #include <Pegasus/Common/Config.h>
|
36 kumpf 1.16 #include <Pegasus/Common/InternalException.h>
|
37 mday 1.1 #include <Pegasus/Common/MessageQueue.h>
|
38 mike 1.25 #include <Pegasus/Common/AsyncQueue.h>
|
39 mday 1.1 #include <Pegasus/Common/Thread.h>
|
40 kumpf 1.17 #include <Pegasus/Common/ArrayInternal.h>
|
41 mday 1.1 #include <Pegasus/Common/AsyncOpNode.h>
42 #include <Pegasus/Common/CimomMessage.h>
|
43 mday 1.3 #include <Pegasus/Common/MessageQueueService.h>
|
44 mday 1.1 //#include <Pegasus/Server/CIMOperationRequestDispatcher.h>
45 //#include <Pegasus/Server/CIMOperationResponseEncoder.h>
46 //#include <Pegasus/Server/CIMOperationRequestDecoder.h>
|
47 kumpf 1.15 #include <Pegasus/Common/Linkage.h>
|
48 mike 1.25 #include <Pegasus/Common/List.h>
|
49 mike 1.28 #include <Pegasus/Common/Mutex.h>
50 #include <Pegasus/Common/Time.h>
|
51 venkat.puvvada 1.38 #include <Pegasus/Common/HashTable.h>
|
52 mday 1.1
53 PEGASUS_NAMESPACE_BEGIN
54
|
55 mday 1.10 class MessageQueueService;
56
|
57 mday 1.1 class PEGASUS_COMMON_LINKAGE cimom : public MessageQueue
58 {
|
59 kumpf 1.30 public:
60 cimom();
61 virtual ~cimom();
62
63 AsyncOpNode* get_cached_op();
64 void cache_op(AsyncOpNode* op);
|
65 venkat.puvvada 1.38
66 Boolean registerCIMService(MessageQueueService *service);
67 Boolean deregisterCIMService(MessageQueueService *service);
68
69 typedef HashTable <MessageQueueService*, Boolean, EqualFunc <void*>,
70 HashFunc <void*> > RegisteredServicesTable;
71
|
72 kumpf 1.30 protected:
73 static void _make_response(Message* req, Uint32 code);
74 static void _completeAsyncResponse(
75 AsyncRequest* request,
|
76 venkat.puvvada 1.33 AsyncReply* reply);
77 static void _complete_op_node(AsyncOpNode* op);
|
78 kumpf 1.30
79 private:
80 AsyncQueue<AsyncOpNode> _routed_ops;
81
82 static ThreadReturnType PEGASUS_THREAD_CDECL _routing_proc(void*);
83
84 Thread _routing_thread;
85
|
86 venkat.puvvada 1.34 void _handle_cimom_op(AsyncOpNode* op);
|
87 kumpf 1.30
88 virtual void handleEnqueue();
89
90 Boolean route_async(AsyncOpNode* operation);
91
|
92 venkat.puvvada 1.38 inline Boolean _monitorCIMService(MessageQueueService *service);
93 inline void _releaseCIMService(MessageQueueService *service);
94
|
95 kumpf 1.30 AtomicInt _die;
96 AtomicInt _routed_queue_shutdown;
|
97 david.dillard 1.22
|
98 kumpf 1.30 static cimom *_global_this;
|
99 mday 1.1
|
100 venkat.puvvada 1.38
101 static RegisteredServicesTable _registeredServicesTable;
102 static Mutex _registeredServicesTableLock;
103
|
104 kumpf 1.30 friend class MessageQueueService;
|
105 mday 1.1 };
106
107 PEGASUS_NAMESPACE_END
108
|
109 kumpf 1.30 #endif // Pegasus_Cimom_h
|