(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.39 and 1.45

version 1.39, 2004/05/18 23:58:41 version 1.45, 2004/06/14 20:00:29
Line 33 
Line 33 
 //              Adrian Schuur, IBM (schuur@de.ibm.com) //              Adrian Schuur, IBM (schuur@de.ibm.com)
 //              Amit K Arora (amita@in.ibm.com) for PEP-101 //              Amit K Arora (amita@in.ibm.com) for PEP-101
 //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
   //              Seema Gupta (gseema@in.ibm.com for PEP135)
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 75 
Line 76 
 } }
  
 ProviderManagerService* ProviderManagerService::providerManagerService=NULL; ProviderManagerService* ProviderManagerService::providerManagerService=NULL;
 CIMRepository* ProviderManagerService::_repository=NULL;  
 Uint32 ProviderManagerService::_indicationServiceQueueId = PEG_NOT_FOUND; Uint32 ProviderManagerService::_indicationServiceQueueId = PEG_NOT_FOUND;
  
 ProviderManagerService::ProviderManagerService(void) ProviderManagerService::ProviderManagerService(void)
Line 93 
Line 93 
     _repository=repository;     _repository=repository;
  
     _providerRegistrationManager = providerRegistrationManager;     _providerRegistrationManager = providerRegistrationManager;
   
       _unloadIdleProvidersBusy = 0;
   
     _providerManagerRouter =     _providerManagerRouter =
         new BasicProviderManagerRouter(indicationCallback);         new BasicProviderManagerRouter(indicationCallback);
 } }
Line 283 
Line 286 
     Message * response = 0;     Message * response = 0;
  
     if ((dynamic_cast<CIMOperationRequestMessage*>(request) != 0) ||     if ((dynamic_cast<CIMOperationRequestMessage*>(request) != 0) ||
         (request->getType() == CIM_EXPORT_INDICATION_REQUEST_MESSAGE))          (request->getType() == CIM_EXPORT_INDICATION_REQUEST_MESSAGE) ||
           (request->getType() == CIM_INITIALIZE_PROVIDER_REQUEST_MESSAGE))
     {     {
         // Handle CIMOperationRequestMessage and          // Handle CIMOperationRequestMessage, CIMExportIndicationRequestMessage,
         // CIMExportIndicationRequestMessage          // and CIMInitializeProviderRequestMessage
   
           // Note: The provider ID container is added to the OperationContext
           // by the CIMOperationRequestDispatcher for all CIM operation
           // requests to providers, so it does not need to be added again.
  
         // Add provider information to OperationContext for the ProviderManager          // Get a ProviderIdContainer for ExportIndicationRequestMessage
           if (request->getType() == CIM_EXPORT_INDICATION_REQUEST_MESSAGE)
           {
         ProviderIdContainer pidc = _getProviderIdContainer(request);         ProviderIdContainer pidc = _getProviderIdContainer(request);
         request->operationContext.insert(pidc);         request->operationContext.insert(pidc);
           }
  
           //
           // Check if the target provider is disabled
           //
           Boolean moduleDisabled = false;
           ProviderIdContainer pidc =
               request->operationContext.get(ProviderIdContainer::NAME);
           const CIMInstance providerModule = pidc.getModule();
           Uint32 pos = providerModule.findProperty(CIMName("OperationalStatus"));
           PEGASUS_ASSERT(pos != PEG_NOT_FOUND);
           Array<Uint16> operationalStatus;
           providerModule.getProperty(pos).getValue().get(operationalStatus);
   
           for(Uint32 i = 0; i < operationalStatus.size(); i++)
           {
               if ((operationalStatus[i] == _MODULE_STOPPED) ||
                   (operationalStatus[i] == _MODULE_STOPPING))
               {
                   moduleDisabled = true;
                   break;
               }
           }
   
           if (moduleDisabled)
           {
               //
               // Send a "provider blocked" response
               //
               CIMResponseMessage* cimResponse = request->buildResponse();
               cimResponse->cimException = PEGASUS_CIM_EXCEPTION_L(
                   CIM_ERR_ACCESS_DENIED,
                   MessageLoaderParms(
                       "ProviderManager.ProviderManagerService.PROVIDER_BLOCKED",
                       "provider blocked."));
               response = cimResponse;
           }
           else
           {
               //
               // Forward the request to the appropriate ProviderManagerRouter
               //
         response = _providerManagerRouter->processMessage(request);         response = _providerManagerRouter->processMessage(request);
     }     }
       }
     else if (request->getType() == CIM_ENABLE_MODULE_REQUEST_MESSAGE)     else if (request->getType() == CIM_ENABLE_MODULE_REQUEST_MESSAGE)
     {     {
         // Handle CIMEnableModuleRequestMessage         // Handle CIMEnableModuleRequestMessage
Line 420 
Line 472 
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
  
 void ProviderManagerService::unload_idle_providers(void)  void ProviderManagerService::unloadIdleProviders()
   {
       PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
           "ProviderManagerService::unloadIdleProviders");
   
       // Ensure that only one _unloadIdleProvidersHandler thread runs at a time
       _unloadIdleProvidersBusy++;
       if ((_unloadIdleProvidersBusy.value() == 1) &&
           (_thread_pool->allocate_and_awaken(
                (void*)this, ProviderManagerService::_unloadIdleProvidersHandler)))
       {
           // _unloadIdleProvidersBusy is decremented in
           // _unloadIdleProvidersHandler
       }
       else
       {
           // If we fail to allocate a thread, don't retry now.
           _unloadIdleProvidersBusy--;
       }
   
       PEG_METHOD_EXIT();
   }
   
   PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL
   ProviderManagerService::_unloadIdleProvidersHandler(void* arg) throw()
   {
       try
       {
           PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
               "ProviderManagerService::unloadIdleProvidersHandler");
   
           ProviderManagerService* myself =
               reinterpret_cast<ProviderManagerService*>(arg);
   
           try
           {
               myself->_providerManagerRouter->unloadIdleProviders();
           }
           catch (...)
 { {
     _providerManagerRouter->unload_idle_providers();              // Ignore errors
               PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL2,
                   "Unexpected exception in _unloadIdleProvidersHandler");
           }
   
           myself->_unloadIdleProvidersBusy--;
           PEG_METHOD_EXIT();
       }
       catch (...)
       {
           // Ignore errors
           PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL2,
               "Unexpected exception in _unloadIdleProvidersHandler");
       }
   
       return(PEGASUS_THREAD_RETURN(0));
 } }
  
 ProviderIdContainer ProviderManagerService::_getProviderIdContainer( ProviderIdContainer ProviderManagerService::_getProviderIdContainer(
Line 592 
Line 697 
         // These messages are handled specially by the ProviderManagerService         // These messages are handled specially by the ProviderManagerService
         PEGASUS_ASSERT(0);         PEGASUS_ASSERT(0);
         break;         break;
   
       case CIM_INITIALIZE_PROVIDER_REQUEST_MESSAGE:
       {
           // Provider information is already in the message
           const CIMInitializeProviderRequestMessage* request =
               dynamic_cast<const CIMInitializeProviderRequestMessage*>(message);
   
           const ProviderIdContainer container =
               request->operationContext.get(ProviderIdContainer::NAME);
           providerModule = container.getModule();
           provider = container.getProvider();
           break;
       }
   
     }     }
  
     PEGASUS_ASSERT(!providerModule.isUninitialized());     PEGASUS_ASSERT(!providerModule.isUninitialized());


Legend:
Removed from v.1.39  
changed lines
  Added in v.1.45

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2