1 kumpf 1.1 //%/////////////////////////////////////////////////////////////////////////////
2 //
|
3 kumpf 1.2 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
|
4 kumpf 1.1 // 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 kumpf 1.2 //
|
13 kumpf 1.1 // 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 #ifndef Pegasus_Listener_h
31 #define Pegasus_Listener_h
32
33 #include <Pegasus/Common/Config.h>
34 kumpf 1.1 #include <Pegasus/Common/Exception.h>
|
35 chuck 1.3 #include <Pegasus/Listener/Linkage.h>
|
36 kumpf 1.1
37 PEGASUS_NAMESPACE_BEGIN
38
39 struct ListenerRep;
40
41 class Monitor;
42 class CIMExportRequestDispatcher;
43 class CIMExportResponseEncoder;
44 class CIMExportRequestDecoder;
45 class HTTPAcceptor;
46
47 class PEGASUS_LISTENER_LINKAGE CIMListener
48 {
49 public:
50
51 enum Protocol { PROPRIETARY, STANDARD };
52
53 /** Constructor - Creates a CIMListener object.
54 The CIM Listener objects establishes a repository object,
55 a dispatcher object, and creates a channnel factory and
56 acceptor for the Listener.
57 kumpf 1.1 @param monitor monitor object for the server.
58 @param rootPath Directory path to the repository.
59 */
60
61 CIMListener(
62 Monitor* monitor,
63 const String& rootPath,
64 Boolean dynamicReg,
65 Boolean staticConsumers,
66 Boolean persistence);
67
68 ~CIMListener();
69
70 /** bind Binds the port address to the Listener.
71 @param address char* to the port address for TCP.
72 @exception - This function may receive exceptions from
73 Channel specific subfunctions.
74 */
75 void bind(Uint32 port);
76
77 /** runForever Main runloop for the server.
78 kumpf 1.1 */
79 void runForever();
80
81 /** Call to gracefully shutdown the server. The server connection socket
82 will be closed to disable new connections from clients.
83 */
84 void stopClientConnection();
85
86 /** Call to gracefully shutdown the server. It is called when the server
87 has been stopped and is ready to be shutdown. Next time runForever()
88 is called, the server shuts down.
89 */
90 void shutdown();
91
92 /** Return true if the server has shutdown, false otherwise.
93 */
94 Boolean terminated() { return _dieNow; };
95
96 /** Call to resume the sever.
97 */
98 void resume();
99 kumpf 1.1
100 Uint32 getOutstandingRequestCount();
101
102 private:
103
104 Boolean _dieNow;
105
106 String _rootPath;
107 String _repositoryRootPath;
108
109 Boolean _dynamicReg;
110 Boolean _staticConsumers;
111 Boolean _persistence;
112
113 Monitor* _monitor;
114
115 CIMExportRequestDispatcher* _cimExportRequestDispatcher;
116 CIMExportResponseEncoder* _cimExportResponseEncoder;
117 CIMExportRequestDecoder* _cimExportRequestDecoder;
118
119 HTTPAcceptor* _acceptor;
120 kumpf 1.1 };
121
122 PEGASUS_NAMESPACE_END
123
124 #endif /* Pegasus_Listener_h */
|