HP-RK API Review: Created a new ArrayInternal.h header file to hold the Pegasus inter...
[tpot/pegasus/.git] / src / Pegasus / HandlerService / IndicationHandlerService.h
1 //%/////////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
4 // The Open Group, Tivoli Systems
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to
8 // deal in the Software without restriction, including without limitation the
9 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 // sell copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 // 
13 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
14 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
15 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
16 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 //
22 //==============================================================================
23 //
24 // Author: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)
25 //
26 // Modified By:
27 //
28 //%/////////////////////////////////////////////////////////////////////////////
29
30
31 #ifndef Pegasus_IndicationHandlerService_h
32 #define Pegasus_IndicationHandlerService_h
33
34 #include <Pegasus/Common/Config.h>
35 #include <sys/types.h>
36 #if defined(PEGASUS_PLATFORM_WIN32_IX86_MSVC)
37 #else
38 #include <unistd.h>
39 #endif 
40 #include <iostream>
41 #include <stdio.h>
42 #include <string.h>
43
44 #include <Pegasus/Common/Config.h>
45 #include <Pegasus/Common/InternalException.h>
46 #include <Pegasus/Common/DQueue.h>
47 #include <Pegasus/Common/Thread.h>
48 #include <Pegasus/Common/ArrayInternal.h>
49 #include <Pegasus/Common/AsyncOpNode.h>
50 #include <Pegasus/Common/CimomMessage.h>
51 #include <Pegasus/Common/Cimom.h>
52 #include <Pegasus/Common/MessageQueueService.h>
53 #include <Pegasus/Common/CIMMessage.h>
54 #include <Pegasus/Common/XmlWriter.h>
55 #include <Pegasus/Handler/CIMHandler.h>
56 #include <Pegasus/Repository/CIMRepository.h>
57
58 #include "HandlerTable.h"
59
60 #include <Pegasus/HandlerService/Linkage.h>
61
62 PEGASUS_NAMESPACE_BEGIN
63
64 class PEGASUS_HANDLER_SERVICE_LINKAGE IndicationHandlerService 
65    : public MessageQueueService
66 {
67    public:
68     
69       typedef MessageQueueService Base;
70     
71       IndicationHandlerService(CIMRepository* repository);
72
73       IndicationHandlerService(void);
74
75       ~IndicationHandlerService(void) { } ;
76       
77       virtual void _handle_async_request(AsyncRequest *req);
78
79       virtual void handleEnqueue(Message *);
80
81       virtual void handleEnqueue(void);
82
83       static void _handleIndicationCallBack(AsyncOpNode *, 
84                                             MessageQueue *, 
85                                             void *);
86       
87       AtomicInt dienow;
88
89    protected:
90
91       void _handleIndication(const Message* message);
92
93       HandlerTable _handlerTable;
94
95       CIMHandler* _lookupHandlerForClass(const String& className);
96
97    private:
98       CIMRepository* _repository;
99 };
100
101 PEGASUS_NAMESPACE_END
102
103 #endif