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

Diff for /pegasus/src/Pegasus/ProviderManager2/CMPI/CMPIProvider.cpp between version 1.4.6.4 and 1.5

version 1.4.6.4, 2004/04/19 16:03:33 version 1.5, 2004/01/27 13:48:11
Line 26 
Line 26 
 // Modified By: Yi Zhou, Hewlett-Packard Company(yi_zhou@hp.com) // Modified By: Yi Zhou, Hewlett-Packard Company(yi_zhou@hp.com)
 //              Mike Day, IBM (mdday@us.ibm.com) //              Mike Day, IBM (mdday@us.ibm.com)
 //              Adrian Schuur, schuur@de.ibm.com //              Adrian Schuur, schuur@de.ibm.com
 //              Dan Gorey, IBM djgorey@us.ibm.com  
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 52 
Line 51 
 CMPIProvider::CMPIProvider(const String & name, CMPIProvider::CMPIProvider(const String & name,
                    CMPIProviderModule *module,                    CMPIProviderModule *module,
                    ProviderVector *mv)                    ProviderVector *mv)
    : _status(UNINITIALIZED), _module(module), _cimom_handle(0),     : _module(module), _cimom_handle(0), _name(name),
      _name(name), _no_unload(0), _rm(0)       _no_unload(0), _rm(0)
 { {
    _current_operations = 1;    _current_operations = 1;
    if (mv) miVector=*mv;     miVector=*mv;
    noUnload=false;    noUnload=false;
 } }
  
 CMPIProvider::CMPIProvider(CMPIProvider *pr) CMPIProvider::CMPIProvider(CMPIProvider *pr)
   : _status(UNINITIALIZED), _module(pr->_module), _cimom_handle(0),    : _module(pr->_module), _cimom_handle(0), _name(pr->_name),
     _name(pr->_name), _no_unload(0), _rm(0)      _no_unload(0), _rm(0)
 { {
    _current_operations = 1;    _current_operations = 1;
    miVector=pr->miVector;    miVector=pr->miVector;
Line 75 
Line 74 
  
 } }
  
 CMPIProvider::Status CMPIProvider::getStatus(void)  CMPIProvider::Status CMPIProvider::getStatus(void) const
 { {
     AutoMutex lock(_statusMutex);  
     return(_status);     return(_status);
 } }
  
 void CMPIProvider::set(CMPIProviderModule *&module,  
                     ProviderVector cmpiProvider,  
                     CIMOMHandle *&cimomHandle)  
 {  
     _module = module;  
     miVector = cmpiProvider;  
     _cimom_handle = cimomHandle;  
 }  
   
 void CMPIProvider::reset()  
 {  
     _module = 0;  
     _cimom_handle = 0;  
     _no_unload = 0;  
     _status = UNINITIALIZED;  
 }  
   
 CMPIProviderModule *CMPIProvider::getModule(void) const CMPIProviderModule *CMPIProvider::getModule(void) const
 { {
     return(_module);     return(_module);
Line 152 
Line 133 
 void CMPIProvider::initialize(CIMOMHandle & cimom) void CMPIProvider::initialize(CIMOMHandle & cimom)
 { {
  
     if(_status == UNINITIALIZED)      _status = INITIALIZING;
   {  
  
     try     try
     {     {
Line 166 
Line 146 
     }     }
     catch(...)     catch(...)
     {     {
         _current_operations = 0;          _status = UNKNOWN;
           _module->unloadModule();
         throw;         throw;
     }     }
   
     _status = INITIALIZED;     _status = INITIALIZED;
     _current_operations = 0;     _current_operations = 0;
   }   }
 }  
  
 Boolean CMPIProvider::tryTerminate(void) Boolean CMPIProvider::tryTerminate(void)
 { {
   Boolean terminated = false;  
   
   if(_status == INITIALIZED)  
   {  
    if(false == unload_ok())    if(false == unload_ok())
    {    {
       return false;       return false;
    }    }
  
    Status savedStatus=_status;    Status savedStatus=_status;
      _status = TERMINATING;
      Boolean terminated = false;
  
      try
      {
       // yield before a potentially lengthy operation.       // yield before a potentially lengthy operation.
       pegasus_yield();       pegasus_yield();
       try       try
Line 208 
Line 189 
          terminated = false;          terminated = false;
  
       }       }
         // yield before a potentially lengthy operation.
         pegasus_yield();
       if(terminated == true)       if(terminated == true)
    {           _module->unloadModule();
     _status = UNINITIALIZED;  
    }    }
      catch(...)
      {
         _status = UNKNOWN;
   
    }    }
   
      _status = TERMINATED;
    return terminated;    return terminated;
 } }
  
 void CMPIProvider::_terminate(void) void CMPIProvider::_terminate(void)
 { {
       if (broker.clsCache) {
           cerr<<"--- CMPIProvider::_terminate() deleting ClassCache "<<endl;
           ClassCache::Iterator i=broker.clsCache->start();
           for (; i; i++) {
              cerr<<"--- CMPIProvider::_terminate() deleting class "
                 <<i.value()->getClassName().getString()<<endl;
              delete i.value(); }
           delete broker.clsCache;
       }
   
     const OperationContext opc;     const OperationContext opc;
     CMPIStatus rc={CMPI_RC_OK,NULL};     CMPIStatus rc={CMPI_RC_OK,NULL};
     CMPI_ContextOnStack eCtx(opc);     CMPI_ContextOnStack eCtx(opc);
     Boolean savedNoUnload=noUnload;  
  
     if (miVector.miTypes & CMPI_MIType_Instance) {     if (miVector.miTypes & CMPI_MIType_Instance) {
        rc=miVector.instMI->ft->cleanup(miVector.instMI,&eCtx);        rc=miVector.instMI->ft->cleanup(miVector.instMI,&eCtx);
Line 244 
Line 241 
        if (rc.rc==CMPI_RC_ERR_NOT_SUPPORTED) noUnload=true;        if (rc.rc==CMPI_RC_ERR_NOT_SUPPORTED) noUnload=true;
     }     }
  
     if (noUnload==false){  
        if (broker.clsCache) {  
           ClassCache::Iterator i=broker.clsCache->start();  
           for (; i; i++) {  
              delete i.value();  
           }  
           delete broker.clsCache;  
           broker.clsCache=NULL;  
        }  
    }  
    else {  
       if (savedNoUnload!=noUnload)  
          _cimom_handle->disallowProviderUnload();  
    }  
 } }
  
  
 void CMPIProvider::terminate(void) void CMPIProvider::terminate(void)
 { {
     Status savedStatus=_status;     Status savedStatus=_status;
   if(_status == INITIALIZED)      _status = TERMINATING;
       try
     {     {
         // yield before a potentially lengthy operation.         // yield before a potentially lengthy operation.
         pegasus_yield();         pegasus_yield();
Line 281 
Line 265 
           PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,           PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
                                "Exception caught in CMPIProviderFacade::Terminate for " +                                "Exception caught in CMPIProviderFacade::Terminate for " +
                                _name);                                _name);
         throw;  
     }     }
           // yield before a potentially lengthy operation.
           pegasus_yield();
   
           _module->unloadModule();
   }   }
   _status = UNINITIALIZED;      catch(...)
       {
           _status = UNKNOWN;
   
           throw;
       }
   
       _status = TERMINATED;
   
 } }
  
 Boolean CMPIProvider::operator == (const void *key) const Boolean CMPIProvider::operator == (const void *key) const


Legend:
Removed from v.1.4.6.4  
changed lines
  Added in v.1.5

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2