(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.57 and 1.61

version 1.57, 2004/07/30 17:25:39 version 1.61, 2005/01/20 22:05:19
Line 1 
Line 1 
 //%2003////////////////////////////////////////////////////////////////////////  //%2004////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development  // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.  // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.; // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
 // IBM Corp.; EMC Corporation, The Open Group. // IBM Corp.; EMC Corporation, The Open Group.
   // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
   // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 52 
Line 54 
  
 #include <Pegasus/ProviderManager2/BasicProviderManagerRouter.h> #include <Pegasus/ProviderManager2/BasicProviderManagerRouter.h>
 #include <Pegasus/ProviderManager2/OOPProviderManagerRouter.h> #include <Pegasus/ProviderManager2/OOPProviderManagerRouter.h>
   #include <Pegasus/ProviderManager2/OperationResponseHandler.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 97 
Line 100 
     // Determine whether Out-of-Process Provider support is enabled     // Determine whether Out-of-Process Provider support is enabled
     ConfigManager* configManager = ConfigManager::getInstance();     ConfigManager* configManager = ConfigManager::getInstance();
     if (String::equal(     if (String::equal(
         configManager->getCurrentValue("enableProviderProcesses"), "true"))          configManager->getCurrentValue("forceProviderProcesses"), "true"))
     {     {
         _providerManagerRouter =         _providerManagerRouter =
             new OOPProviderManagerRouter(indicationCallback);             new OOPProviderManagerRouter(indicationCallback);
Line 296 
Line 299 
     PEGASUS_ASSERT(async != 0);     PEGASUS_ASSERT(async != 0);
  
     Message * response = 0;     Message * response = 0;
       Boolean consumerLookupFailed = false;
     if ((dynamic_cast<CIMOperationRequestMessage*>(request) != 0) ||  
         (dynamic_cast<CIMIndicationRequestMessage*>(request) != 0) ||  
         (request->getType() == CIM_EXPORT_INDICATION_REQUEST_MESSAGE) ||  
         (request->getType() == CIM_INITIALIZE_PROVIDER_REQUEST_MESSAGE))  
     {  
         // Handle CIMOperationRequestMessage, CIMExportIndicationRequestMessage,  
         // CIMIndicationRequestMessage, and CIMInitializeProviderRequestMessage.  
         // (These should be blocked when the provider module is disabled.)  
   
         //  
         // Get the provider module instance to check for a disabled module  
         //  
         CIMInstance providerModule;  
  
         if (request->getType() == CIM_EXPORT_INDICATION_REQUEST_MESSAGE)         if (request->getType() == CIM_EXPORT_INDICATION_REQUEST_MESSAGE)
         {         {
           //
             // Get a ProviderIdContainer for ExportIndicationRequestMessage.             // Get a ProviderIdContainer for ExportIndicationRequestMessage.
             // Note: This can be removed when the CIMExportRequestDispatcher             // Note: This can be removed when the CIMExportRequestDispatcher
             // is updated to add the ProviderIdContainer to the message.             // is updated to add the ProviderIdContainer to the message.
           //
           CIMInstance providerModule;
             CIMInstance provider;             CIMInstance provider;
             const CIMExportIndicationRequestMessage* expRequest =             const CIMExportIndicationRequestMessage* expRequest =
                 dynamic_cast<const CIMExportIndicationRequestMessage*>(request);                 dynamic_cast<const CIMExportIndicationRequestMessage*>(request);
             _providerRegistrationManager->lookupIndicationConsumer(          if (_providerRegistrationManager->lookupIndicationConsumer(
                 expRequest->destinationPath, provider, providerModule);                  expRequest->destinationPath, provider, providerModule))
           {
             request->operationContext.insert(             request->operationContext.insert(
                 ProviderIdContainer(providerModule, provider));                 ProviderIdContainer(providerModule, provider));
         }         }
         else         else
         {         {
               consumerLookupFailed = true;
           }
       }
   
       if (consumerLookupFailed)
       {
           CIMResponseMessage* cimResponse = request->buildResponse();
           cimResponse->cimException = PEGASUS_CIM_EXCEPTION(
               CIM_ERR_NOT_SUPPORTED, String::EMPTY);
           response = cimResponse;
       }
       else if ((dynamic_cast<CIMOperationRequestMessage*>(request) != 0) ||
           (dynamic_cast<CIMIndicationRequestMessage*>(request) != 0) ||
           (request->getType() == CIM_EXPORT_INDICATION_REQUEST_MESSAGE) ||
           (request->getType() == CIM_INITIALIZE_PROVIDER_REQUEST_MESSAGE))
       {
           // Handle CIMOperationRequestMessage, CIMExportIndicationRequestMessage,
           // CIMIndicationRequestMessage, and CIMInitializeProviderRequestMessage.
           // (These should be blocked when the provider module is disabled.)
   
           //
           // Get the provider module instance to check for a disabled module
           //
           CIMInstance providerModule;
   
             // The provider ID container is added to the OperationContext             // The provider ID container is added to the OperationContext
             // by the CIMOperationRequestDispatcher for all CIM operation             // by the CIMOperationRequestDispatcher for all CIM operation
             // requests to providers, so it does not need to be added again.             // requests to providers, so it does not need to be added again.
Line 334 
Line 353 
             ProviderIdContainer pidc =             ProviderIdContainer pidc =
                 request->operationContext.get(ProviderIdContainer::NAME);                 request->operationContext.get(ProviderIdContainer::NAME);
             providerModule = pidc.getModule();             providerModule = pidc.getModule();
         }  
  
         //         //
         // Check if the target provider is disabled         // Check if the target provider is disabled
Line 505 
Line 523 
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
  
   void
   ProviderManagerService::handleCimResponse(CIMRequestMessage &request,
                                                                                                                                                                           CIMResponseMessage &response)
   {
           CIMStatusCode code = CIM_ERR_SUCCESS;
           String message;
   
           try
           {
                   // only incomplete messages are processed because the caller ends up
                   // sending the complete() stage
                   PEGASUS_ASSERT(response.isComplete() == false);
   
                   AsyncLegacyOperationStart *requestAsync =
                           dynamic_cast<AsyncLegacyOperationStart *>(request._async);
                   PEGASUS_ASSERT(requestAsync);
                   AsyncOpNode *op = requestAsync->op;
                   PEGASUS_ASSERT(op);
                   PEGASUS_ASSERT(! response._async);
                   response._async = new AsyncLegacyOperationResult
                           (requestAsync->getKey(), requestAsync->getRouting(), op, &response);
   
                   // set the destination
                   op->_op_dest = op->_callback_response_q;
   
                   MessageQueueService *service =
                           dynamic_cast<MessageQueueService *>(op->_callback_response_q);
   
                   PEGASUS_ASSERT(service);
   
                   // the last chunk MUST be sent last, so use execute the callback
                   // not all chunks are going through the dispatcher's chunk
                   // resequencer, so this must be a synchronous call here
                   // After the call is done, response and asyncResponse are now invalid
                   // as they have been sent and deleted externally
   
                   op->_async_callback(op, service, op->_callback_ptr);
           }
   
           catch(CIMException &e)
           {
                   code = e.getCode();
                   message = e.getMessage();
           }
           catch(Exception &e)
           {
                   code = CIM_ERR_FAILED;
                   message = e.getMessage();
           }
           catch(...)
           {
                   code = CIM_ERR_FAILED;
                   message = cimStatusCodeToString(code);
           }
   
           if (code !=  CIM_ERR_SUCCESS)
                   response.cimException = PEGASUS_CIM_EXCEPTION(code, message);
   }
   
 void ProviderManagerService::unloadIdleProviders() void ProviderManagerService::unloadIdleProviders()
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,


Legend:
Removed from v.1.57  
changed lines
  Added in v.1.61

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2