(file) Return to ProviderManagerService.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ProviderManager2 / Attic

Diff for /pegasus/src/Pegasus/ProviderManager2/Attic/ProviderManagerService.cpp between version 1.81 and 1.90

version 1.81, 2006/06/19 20:47:39 version 1.90, 2006/08/09 21:13:00
Line 55 
Line 55 
 #include <Pegasus/Common/Tracer.h> #include <Pegasus/Common/Tracer.h>
 #include <Pegasus/Common/Logger.h> #include <Pegasus/Common/Logger.h>
 #include <Pegasus/Common/AutoPtr.h> #include <Pegasus/Common/AutoPtr.h>
   #include <Pegasus/Common/Constants.h>
  
 #include <Pegasus/Config/ConfigManager.h> #include <Pegasus/Config/ConfigManager.h>
  
Line 85 
Line 86 
 ProviderManagerService* ProviderManagerService::providerManagerService=NULL; ProviderManagerService* ProviderManagerService::providerManagerService=NULL;
 Uint32 ProviderManagerService::_indicationServiceQueueId = PEG_NOT_FOUND; Uint32 ProviderManagerService::_indicationServiceQueueId = PEG_NOT_FOUND;
  
 ProviderManagerService::ProviderManagerService(void)  
     : MessageQueueService(PEGASUS_QUEUENAME_PROVIDERMANAGER_CPP)  
 {  
     providerManagerService=this;  
 }  
   
 ProviderManagerService::ProviderManagerService( ProviderManagerService::ProviderManagerService(
         ProviderRegistrationManager * providerRegistrationManager,         ProviderRegistrationManager * providerRegistrationManager,
         CIMRepository * repository,         CIMRepository * repository,
Line 109 
Line 104 
  
     // Determine which ProviderManagerRouter(s) to use     // Determine which ProviderManagerRouter(s) to use
  
     ConfigManager* configManager = ConfigManager::getInstance();      _forceProviderProcesses = ConfigManager::parseBooleanValue(
     Boolean forceProviderProcesses = String::equal(          ConfigManager::getInstance()->getCurrentValue(
         configManager->getCurrentValue("forceProviderProcesses"), "true");              "forceProviderProcesses"));
  
 #ifdef PEGASUS_DISABLE_PROV_USERCTXT #ifdef PEGASUS_DISABLE_PROV_USERCTXT
     if (forceProviderProcesses)      if (_forceProviderProcesses)
     {     {
         _oopProviderManagerRouter = new OOPProviderManagerRouter(         _oopProviderManagerRouter = new OOPProviderManagerRouter(
             indicationCallback, responseChunkCallback,             indicationCallback, responseChunkCallback,
Line 131 
Line 126 
         indicationCallback, responseChunkCallback,         indicationCallback, responseChunkCallback,
         providerModuleFailureCallback);         providerModuleFailureCallback);
  
     if (!forceProviderProcesses)      if (!_forceProviderProcesses)
     {     {
         _basicProviderManagerRouter = new BasicProviderManagerRouter(         _basicProviderManagerRouter = new BasicProviderManagerRouter(
             indicationCallback, responseChunkCallback);              indicationCallback, responseChunkCallback,
               createDefaultProviderManagerCallback);
     }     }
 #endif #endif
 } }
Line 178 
Line 174 
     else     else
     {     {
         asyncRequest = new AsyncLegacyOperationStart(         asyncRequest = new AsyncLegacyOperationStart(
             get_next_xid(),  
             0,             0,
             this->getQueueId(),             this->getQueueId(),
             message,             message,
Line 199 
Line 194 
     {     {
         request->op->processing();         request->op->processing();
  
         _incomingQueue.enqueue(request->op);          _incomingQueue.insert_back(request->op);
         ThreadStatus rtn = PEGASUS_THREAD_OK;         ThreadStatus rtn = PEGASUS_THREAD_OK;
         while (( rtn =_thread_pool->allocate_and_awaken(         while (( rtn =_thread_pool->allocate_and_awaken(
                      (void *)this, ProviderManagerService::handleCimOperation)) != PEGASUS_THREAD_OK)                      (void *)this, ProviderManagerService::handleCimOperation)) != PEGASUS_THREAD_OK)
         {         {
             if (rtn==PEGASUS_THREAD_INSUFFICIENT_RESOURCES)             if (rtn==PEGASUS_THREAD_INSUFFICIENT_RESOURCES)
                 pegasus_yield();                  Threads::yield();
             else             else
             {             {
                 Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,                 Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
Line 231 
Line 226 
  
 // Note: This method should not throw an exception.  It is used as a thread // Note: This method should not throw an exception.  It is used as a thread
 // entry point, and any exceptions thrown are ignored. // entry point, and any exceptions thrown are ignored.
 PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL  ThreadReturnType PEGASUS_THREAD_CDECL
 ProviderManagerService::handleCimOperation(void* arg) ProviderManagerService::handleCimOperation(void* arg)
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
Line 253 
Line 248 
                     "op node in queue");                     "op node in queue");
  
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return(PEGASUS_THREAD_RETURN(1));              return(ThreadReturnType(1));
         }         }
  
         AsyncOpNode* op = service->_incomingQueue.dequeue();          AsyncOpNode* op = service->_incomingQueue.remove_front();
           PEGASUS_ASSERT(op != 0);
         if ((op == 0) || (op->_request.count() == 0))          PEGASUS_ASSERT(op->_request.get() != 0);
         {  
             // ATTN: This may dereference a null pointer!  
             MessageQueue* queue = MessageQueue::lookup(op->_source_queue);  
   
             PEGASUS_ASSERT(queue != 0);  
   
             PEG_METHOD_EXIT();  
   
             // no request in op node  
             return(PEGASUS_THREAD_RETURN(1));  
         }  
  
         AsyncRequest* request =         AsyncRequest* request =
             static_cast<AsyncRequest*>(op->_request.next(0));              static_cast<AsyncRequest*>(op->_request.get());
  
         if ((request == 0) ||         if ((request == 0) ||
             (request->getType() != async_messages::ASYNC_LEGACY_OP_START))             (request->getType() != async_messages::ASYNC_LEGACY_OP_START))
         {         {
             // reply with NAK             // reply with NAK
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return(PEGASUS_THREAD_RETURN(0));              return(ThreadReturnType(0));
         }         }
  
         Message* legacy =         Message* legacy =
Line 322 
Line 306 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
     return(PEGASUS_THREAD_RETURN(0));      return(ThreadReturnType(0));
 } }
  
 void ProviderManagerService::handleCimRequest( void ProviderManagerService::handleCimRequest(
Line 336 
Line 320 
     PEGASUS_ASSERT(request != 0);     PEGASUS_ASSERT(request != 0);
  
     // get request from op node     // get request from op node
     AsyncRequest * async = static_cast<AsyncRequest *>(op->_request.next(0));      AsyncRequest * async = static_cast<AsyncRequest *>(op->_request.get());
     PEGASUS_ASSERT(async != 0);     PEGASUS_ASSERT(async != 0);
  
     Message * response = 0;     Message * response = 0;
Line 585 
Line 569 
  
     AsyncLegacyOperationResult * async_result =     AsyncLegacyOperationResult * async_result =
         new AsyncLegacyOperationResult(         new AsyncLegacyOperationResult(
         async->getKey(),  
         async->getRouting(),  
         op,         op,
         response);         response);
  
Line 615 
Line 597 
         PEGASUS_ASSERT(op);         PEGASUS_ASSERT(op);
         PEGASUS_ASSERT(!response->_async);         PEGASUS_ASSERT(!response->_async);
         response->_async = new AsyncLegacyOperationResult(         response->_async = new AsyncLegacyOperationResult(
             requestAsync->getKey(), requestAsync->getRouting(), op, response);              op, response);
  
         // set the destination         // set the destination
         op->_op_dest = op->_callback_response_q;         op->_op_dest = op->_callback_response_q;
Line 693 
Line 675 
             ProviderIdContainer pidc =             ProviderIdContainer pidc =
                 request->operationContext.get(ProviderIdContainer::NAME);                 request->operationContext.get(ProviderIdContainer::NAME);
             providerModule = pidc.getModule();             providerModule = pidc.getModule();
   #ifdef PEGASUS_ZOS_SECURITY
               if (request->getType() != CIM_EXPORT_INDICATION_REQUEST_MESSAGE)
               {
                   // this is a z/OS only function
                   // the function checks user authorization
                   // based on CIM operation versus provider profile
                   // Input: request and Provider ID Container
                   //Return: failure: a response message for the client
                   //        success: NULL
                   response = checkSAFProviderProfile(request, pidc);
                   if (response != NULL)
                   {
                       return response;
                   }
               }
   #endif
         }         }
  
         Uint16 userContext = PEGASUS_DEFAULT_PROV_USERCTXT;         Uint16 userContext = PEGASUS_DEFAULT_PROV_USERCTXT;
Line 706 
Line 704 
         // Forward the request to the appropriate ProviderManagerRouter, based         // Forward the request to the appropriate ProviderManagerRouter, based
         // on the CIM Server configuration and the UserContext setting.         // on the CIM Server configuration and the UserContext setting.
  
         ConfigManager* configManager = ConfigManager::getInstance();          if (_forceProviderProcesses
         Boolean forceProviderProcesses = String::equal(  
             configManager->getCurrentValue("forceProviderProcesses"), "true");  
   
         if (forceProviderProcesses  
 #ifndef PEGASUS_DISABLE_PROV_USERCTXT #ifndef PEGASUS_DISABLE_PROV_USERCTXT
             || (userContext == PG_PROVMODULE_USERCTXT_REQUESTOR)             || (userContext == PG_PROVMODULE_USERCTXT_REQUESTOR)
             || (userContext == PG_PROVMODULE_USERCTXT_DESIGNATED)             || (userContext == PG_PROVMODULE_USERCTXT_DESIGNATED)
Line 761 
Line 755 
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
  
 PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL  ThreadReturnType PEGASUS_THREAD_CDECL
 ProviderManagerService::_unloadIdleProvidersHandler(void* arg) throw() ProviderManagerService::_unloadIdleProvidersHandler(void* arg) throw()
 { {
     try     try
Line 812 
Line 806 
             "Unexpected exception in _unloadIdleProvidersHandler");             "Unexpected exception in _unloadIdleProvidersHandler");
     }     }
  
     return(PEGASUS_THREAD_RETURN(0));      return(ThreadReturnType(0));
 } }
  
 // Updates the providerModule instance and the ProviderRegistrationManager // Updates the providerModule instance and the ProviderRegistrationManager
Line 864 
Line 858 
 void ProviderManagerService::indicationCallback( void ProviderManagerService::indicationCallback(
     CIMProcessIndicationRequestMessage* request)     CIMProcessIndicationRequestMessage* request)
 { {
     try      if(request->operationContext.contains(AcceptLanguageListContainer::NAME))
     {     {
         AcceptLanguageListContainer cntr = request->operationContext.get(AcceptLanguageListContainer::NAME);         AcceptLanguageListContainer cntr = request->operationContext.get(AcceptLanguageListContainer::NAME);
     }catch(const Exception &)      }
       else
     {     {
         request->operationContext.insert(AcceptLanguageListContainer(AcceptLanguageList()));         request->operationContext.insert(AcceptLanguageListContainer(AcceptLanguageList()));
     }     }
Line 888 
Line 883 
  
     AsyncLegacyOperationStart * asyncRequest =     AsyncLegacyOperationStart * asyncRequest =
         new AsyncLegacyOperationStart(         new AsyncLegacyOperationStart(
         providerManagerService->get_next_xid(),  
         0,         0,
         _indicationServiceQueueId,         _indicationServiceQueueId,
         request,         request,
Line 940 
Line 934 
  
         while (((MessageQueueService *)indicationsQueue)->getIncomingCount() > INDICATIONS_Q_RESUME_THRESHOLD)         while (((MessageQueueService *)indicationsQueue)->getIncomingCount() > INDICATIONS_Q_RESUME_THRESHOLD)
         {         {
             pegasus_sleep(INDICATIONS_Q_STALL_DURATION);              Threads::sleep(INDICATIONS_Q_STALL_DURATION);
         }         }
  
         AutoMutex indicationThresholdReportedAutoMutex1(indicationThresholdReportedLock);         AutoMutex indicationThresholdReportedAutoMutex1(indicationThresholdReportedLock);
         //        indicationThresholdReportedLock.lock(pegasus_thread_self());          //        indicationThresholdReportedLock.lock();
         if(indicationThresholdReported)         if(indicationThresholdReported)
         {         {
             indicationThresholdReported = false;             indicationThresholdReported = false;
Line 1019 
Line 1013 
     request->queueIds = QueueIdStack     request->queueIds = QueueIdStack
         (_indicationServiceQueueId, providerManagerService->getQueueId ());         (_indicationServiceQueueId, providerManagerService->getQueueId ());
  
     AsyncLegacyOperationStart * asyncRequest = new AsyncLegacyOperationStart      AsyncLegacyOperationStart * asyncRequest = new AsyncLegacyOperationStart(
         (providerManagerService->get_next_xid (),  
         0,         0,
         _indicationServiceQueueId,         _indicationServiceQueueId,
         request,         request,


Legend:
Removed from v.1.81  
changed lines
  Added in v.1.90

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2