1 martin 1.16 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.17 //
|
3 martin 1.16 // 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.17 //
|
10 martin 1.16 // 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.17 //
|
17 martin 1.16 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.17 //
|
20 martin 1.16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.17 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.16 // 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.17 //
|
28 martin 1.16 //////////////////////////////////////////////////////////////////////////
|
29 kumpf 1.1 //
30 //%////////////////////////////////////////////////////////////////////////////
31
32
33 #ifndef ShutdownProvider_h
34 #define ShutdownProvider_h
35
36 ///////////////////////////////////////////////////////////////////////////////
37 // Shutdown Provider
38 ///////////////////////////////////////////////////////////////////////////////
39
40 #include <Pegasus/Common/Config.h>
41 #include <Pegasus/Common/Tracer.h>
42
43 #include <Pegasus/Provider/CIMMethodProvider.h>
44 #include <Pegasus/Server/ShutdownService.h>
|
45 kumpf 1.4 #include <Pegasus/Server/Linkage.h>
|
46 kumpf 1.1
47 PEGASUS_NAMESPACE_BEGIN
48
49 /**
50 The ShutdownProvider is a method provider that implements the shutdown
51 method in the PG_ShutdownService class. It provides response to the
52 shutdown request from clients to shutdown cimom gracefully.
53 */
|
54 kumpf 1.14 class PEGASUS_SERVER_LINKAGE ShutdownProvider : public CIMMethodProvider
|
55 kumpf 1.1 {
56 public:
57
58 /** Constructor */
59 ShutdownProvider(CIMServer* cimserver)
60 {
61 PEG_METHOD_ENTER(TRC_SHUTDOWN, "ShutdownProvider::ShutdownProvider");
62
63 //
64 // get an instance of the Shutdown Service
65 //
66 _shutdownService = ShutdownService::getInstance(cimserver);
67
68 PEG_METHOD_EXIT();
69 }
70
71 /** Destructor */
72 virtual ~ShutdownProvider()
73 {
74 PEG_METHOD_ENTER(TRC_SHUTDOWN,"ShutdownProvider::~ShutdownProvider");
75 PEG_METHOD_EXIT();
76 kumpf 1.1 }
77
|
78 kumpf 1.15 // Note: The initialize() and terminate() methods are not called for
79 // Control Providers.
80 void initialize(CIMOMHandle& cimomHandle) { }
81 void terminate() { }
|
82 kumpf 1.1
83 /**
84 Invoke Method. Used to shutdown cimom.
85 */
86 void invokeMethod(
|
87 kumpf 1.14 const OperationContext& context,
88 const CIMObjectPath& objectReference,
89 const CIMName& methodName,
90 const Array<CIMParamValue>& inParameters,
91 MethodResultResponseHandler& handler);
|
92 kumpf 1.1
93 private:
94
95 //
96 // Shutdown Service Instance variable
97 //
|
98 kumpf 1.14 ShutdownService* _shutdownService;
|
99 kumpf 1.1 };
100
101 PEGASUS_NAMESPACE_END
102
103 #endif // ShutdownProvider_h
|