1 karl 1.12 //%2006////////////////////////////////////////////////////////////////////////
|
2 kumpf 1.1 //
|
3 karl 1.9 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 karl 1.8 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.9 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.10 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.12 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 kumpf 1.1 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
15 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
|
20 kumpf 1.3 //
|
21 kumpf 1.1 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
|
30 kumpf 1.3 //==============================================================================
|
31 kumpf 1.1 //
32 // Author: Jenny Yu, Hewlett-Packard Company (jenny_yu@hp.com)
33 //
34 // Modified By:
35 // Sushma Fernandes, Hewlett-Packard Company (sushma_fernandes@hp.com)
36 // Nag Boranna, Hewlett-Packard Company (nagaraja_boranna@hp.com)
37 //
38 //%////////////////////////////////////////////////////////////////////////////
39
40
41 #ifndef ShutdownProvider_h
42 #define ShutdownProvider_h
43
44 ///////////////////////////////////////////////////////////////////////////////
45 // Shutdown Provider
46 ///////////////////////////////////////////////////////////////////////////////
47
48 #include <Pegasus/Common/Config.h>
49 #include <Pegasus/Common/Tracer.h>
50
51 #include <Pegasus/Provider/CIMMethodProvider.h>
52 kumpf 1.1 #include <Pegasus/Server/ShutdownService.h>
|
53 kumpf 1.4 #include <Pegasus/Server/Linkage.h>
|
54 kumpf 1.1
55
56 PEGASUS_NAMESPACE_BEGIN
57
58 /**
59 The ShutdownProvider is a method provider that implements the shutdown
60 method in the PG_ShutdownService class. It provides response to the
61 shutdown request from clients to shutdown cimom gracefully.
62 */
63
64 class PEGASUS_SERVER_LINKAGE ShutdownProvider
65 : public CIMMethodProvider
66 {
67 public:
68
69 /** Constructor */
70 ShutdownProvider(CIMServer* cimserver)
71 {
72 PEG_METHOD_ENTER(TRC_SHUTDOWN, "ShutdownProvider::ShutdownProvider");
73
74 //
75 kumpf 1.1 // get an instance of the Shutdown Service
76 //
77 _shutdownService = ShutdownService::getInstance(cimserver);
78
79 PEG_METHOD_EXIT();
80 }
81
82 /** Destructor */
83 virtual ~ShutdownProvider()
84 {
85 PEG_METHOD_ENTER(TRC_SHUTDOWN,"ShutdownProvider::~ShutdownProvider");
86 PEG_METHOD_EXIT();
87 }
88
89 void terminate(void)
90 {
91 PEG_METHOD_ENTER(TRC_SHUTDOWN,"ShutdownProvider::terminate");
|
92 konrad.r 1.11 delete this;
|
93 kumpf 1.1 PEG_METHOD_EXIT();
94 }
95
96 /**
97 Invoke Method. Used to shutdown cimom.
98 */
99 void invokeMethod(
100 const OperationContext & context,
|
101 kumpf 1.2 const CIMObjectPath & objectReference,
|
102 kumpf 1.5 const CIMName & methodName,
|
103 kumpf 1.1 const Array<CIMParamValue> & inParameters,
|
104 kumpf 1.6 MethodResultResponseHandler & handler);
|
105 kumpf 1.1
106 /**
107 Standard initialization function for the provider.
108 */
109 void initialize(CIMOMHandle& cimomHandle)
110 {
111 // This method should never be called, since this is an internal
112 // control provider
113 }
114
115 private:
116
117 //
118 // Shutdown Service Instance variable
119 //
120 ShutdownService* _shutdownService;
121 };
122
123 PEGASUS_NAMESPACE_END
124
125 #endif // ShutdownProvider_h
|