1 //%/////////////////////////////////////////////////////////////////////////////
3 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
4 // The Open Group, Tivoli Systems
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:
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.
22 //==============================================================================
24 // Author: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)
28 //%/////////////////////////////////////////////////////////////////////////////
30 #ifndef Pegasus_Listener_h
31 #define Pegasus_Listener_h
33 #include <Pegasus/Common/Config.h>
34 #include <Pegasus/Common/Exception.h>
35 #include <Pegasus/Listener/Linkage.h>
37 PEGASUS_NAMESPACE_BEGIN
42 class CIMExportRequestDispatcher;
43 class CIMExportResponseEncoder;
44 class CIMExportRequestDecoder;
47 class PEGASUS_LISTENER_LINKAGE CIMListener
51 enum Protocol { PROPRIETARY, STANDARD };
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 @param monitor monitor object for the server.
58 @param rootPath Directory path to the repository.
63 const String& rootPath,
65 Boolean staticConsumers,
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.
75 void bind(Uint32 port);
77 /** runForever Main runloop for the server.
81 /** Call to gracefully shutdown the server. The server connection socket
82 will be closed to disable new connections from clients.
84 void stopClientConnection();
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.
92 /** Return true if the server has shutdown, false otherwise.
94 Boolean terminated() { return _dieNow; };
96 /** Call to resume the sever.
100 Uint32 getOutstandingRequestCount();
102 CIMExportRequestDispatcher* getDispatcher();
109 String _repositoryRootPath;
112 Boolean _staticConsumers;
113 Boolean _persistence;
117 CIMExportRequestDispatcher* _cimExportRequestDispatcher;
118 CIMExportResponseEncoder* _cimExportResponseEncoder;
119 CIMExportRequestDecoder* _cimExportRequestDecoder;
121 HTTPAcceptor* _acceptor;
124 PEGASUS_NAMESPACE_END
126 #endif /* Pegasus_Listener_h */