(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.75 and 1.78

version 1.75, 2008/12/02 09:01:58 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 692 
Line 728 
  
 static jobjectArray getList(JvmVector *jv, JNIEnv *env, CIMPropertyList &list) static jobjectArray getList(JvmVector *jv, JNIEnv *env, CIMPropertyList &list)
 { {
     Uint32 s=list.size();  
     jobjectArray pl=NULL;     jobjectArray pl=NULL;
     if (s) {      if (!list.isNull())
       {
           Uint32 s=list.size();
        jstring initial=env->NewString(NULL,0);        jstring initial=env->NewString(NULL,0);
        pl=(jobjectArray)env->NewObjectArray(s,jv->StringClassRef,initial);        pl=(jobjectArray)env->NewObjectArray(s,jv->StringClassRef,initial);
        for (Uint32 i=0; i<s; i++) {          for (Uint32 i=0; i<s; i++)
           {
            env->SetObjectArrayElement            env->SetObjectArrayElement
               (pl,i,env->NewStringUTF(list[i].getString().getCString()));               (pl,i,env->NewStringUTF(list[i].getString().getCString()));
        }        }
Line 1540 
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 1710 
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 1888 
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 2050 
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 4607 
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 4776 
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 4954 
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 5109 
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 6074 
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.75  
changed lines
  Added in v.1.78

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2