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

Diff for /pegasus/src/Pegasus/ProviderManager2/JMPI/JMPIProviderManager.cpp between version 1.77 and 1.78

version 1.77, 2008/12/16 18:57:00 version 1.78, 2008/12/18 18:57:46
Line 62 
Line 62 
  
 #include "Convert.h" #include "Convert.h"
  
   
   //
   //  The following tests were added to allow the provider to supply a
   //  CIMObjectPath in the response.  Before this, the path was always
   //  rebuild by the response functions from the instance.  This resulted
   //  in cases where the key properties were not in the returned instance
   //  (ex. excluded by the property list) so that the path could not be built.
   //  The preferred behavior is for the provider to build the path on response.
   //  However, to cover existing providers the alternate of allowing the
   //  ProviderManager has been kept if the path in the instance is not considered
   //  to exist.
   //  PLEASE: provider writers build/set a proper path into returned objects
   //  See bug 8062
   
   /*
       local function to implement the CIMObjectPath required for a response
       object.
       If there is a path defined in the instance, we simply return this path.
       If not, we use the class to build a path from the instance.
       Note that we are depending on some value in the keybindings to determine
       if we have a path.
   */
   
   void _fixCIMObjectPath(CIMInstance* instance, CIMClass& cls)
   {
       CIMObjectPath op = instance->getPath();
       const Array<CIMKeyBinding> kb = op.getKeyBindings();
       if (kb.size() == 0)
       {
           CIMObjectPath iop = instance->buildPath(cls);
           /* Fix for 4237*/
           iop.setNameSpace(op.getNameSpace());
           instance->setPath(iop);
       }
   }
   
 void JMPIProviderManager::debugPrintMethodPointers (JNIEnv *env, jclass jc) void JMPIProviderManager::debugPrintMethodPointers (JNIEnv *env, jclass jc)
 { {
    PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,    PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
Line 1542 
Line 1578 
                        throw;                        throw;
                     }                     }
  
                     const CIMObjectPath& op  = ciRet->getPath();  
                     CIMObjectPath        iop = ciRet->buildPath(cls);  
   
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     handler.deliver(*ciRet);                     handler.deliver(*ciRet);
Line 1712 
Line 1745 
                        throw;                        throw;
                     }                     }
  
                     const CIMObjectPath& op  = ciRet->getPath();  
                     CIMObjectPath        iop = ciRet->buildPath(cls);  
   
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     handler.deliver(*ciRet);                     handler.deliver(*ciRet);
Line 1890 
Line 1920 
                        throw;                        throw;
                     }                     }
  
                     const CIMObjectPath& op  = ciRet->getPath();                      _fixCIMObjectPath(ciRet, cls);
                     CIMObjectPath        iop = ciRet->buildPath(cls);  
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     iop.setNameSpace(op.getNameSpace());  
   
                     ciRet->setPath(iop);  
                     /* Fix for 4237*/  
   
                     handler.deliver(*ciRet);                     handler.deliver(*ciRet);
                 }                 }
             }             }
Line 2052 
Line 2076 
                        PEG_METHOD_EXIT();                        PEG_METHOD_EXIT();
                        throw;                        throw;
                     }                     }
                       _fixCIMObjectPath(ciRet, cls);
                     const CIMObjectPath& op  = ciRet->getPath();  
                     CIMObjectPath        iop = ciRet->buildPath(cls);  
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     iop.setNameSpace(op.getNameSpace());  
   
                     ciRet->setPath(iop);  
                     /* Fix for 4237*/  
   
                     handler.deliver(*ciRet);                     handler.deliver(*ciRet);
                 }                 }
             }             }
Line 4609 
Line 4626 
                        throw;                        throw;
                     }                     }
  
                     const CIMObjectPath& op    = ciRet->getPath();                      _fixCIMObjectPath(ciRet, cls);
                     CIMObjectPath        iop   = ciRet->buildPath(cls);  
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     iop.setNameSpace(op.getNameSpace());  
                     ciRet->setPath(iop);  
   
                     handler.deliver(*ciRet);                     handler.deliver(*ciRet);
                 }                 }
             }             }
Line 4778 
Line 4791 
                        throw;                        throw;
                     }                     }
  
                     const CIMObjectPath& op    = ciRet->getPath();                      _fixCIMObjectPath(ciRet, cls);
                     CIMObjectPath        iop   = ciRet->buildPath(cls);  
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     iop.setNameSpace(op.getNameSpace());  
                     ciRet->setPath(iop);  
   
                     handler.deliver(*ciRet);                     handler.deliver(*ciRet);
                 }                 }
             }             }
Line 4956 
Line 4965 
                        throw;                        throw;
                     }                     }
  
                     const CIMObjectPath& op    = ciRet->getPath();                      _fixCIMObjectPath(ciRet, cls);
                     CIMObjectPath        iop   = ciRet->buildPath(cls);  
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     iop.setNameSpace(op.getNameSpace());  
                     ciRet->setPath(iop);  
   
                     handler.deliver(*ciRet);                     handler.deliver(*ciRet);
                 }                 }
             }             }
Line 5111 
Line 5116 
                        throw;                        throw;
                     }                     }
  
                     const CIMObjectPath& op = ciRet->getPath();                      _fixCIMObjectPath(ciRet, cls);
                     CIMObjectPath iop = ciRet->buildPath(cls);  
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     iop.setNameSpace(op.getNameSpace());  
                     ciRet->setPath(iop);  
   
                     handler.deliver(*ciRet);                     handler.deliver(*ciRet);
                 }                 }
             }             }
Line 6076 
Line 6077 
                        throw;                        throw;
                     }                     }
  
                     const CIMObjectPath& op    = ciRet->getPath();                      _fixCIMObjectPath(ciRet, cls);
                     CIMObjectPath        iop   = ciRet->buildPath(cls);  
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     iop.setNameSpace(op.getNameSpace());  
                     ciRet->setPath(iop);  
   
                     handler.deliver(*ciRet);                     handler.deliver(*ciRet);
                 }                 }
             }             }


Legend:
Removed from v.1.77  
changed lines
  Added in v.1.78

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2