(file) Return to ShutdownService.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Server

Diff for /pegasus/src/Pegasus/Server/ShutdownService.cpp between version 1.11 and 1.12

version 1.11, 2002/06/01 00:57:36 version 1.12, 2002/06/04 01:42:40
Line 43 
Line 43 
 #include <Pegasus/Common/CIMMessage.h> #include <Pegasus/Common/CIMMessage.h>
 #include <Pegasus/Common/MessageQueueService.h> #include <Pegasus/Common/MessageQueueService.h>
 #include <Pegasus/Common/IPC.h> #include <Pegasus/Common/IPC.h>
 #include <Pegasus/Common/Logger.h>  #include <Pegasus/Common/Tracer.h>
  
 PEGASUS_USING_STD; PEGASUS_USING_STD;
  
Line 111 
Line 111 
 */ */
 void ShutdownService::shutdown(Boolean force, Uint32 timeout) void ShutdownService::shutdown(Boolean force, Uint32 timeout)
 { {
       PEG_METHOD_ENTER(TRC_REPOSITORY, "ShutdownService::shutdown");
   
     //     //
     // Initialize variables     // Initialize variables
     //     //
     Boolean timeoutExpired = false;     Boolean timeoutExpired = false;
     Boolean noMoreRequests = false;     Boolean noMoreRequests = false;
  
       _shutdownTimeout = timeout;
   
     try     try
     {     {
         //         //
Line 130 
Line 134 
         _cimserver->stopClientConnection();         _cimserver->stopClientConnection();
  
         //         //
         // get shutdown timeout values  
         //  
         _initTimeoutValues(timeout);  
   
         //  
         // Determine if there are any outstanding CIM operation requests         // Determine if there are any outstanding CIM operation requests
         // (take into account that one of the request is the shutdown request).         // (take into account that one of the request is the shutdown request).
         //         //
Line 156 
Line 155 
     }     }
     catch(CIMException & e)     catch(CIMException & e)
     {     {
         Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,          PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
             "Error occured during CIMServer shutdown: $0.",              "Error occurred during CIMServer shutdown: " + e.getMessage());
             e.getMessage());  
     }     }
     catch(Exception & e)     catch(Exception & e)
     {     {
         Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,          PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
             "Error occured during CIMServer shutdown: $0.",              "Error occurred during CIMServer shutdown: " + e.getMessage());
             e.getMessage());  
     }     }
  
     catch(...)     catch(...)
     {     {
         Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,          PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
             "Unexpected error occured during CIMServer shutdown. ");             "Unexpected error occured during CIMServer shutdown. ");
     }     }
  
   
     //     //
     // All done     // All done
     //     //
       PEG_METHOD_EXIT();
     return;     return;
 } }
  
Line 196 
Line 193 
 /*  private methods                                       */ /*  private methods                                       */
 /**********************************************************/ /**********************************************************/
  
 void ShutdownService::_initTimeoutValues(Uint32 timeout)  
 {  
     //  
     // get an instance of the ConfigManager  
     //  
     ConfigManager*  configManager;  
     configManager = ConfigManager::getInstance();  
   
     //  
     // if timeout was not specified, get timeout value from ConfigManager  
     //  
     if (timeout > 0)  
     {  
         _shutdownTimeout = timeout;  
     }  
     else  
     {  
         String configTimeout =  
             configManager->getCurrentValue(SHUTDOWN_TIMEOUT_PROPERTY);  
         ArrayDestroyer<char> timeoutCString(configTimeout.allocateCString());  
         _shutdownTimeout = strtol(timeoutCString.getPointer(), (char **)0,10);  
     }  
   
     return;  
 }  
   
 void ShutdownService::_shutdownCIMServer() void ShutdownService::_shutdownCIMServer()
 { {
       PEG_METHOD_ENTER(TRC_REPOSITORY, "ShutdownService::_shutdownCIMServer");
   
     //     //
     // Shutdown the providers     // Shutdown the providers
     //     //
Line 239 
Line 212 
     //     //
     _cimserver->shutdown();     _cimserver->shutdown();
  
       PEG_METHOD_EXIT();
     return;     return;
 } }
  
 void ShutdownService::_shutdownCimomServices() void ShutdownService::_shutdownCimomServices()
 { {
       PEG_METHOD_ENTER(TRC_REPOSITORY, "ShutdownService::_shutdownCimomServices");
   
     //     //
     // Shutdown the Indication Service     // Shutdown the Indication Service
     //     //
Line 282 
Line 258 
     //     //
     _sendShutdownRequestToService(PEGASUS_QUEUENAME_EXPORTREQDISPATCHER);     _sendShutdownRequestToService(PEGASUS_QUEUENAME_EXPORTREQDISPATCHER);
  
       PEG_METHOD_EXIT();
     return;     return;
 } }
  
Line 319 
Line 296 
                                                         _queueId,                                                         _queueId,
                                                         stopRequest);                                                         stopRequest);
  
     // JYU  
     //delete stopRequest;     //delete stopRequest;
  
 // ATTN-YZ-P2-05032002: Temporarily removed, until asyn_callback fixed  
 /*  
     //  
     // create callback data structure  
     //  
     callback_data *cb_data = new callback_data(this);  
   
     //  
     // Now send Stop request to service  
     //  
     if (false  == _controller->ClientSendAsync(*_client_handle,  
                                                0,  
                                                _queueId,  
                                                stopRequest,  
                                                ShutdownService::async_callback,  
                                                (void *)cb_data) )  
     {  
         delete cb_data;  
         throw CIMException(CIM_ERR_NOT_FOUND);  
     }  
   
     cb_data->client_sem.wait();  
     AsyncReply * asyncReply = static_cast<AsyncReply *>(cb_data->get_reply()) ;  
   
     //  
     // check result  
     //  
     if (asyncReply != NULL)  
     {  
         if (asyncReply->result == async_results::CIM_STOPPED)  
         {  
             Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,  
                 "Service $0 $1", serviceName, "stopped.");  
         }  
         else  
         {  
             Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,  
                 "Failed to stop service $0.", serviceName);  
         }  
     }  
   
     delete stopRequest;  
     delete asyncReply;  
     delete cb_data;  
 */  
   
     return;     return;
 } }
  
 void ShutdownService::_shutdownProviders() void ShutdownService::_shutdownProviders()
 { {
       PEG_METHOD_ENTER(TRC_REPOSITORY, "ShutdownService::_shutdownProviders");
   
     //     //
     // get provider manager service     // get provider manager service
     //     //
Line 380 
Line 312 
         MessageQueue::lookup(PEGASUS_QUEUENAME_PROVIDERMANAGER_CPP);         MessageQueue::lookup(PEGASUS_QUEUENAME_PROVIDERMANAGER_CPP);
  
     if (queue == 0)     if (queue == 0)
       {
           PEG_METHOD_EXIT();
         return;         return;
       }
  
     MessageQueueService * _service = dynamic_cast<MessageQueueService *>(queue);     MessageQueueService * _service = dynamic_cast<MessageQueueService *>(queue);
     Uint32 _queueId = _service->getQueueId();     Uint32 _queueId = _service->getQueueId();
Line 420 
Line 355 
         delete asyncRequest;         delete asyncRequest;
         delete asyncReply;         delete asyncReply;
         delete response;         delete response;
           PEG_METHOD_EXIT();
         throw (e);         throw (e);
     }     }
  
Line 428 
Line 364 
     delete asyncReply;     delete asyncReply;
     delete response;     delete response;
  
 // ATTN-JY-P2-05162002: Comment out, until asyn_callback is fixed      PEG_METHOD_EXIT();
 /*  
     //  
     // create callback data structure  
     //  
     callback_data *cb_data = new callback_data(this);  
   
     if (false  == _controller->ClientSendAsync(*_client_handle,  
                                                0,  
                                                _queueId,  
                                                asyncRequest,  
                                                ShutdownService::async_callback,  
                                                (void *)cb_data) )  
     {  
         delete stopRequest;  
         delete asyncRequest;  
         delete cb_data;  
         throw CIMException(CIM_ERR_NOT_FOUND);  
     }  
   
     cb_data->client_sem.wait();  
     AsyncReply * asyncReply = static_cast<AsyncReply *>(cb_data->get_reply()) ;  
   
     //  
     // check result  
     //  
     if (asyncReply != NULL)  
     {  
         if (asyncReply->result == async_results::OK)  
         {  
             Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,  
                 "Providers terminated successfully.");  
         }  
         else  
         {  
             Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,  
                 "Error occured while terminating providers.");  
         }  
   
     }  
   
     //delete stopRequest;  
     delete asyncRequest;  
     delete asyncReply;  
     delete cb_data;  
 */  
   
     return;     return;
 } }
  


Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2