9 kumpf 1.1 //
10 // Permission is hereby granted, free of charge, to any person obtaining a copy
11 // of this software and associated documentation files (the "Software"), to
12 // deal in the Software without restriction, including without limitation the
13 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
14 // sell copies of the Software, and to permit persons to whom the Software is
15 // furnished to do so, subject to the following conditions:
16 //
17 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
18 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
19 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
20 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
21 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 //
26 //==============================================================================
27 //
28 // Author: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
29 //
30 kumpf 1.1 // Modified By:
31 //
32 //%/////////////////////////////////////////////////////////////////////////////
33
34
35 #include <Pegasus/Common/IPC.h>
36 #include <Pegasus/Common/Thread.h>
37 #include <Pegasus/Common/Tracer.h>
38
39 #include "ClientCIMOMHandleRep.h"
40
41 PEGASUS_NAMESPACE_BEGIN
42
43 // chuck 2.4
44 // l10n start
45 static void deleteContentLanguage(void* data)
46 {
47 if (data != NULL)
48 {
49 ContentLanguages* cl = static_cast<ContentLanguages*>(data);
50 delete cl;
51 kumpf 1.1 }
52 }
53 // l10n end
54
55
56 /**
57 This class is used to prevent concurrent access to a non-reentrant
58 CIMClient object.
59 */
60 class ClientCIMOMHandleAccessController
61 {
62 public:
63 ClientCIMOMHandleAccessController(Mutex& lock)
64 : _lock(lock)
65 {
66 try
67 {
68 _lock.try_lock(pegasus_thread_self());
69 }
70 catch (AlreadyLocked &)
71 {
72 kumpf 1.1 PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
73 "AlreadyLocked Exception, throwing CIMException");
74 throw CIMException(CIM_ERR_ACCESS_DENIED, MessageLoaderParms(
75 "Provider.CIMOMHandle.RECURSIVE_USE_CIMOMHANDLE",
76 "Recursive Use of CIMOMHandle Attempted"));
77 }
78 catch (Exception& e)
79 {
80 PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
81 String("Unexpected Exception: ") + e.getMessage());
82 throw;
83 }
84 catch (...)
85 {
86 PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
87 "Unexpected exception");
88 throw;
89 }
90 }
91
92 ~ClientCIMOMHandleAccessController()
93 kumpf 1.1 {
94 // Must not throw an exception from a destructor
95 try
96 {
97 _lock.unlock();
98 }
99 catch (Exception& e)
100 {
101 PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
102 String("Ignoring Exception: ") + e.getMessage());
103 }
104 catch (...)
105 {
106 PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
107 "Ignoring unknown exception");
108 }
109 }
110
111 private:
112 // Unimplemented constructors and assignment operator
113 ClientCIMOMHandleAccessController();
114 kumpf 1.1 ClientCIMOMHandleAccessController(const ClientCIMOMHandleAccessController&);
115 ClientCIMOMHandleAccessController& operator=(
116 const ClientCIMOMHandleAccessController&);
117
118 Mutex& _lock;
119 };
120
121
122 /**
123 The ClientCIMOMHandleSetup class encapsulates the logic to set up the
124 CIMClient object state based on a specified OperationContext. The
125 original CIMClient state is restored by the destructor. Only one
126 ClientCIMOMHandleSetup object may operate on a given CIMClient object
127 at a time. Use of the ClientCIMOMHandleAccessController class is
128 recommend to control access to CIMClient objects.
129 */
130 class ClientCIMOMHandleSetup
131 {
132 public:
133 ClientCIMOMHandleSetup(
134 CIMClient*& client,
135 kumpf 1.1 const OperationContext& context)
136 {
137 //
138 // Initialize the CIMClient object if necessary
139 //
140 if (client == 0)
141 {
142 PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
143 "Creating CIMClient connection");
144 client = new CIMClient();
145 client->connectLocal();
146 }
147 _client = client;
148
149 //
150 // If the caller specified a timeout value in the OperationContext,
151 // set it in the CIMClient object.
152 //
153 _origTimeout = client->getTimeout();
154 try
155 {
156 kumpf 1.1 TimeoutContainer t_cntr = (TimeoutContainer)
157 context.get(TimeoutContainer::NAME);
158 client->setTimeout(t_cntr.getTimeOut());
159 }
160 catch (...)
161 {
162 // No TimeoutContainer in OperationContext; just use the default
163 }
164
165 //
166 // If the caller specified an Accept-Language in the
167 // OperationContext, set it in the CIMClient object.
168 //
169 _origAcceptLanguages = client->getRequestAcceptLanguages();
170 try
171 {
172 AcceptLanguageListContainer al_cntr = (AcceptLanguageListContainer)
173 context.get(AcceptLanguageListContainer::NAME);
174 _client->setRequestAcceptLanguages(al_cntr.getLanguages());
175 }
176 catch (Exception &)
177 kumpf 1.1 {
178 // No AcceptLanguageListContainer in OperationContext; try
179 // getting the AcceptLanguages from the current thread
180 AcceptLanguages* al = Thread::getLanguages();
181 if (al != NULL)
182 {
183 _client->setRequestAcceptLanguages(*al);
184 }
185 }
186
187 //
188 // If the caller specified a Content-Language in the
189 // OperationContext, set it in the CIMClient object.
190 //
191 _origContentLanguages = client->getRequestContentLanguages();
192 try
193 {
194 ContentLanguageListContainer cl_cntr =
195 (ContentLanguageListContainer)context.get(
196 ContentLanguageListContainer::NAME);
197 _client->setRequestContentLanguages(cl_cntr.getLanguages());
198 kumpf 1.1 }
199 catch (Exception &)
200 {
201 // No ContentLanguageListContainer in OperationContext; just
202 // use the default
203 }
204 }
205
206 ~ClientCIMOMHandleSetup()
207 {
208 // Must not throw an exception from a destructor
209 try
210 {
211 //
212 // If the response has a Content-Language then save it into
213 // thread-specific storage
214 //
215 if (_client->getResponseContentLanguages().size() > 0)
216 {
217 Thread* curThrd = Thread::getCurrent();
218 if (curThrd != NULL)
219 kumpf 1.1 {
220 // deletes the old tsd and creates a new one
221 curThrd->put_tsd("cimomHandleContentLanguages",
222 deleteContentLanguage,
223 sizeof(ContentLanguages*),
224 new ContentLanguages(
225 _client->getResponseContentLanguages()));
226 }
227 }
228
229 //
230 // Reset CIMClient timeout value and languages to original values
231 //
232 _client->setTimeout(_origTimeout);
233 _client->setRequestAcceptLanguages(_origAcceptLanguages);
234 _client->setRequestContentLanguages(_origContentLanguages);
235 }
236 catch (Exception& e)
237 {
238 PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
239 String("Ignoring Exception: ") + e.getMessage());
240 kumpf 1.1 }
241 catch (...)
242 {
243 PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
244 "Ignoring unknown exception");
245 }
246 }
247
248 private:
249 // Unimplemented constructors and assignment operator
250 ClientCIMOMHandleSetup();
251 ClientCIMOMHandleSetup(const ClientCIMOMHandleSetup&);
252 ClientCIMOMHandleSetup& operator=(const ClientCIMOMHandleSetup&);
253
254 CIMClient* _client;
255 Uint32 _origTimeout;
256 AcceptLanguages _origAcceptLanguages;
257 ContentLanguages _origContentLanguages;
258 };
259
260
261 kumpf 1.1 //
262 // ClientCIMOMHandleRep
263 //
264
265 ClientCIMOMHandleRep::ClientCIMOMHandleRep()
266 : _client(0)
267 {
268 }
269
270 ClientCIMOMHandleRep::~ClientCIMOMHandleRep()
271 {
272 if (_client != 0)
273 {
|
284 kumpf 1.1 delete _client;
285 }
286 }
287
288 // Private, unimplemented copy constructor
289 ClientCIMOMHandleRep::ClientCIMOMHandleRep(const ClientCIMOMHandleRep& rep)
290 {
291 PEGASUS_ASSERT(0);
292 }
293
294 // Private, unimplemented assignment operator
295 ClientCIMOMHandleRep& ClientCIMOMHandleRep::operator=(
296 const ClientCIMOMHandleRep& rep)
297 {
298 PEGASUS_ASSERT(0);
299 return *this;
300 }
301
302
303 //
304 // CIM Operations
305 kumpf 1.1 //
306
307 CIMClass ClientCIMOMHandleRep::getClass(
308 const OperationContext & context,
309 const CIMNamespaceName& nameSpace,
310 const CIMName& className,
311 Boolean localOnly,
312 Boolean includeQualifiers,
313 Boolean includeClassOrigin,
314 const CIMPropertyList& propertyList)
315 {
316 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::getClass");
317
318 CIMOMHandleOpSemaphore opsem(this);
319 ClientCIMOMHandleAccessController access(_clientMutex);
320 ClientCIMOMHandleSetup setup(_client, context);
321
322 PEG_METHOD_EXIT();
323 return _client->getClass(
324 nameSpace,
325 className,
326 kumpf 1.1 localOnly,
327 includeQualifiers,
328 includeClassOrigin,
329 propertyList);
330 }
331
332 Array<CIMClass> ClientCIMOMHandleRep::enumerateClasses(
333 const OperationContext & context,
334 const CIMNamespaceName& nameSpace,
335 const CIMName& className,
336 Boolean deepInheritance,
337 Boolean localOnly,
338 Boolean includeQualifiers,
339 Boolean includeClassOrigin)
340 {
341 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
342 "ClientCIMOMHandleRep::enumerateClasses");
343
344 CIMOMHandleOpSemaphore opsem(this);
345 ClientCIMOMHandleAccessController access(_clientMutex);
346 ClientCIMOMHandleSetup setup(_client, context);
347 kumpf 1.1
348 PEG_METHOD_EXIT();
349 return _client->enumerateClasses(
350 nameSpace,
351 className,
352 deepInheritance,
353 localOnly,
354 includeQualifiers,
355 includeClassOrigin);
356 }
357
358 Array<CIMName> ClientCIMOMHandleRep::enumerateClassNames(
359 const OperationContext & context,
360 const CIMNamespaceName &nameSpace,
361 const CIMName& className,
362 Boolean deepInheritance)
363 {
364 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
365 "ClientCIMOMHandleRep::enumerateClassNames");
366
367 CIMOMHandleOpSemaphore opsem(this);
368 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
369 ClientCIMOMHandleSetup setup(_client, context);
370
371 PEG_METHOD_EXIT();
372 return _client->enumerateClassNames(
373 nameSpace,
374 className,
375 deepInheritance);
376 }
377
378 void ClientCIMOMHandleRep::createClass(
379 const OperationContext & context,
380 const CIMNamespaceName& nameSpace,
381 const CIMClass& newClass)
382 {
383 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::createClass");
384
385 CIMOMHandleOpSemaphore opsem(this);
386 ClientCIMOMHandleAccessController access(_clientMutex);
387 ClientCIMOMHandleSetup setup(_client, context);
388
389 kumpf 1.1 _client->createClass(
390 nameSpace,
391 newClass);
392
393 PEG_METHOD_EXIT();
394 }
395
396 void ClientCIMOMHandleRep::modifyClass(
397 const OperationContext & context,
398 const CIMNamespaceName &nameSpace,
399 const CIMClass& modifiedClass)
400 {
401 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::modifyClass");
402
403 CIMOMHandleOpSemaphore opsem(this);
404 ClientCIMOMHandleAccessController access(_clientMutex);
405 ClientCIMOMHandleSetup setup(_client, context);
406
407 _client->modifyClass(
408 nameSpace,
409 modifiedClass);
410 kumpf 1.1
411 PEG_METHOD_EXIT();
412 }
413
414 void ClientCIMOMHandleRep::deleteClass(
415 const OperationContext & context,
416 const CIMNamespaceName &nameSpace,
417 const CIMName& className)
418 {
419
420 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::deleteClass");
421
422 CIMOMHandleOpSemaphore opsem(this);
423 ClientCIMOMHandleAccessController access(_clientMutex);
424 ClientCIMOMHandleSetup setup(_client, context);
425
426 _client->deleteClass(
427 nameSpace,
428 className);
429
430 PEG_METHOD_EXIT();
431 kumpf 1.1 }
432
433 CIMInstance ClientCIMOMHandleRep::getInstance(
434 const OperationContext & context,
435 const CIMNamespaceName &nameSpace,
436 const CIMObjectPath& instanceName,
437 Boolean localOnly,
438 Boolean includeQualifiers,
439 Boolean includeClassOrigin,
440 const CIMPropertyList& propertyList)
441 {
442 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::getInstance");
443
444 CIMOMHandleOpSemaphore opsem(this);
445 ClientCIMOMHandleAccessController access(_clientMutex);
446 ClientCIMOMHandleSetup setup(_client, context);
447
448 PEG_METHOD_EXIT();
449 return _client->getInstance(
450 nameSpace,
451 instanceName,
452 kumpf 1.1 localOnly,
453 includeQualifiers,
454 includeClassOrigin,
455 propertyList);
456 }
457
458 Array<CIMInstance> ClientCIMOMHandleRep::enumerateInstances(
459 const OperationContext & context,
460 const CIMNamespaceName &nameSpace,
461 const CIMName& className,
462 Boolean deepInheritance,
463 Boolean localOnly,
464 Boolean includeQualifiers,
465 Boolean includeClassOrigin,
466 const CIMPropertyList& propertyList)
467 {
468 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
469 "ClientCIMOMHandleRep::enumerateInstances");
470
471 CIMOMHandleOpSemaphore opsem(this);
472 ClientCIMOMHandleAccessController access(_clientMutex);
473 kumpf 1.1 ClientCIMOMHandleSetup setup(_client, context);
474
475 PEG_METHOD_EXIT();
476 return _client->enumerateInstances(
477 nameSpace,
478 className,
479 deepInheritance,
480 localOnly,
481 includeQualifiers,
482 includeClassOrigin,
483 propertyList);
484 }
485
486 Array<CIMObjectPath> ClientCIMOMHandleRep::enumerateInstanceNames(
487 const OperationContext & context,
488 const CIMNamespaceName &nameSpace,
489 const CIMName& className)
490 {
491 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
492 "ClientCIMOMHandleRep::enumerateInstanceNames");
493
494 kumpf 1.1 CIMOMHandleOpSemaphore opsem(this);
495 ClientCIMOMHandleAccessController access(_clientMutex);
496 ClientCIMOMHandleSetup setup(_client, context);
497
498 PEG_METHOD_EXIT();
499 return _client->enumerateInstanceNames(
500 nameSpace,
501 className);
502 }
503
504 CIMObjectPath ClientCIMOMHandleRep::createInstance(
505 const OperationContext & context,
506 const CIMNamespaceName &nameSpace,
507 const CIMInstance& newInstance)
508 {
509 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
510 "ClientCIMOMHandleRep::createInstance");
511
512 CIMOMHandleOpSemaphore opsem(this);
513 ClientCIMOMHandleAccessController access(_clientMutex);
514 ClientCIMOMHandleSetup setup(_client, context);
515 kumpf 1.1
516 PEG_METHOD_EXIT();
517 return _client->createInstance(
518 nameSpace,
519 newInstance);
520 }
521
522 void ClientCIMOMHandleRep::modifyInstance(
523 const OperationContext & context,
524 const CIMNamespaceName &nameSpace,
525 const CIMInstance& modifiedInstance,
526 Boolean includeQualifiers,
527 const CIMPropertyList& propertyList)
528 {
529 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
530 "ClientCIMOMHandleRep::modifyInstance");
531
532 CIMOMHandleOpSemaphore opsem(this);
533 ClientCIMOMHandleAccessController access(_clientMutex);
534 ClientCIMOMHandleSetup setup(_client, context);
535
536 kumpf 1.1 _client->modifyInstance(
537 nameSpace,
538 modifiedInstance,
539 includeQualifiers,
540 propertyList);
541
542 PEG_METHOD_EXIT();
543 }
544
545 void ClientCIMOMHandleRep::deleteInstance(
546 const OperationContext & context,
547 const CIMNamespaceName &nameSpace,
548 const CIMObjectPath& instanceName)
549 {
550 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
551 "ClientCIMOMHandleRep::deleteInstance");
552
553 CIMOMHandleOpSemaphore opsem(this);
554 ClientCIMOMHandleAccessController access(_clientMutex);
555 ClientCIMOMHandleSetup setup(_client, context);
556
557 kumpf 1.1 _client->deleteInstance(
558 nameSpace,
559 instanceName);
560
561 PEG_METHOD_EXIT();
562 }
563
564 Array<CIMObject> ClientCIMOMHandleRep::execQuery(
565 const OperationContext & context,
566 const CIMNamespaceName &nameSpace,
567 const String& queryLanguage,
568 const String& query)
569 {
570 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::execQuery");
571
572 CIMOMHandleOpSemaphore opsem(this);
573 ClientCIMOMHandleAccessController access(_clientMutex);
574 ClientCIMOMHandleSetup setup(_client, context);
575
576 PEG_METHOD_EXIT();
577 return _client->execQuery(
578 kumpf 1.1 nameSpace,
579 queryLanguage,
580 query);
581 }
582
583 Array<CIMObject> ClientCIMOMHandleRep::associators(
584 const OperationContext & context,
585 const CIMNamespaceName &nameSpace,
586 const CIMObjectPath& objectName,
587 const CIMName& assocClass,
588 const CIMName& resultClass,
589 const String& role,
590 const String& resultRole,
591 Boolean includeQualifiers,
592 Boolean includeClassOrigin,
593 const CIMPropertyList& propertyList)
594 {
595 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::associators");
596
597 CIMOMHandleOpSemaphore opsem(this);
598 ClientCIMOMHandleAccessController access(_clientMutex);
599 kumpf 1.1 ClientCIMOMHandleSetup setup(_client, context);
600
601 PEG_METHOD_EXIT();
602 return _client->associators(
603 nameSpace,
604 objectName,
605 assocClass,
606 resultClass,
607 role,
608 resultRole,
609 includeQualifiers,
610 includeClassOrigin,
611 propertyList);
612 }
613
614 Array<CIMObjectPath> ClientCIMOMHandleRep::associatorNames(
615 const OperationContext & context,
616 const CIMNamespaceName &nameSpace,
617 const CIMObjectPath& objectName,
618 const CIMName& assocClass,
619 const CIMName& resultClass,
620 kumpf 1.1 const String& role,
621 const String& resultRole)
622 {
623 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
624 "ClientCIMOMHandleRep::associatorNames");
625
626 CIMOMHandleOpSemaphore opsem(this);
627 ClientCIMOMHandleAccessController access(_clientMutex);
628 ClientCIMOMHandleSetup setup(_client, context);
629
630 PEG_METHOD_EXIT();
631 return _client->associatorNames(
632 nameSpace,
633 objectName,
634 assocClass,
635 resultClass,
636 role,
637 resultRole);
638 }
639
640 Array<CIMObject> ClientCIMOMHandleRep::references(
641 kumpf 1.1 const OperationContext & context,
642 const CIMNamespaceName &nameSpace,
643 const CIMObjectPath& objectName,
644 const CIMName& resultClass,
645 const String& role,
646 Boolean includeQualifiers,
647 Boolean includeClassOrigin,
648 const CIMPropertyList& propertyList)
649 {
650 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::references");
651
652 CIMOMHandleOpSemaphore opsem(this);
653 ClientCIMOMHandleAccessController access(_clientMutex);
654 ClientCIMOMHandleSetup setup(_client, context);
655
656 PEG_METHOD_EXIT();
657 return _client->references(
658 nameSpace,
659 objectName,
660 resultClass,
661 role,
662 kumpf 1.1 includeQualifiers,
663 includeClassOrigin,
664 propertyList);
665 }
666
667 Array<CIMObjectPath> ClientCIMOMHandleRep::referenceNames(
668 const OperationContext & context,
669 const CIMNamespaceName &nameSpace,
670 const CIMObjectPath& objectName,
671 const CIMName& resultClass,
672 const String& role)
673 {
674 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
675 "ClientCIMOMHandleRep::referenceNames");
676
677 CIMOMHandleOpSemaphore opsem(this);
678 ClientCIMOMHandleAccessController access(_clientMutex);
679 ClientCIMOMHandleSetup setup(_client, context);
680
681 PEG_METHOD_EXIT();
682 return _client->referenceNames(
683 kumpf 1.1 nameSpace,
684 objectName,
685 resultClass,
686 role);
687 }
688
689 CIMValue ClientCIMOMHandleRep::getProperty(
690 const OperationContext & context,
691 const CIMNamespaceName &nameSpace,
692 const CIMObjectPath& instanceName,
693 const CIMName& propertyName)
694 {
695 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::getProperty");
696
697 CIMOMHandleOpSemaphore opsem(this);
698 ClientCIMOMHandleAccessController access(_clientMutex);
699 ClientCIMOMHandleSetup setup(_client, context);
700
701 PEG_METHOD_EXIT();
702 return _client->getProperty(
703 nameSpace,
704 kumpf 1.1 instanceName,
705 propertyName);
706 }
707
708 void ClientCIMOMHandleRep::setProperty(
709 const OperationContext & context,
710 const CIMNamespaceName &nameSpace,
711 const CIMObjectPath& instanceName,
712 const CIMName& propertyName,
713 const CIMValue& newValue)
714 {
715 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::setProperty");
716
717 CIMOMHandleOpSemaphore opsem(this);
718 ClientCIMOMHandleAccessController access(_clientMutex);
719 ClientCIMOMHandleSetup setup(_client, context);
720
721 _client->setProperty(
722 nameSpace,
723 instanceName,
724 propertyName,
725 kumpf 1.1 newValue);
726
727 PEG_METHOD_EXIT();
728 }
729
730 CIMValue ClientCIMOMHandleRep::invokeMethod(
731 const OperationContext & context,
732 const CIMNamespaceName &nameSpace,
733 const CIMObjectPath& instanceName,
734 const CIMName& methodName,
735 const Array<CIMParamValue>& inParameters,
736 Array<CIMParamValue>& outParameters)
737 {
738 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::invokeMethod");
739
740 CIMOMHandleOpSemaphore opsem(this);
741 ClientCIMOMHandleAccessController access(_clientMutex);
742 ClientCIMOMHandleSetup setup(_client, context);
743
744 PEG_METHOD_EXIT();
745 return _client->invokeMethod(
746 kumpf 1.1 nameSpace,
747 instanceName,
748 methodName,
749 inParameters,
750 outParameters);
751 }
752
753
754 //
755 // Other public methods
756 //
757
758 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
759 OperationContext ClientCIMOMHandleRep::getResponseContext()
760 {
761 OperationContext ctx;
762
763 Thread* curThrd = Thread::getCurrent();
764 if (curThrd == NULL)
765 {
766 ctx.insert(ContentLanguageListContainer(ContentLanguages::EMPTY));
767 kumpf 1.1 }
768 else
769 {
770 ContentLanguages* contentLangs = (ContentLanguages*)
771 curThrd->reference_tsd("cimomHandleContentLanguages");
772 curThrd->dereference_tsd();
773
774 if (contentLangs == NULL)
775 {
776 ctx.insert(ContentLanguageListContainer(ContentLanguages::EMPTY));
777 }
778 else
779 {
780 ctx.insert(ContentLanguageListContainer(*contentLangs));
781 // delete the old tsd to free the memory
782 curThrd->delete_tsd("cimomHandleContentLanguages");
783 }
784 }
785
786 return ctx;
787 }
788 kumpf 1.1 #endif
789
790 PEGASUS_NAMESPACE_END
|