(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.41.2.3 and 1.41.2.4

version 1.41.2.3, 2006/05/17 20:57:39 version 1.41.2.4, 2006/06/23 17:44:59
Line 55 
Line 55 
 #include <Pegasus/ProviderManager2/JMPI/JMPIProviderModule.h> #include <Pegasus/ProviderManager2/JMPI/JMPIProviderModule.h>
 #include <Pegasus/ProviderManager2/ProviderManagerService.h> #include <Pegasus/ProviderManager2/ProviderManagerService.h>
  
 #include <Pegasus/ProviderManager2/CMPI/CMPI_SelectExp.h>  
   
   
 PEGASUS_USING_STD; PEGASUS_USING_STD;
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 3097 
Line 3094 
  
             CIMClass *pcls = new CIMClass (cls);             CIMClass *pcls = new CIMClass (cls);
  
             JMPIjvm::checkException(env);  
   
             jint jcls = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);             jint jcls = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);
  
             jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcls);             jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcls);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,              jobject jVec = env->CallObjectMethod ((jobject)pr.jProvider,
                                                                    id,                                                                    id,
                                                                    joc,                                                                    joc,
                                                                    jcop,                                                                    jcop,
Line 3125 
Line 3120 
             }             }
  
             handler.processing();             handler.processing();
             if (jAr) {              if (jVec)
                 for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {              {
                   for (int i = 0, m = env->CallIntMethod (jVec, JMPIjvm::jv.VectorSize); i < m; i++)
                   {
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jobject jciRet = env->GetObjectArrayElement(jAr,i);                      jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i);
                       DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: jciRet = "<<jciRet<<PEGASUS_STD(endl));
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
Line 3141 
Line 3139 
                     handler.deliver(*ciRet);                     handler.deliver(*ciRet);
                 }                 }
             }             }
               DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: done!"<<PEGASUS_STD(endl));
             handler.complete();             handler.complete();
             break;             break;
         }         }
Line 3189 
Line 3188 
  
             jint jql = 0; // @BUG - how to convert?             jint jql = 0; // @BUG - how to convert?
  
             jobjectArray jVec = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,              jobject jVec = env->CallObjectMethod ((jobject)pr.jProvider,
                                                                     id,                                                                     id,
                                                                     jcop,                                                                     jcop,
                                                                     jquery,                                                                     jquery,
Line 3202 
Line 3201 
  
             handler.processing();             handler.processing();
             if (jVec) {             if (jVec) {
                 for (int i=0,m=env->GetArrayLength(jVec); i<m; i++) {                  for (int i=0,m=env->CallIntMethod(jVec,JMPIjvm::jv.VectorSize); i<m; i++) {
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jobject jciRet = env->GetObjectArrayElement(jVec,i);                      jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
Line 6250 
Line 6249 
     return 0;     return 0;
 } }
  
 CMPI_SelectExp *  WQLSelectStatement *
 newSelectExp (CIMOMHandleQueryContext *qContext,  newSelectExp (String& query,
               OperationContext        *ctx,                String& queryLanguage)
               String&                  query,  
               String&                  queryLanguage,  
               CIMNamespaceName&        nameSpace,  
               Array<CIMName>&          classNames,  
               CIMPropertyList&         propertyList)  
 { {
    CMPI_SelectExp *eSelx = NULL;     WQLSelectStatement *stmt = new WQLSelectStatement (queryLanguage, query);
   
    eSelx = new CMPI_SelectExp (*ctx,  
                                qContext,  
                                query,  
                                queryLanguage);  
   
    if (!eSelx)  
    {  
       return eSelx;  
    }  
  
    for (Uint32 i = 0, n = classNames.size (); i < n; i++)     try
    {    {
        CIMObjectPath className (System::getHostName(),        WQLParser::parse (query, *stmt);
                                 nameSpace,  
                                 classNames[i]);  
   
        eSelx->classNames.append (className);  
    }    }
      catch (const Exception &e)
    if (!propertyList.isNull ())  
    {  
       Array<CIMName> p      = propertyList.getPropertyNameArray ();  
       int            pCount = p.size ();  
   
       eSelx->props = (const char**)malloc ((1 + pCount) * sizeof (char*));  
   
       for (int i = 0; i < pCount; i++)  
       {       {
          eSelx->props[i] = strdup (p[i].getString ().getCString ());        cerr << "Error: newSelectExp caught: " << e.getMessage () << endl;
       }  
   
       eSelx->props[pCount] = NULL;  
    }    }
  
    return eSelx;     return stmt;
 } }
  
 Message * JMPIProviderManager::handleCreateSubscriptionRequest(const Message * message) throw() Message * JMPIProviderManager::handleCreateSubscriptionRequest(const Message * message) throw()
Line 6419 
Line 6388 
  
            CIMOMHandleQueryContext *qContext = new CIMOMHandleQueryContext (CIMNamespaceName (request->nameSpace.getString ()),            CIMOMHandleQueryContext *qContext = new CIMOMHandleQueryContext (CIMNamespaceName (request->nameSpace.getString ()),
                                                                             *pr._cimom_handle);                                                                             *pr._cimom_handle);
            CMPI_SelectExp          *eSelx    = newSelectExp (qContext,  
                                                              prec->ctx,  
                                                              srec->query,  
                                                              srec->queryLanguage,  
                                                              request->nameSpace,  
                                                              request->classNames,  
                                                              srec->propertyList);  
   
            srec->eSelx    = eSelx;  
            srec->qContext = qContext;            srec->qContext = qContext;
  
            CIMObjectPath sPath (request->subscriptionInstance.getPath ().getClassName ().getString ());            CIMObjectPath sPath (request->subscriptionInstance.getPath ().getClassName ().getString ());
Line 6440 
Line 6400 
  
            selxTab.insert (sPath.toString (), srec);            selxTab.insert (sPath.toString (), srec);
  
            DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: For selxTab "<<sPath.toString ()<<", srec = "<<PEGASUS_STD(hex)<<(int)srec<<PEGASUS_STD(dec)<<", eSelx = "<<PEGASUS_STD(hex)<<(int)eSelx<<PEGASUS_STD(dec)<<", qContext = "<<PEGASUS_STD(hex)<<(int)qContext<<PEGASUS_STD(dec)<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: For selxTab "<<sPath.toString ()<<", srec = "<<PEGASUS_STD(hex)<<(int)srec<<PEGASUS_STD(dec)<<", qContext = "<<PEGASUS_STD(hex)<<(int)qContext<<PEGASUS_STD(dec)<<PEGASUS_STD(endl));
         }         }
  
         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.createSubscriptionRequest: " + pr.getName());         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.createSubscriptionRequest: " + pr.getName());
Line 6529 
Line 6489 
         {         {
         case METHOD_EVENTPROVIDER:         case METHOD_EVENTPROVIDER:
         {         {
             CMPI_SelectExp *eSelx     = newSelectExp (srec->qContext,              WQLSelectStatement *stmt       = newSelectExp (srec->query,
                                                       prec->ctx,                                                             srec->queryLanguage);
                                                       srec->query,              jint                jStmtRef   = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, stmt);
                                                       srec->queryLanguage,              jobject             jSelectExp = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jStmtRef);
                                                       request->nameSpace,  
                                                       request->classNames,  
                                                       srec->propertyList);  
             jint            jEselxRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx);  
             jobject         jEselx    = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jEselxRef);  
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 6555 
Line 6510 
  
             env->CallVoidMethod ((jobject)pr.jProvider,             env->CallVoidMethod ((jobject)pr.jProvider,
                                  id,                                  id,
                                  jEselx,                                   jSelectExp,
                                  jType,                                  jType,
                                  jcop,                                  jcop,
                                  (jboolean)fNewPrec);                                  (jboolean)fNewPrec);
Line 6571 
Line 6526 
             jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);             jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
             jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);             jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
  
             CMPI_SelectExp *eSelx     = newSelectExp (srec->qContext,              WQLSelectStatement *stmt       = newSelectExp (srec->query,
                                                       prec->ctx,                                                             srec->queryLanguage);
                                                       srec->query,              jint                jStmtRef   = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, stmt);
                                                       srec->queryLanguage,              jobject             jSelectExp = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jStmtRef);
                                                       request->nameSpace,  
                                                       request->classNames,  
                                                       srec->propertyList);  
             jint            jEselxRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx);  
             jobject         jEselx    = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jEselxRef);  
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 6598 
Line 6548 
             env->CallVoidMethod ((jobject)pr.jProvider,             env->CallVoidMethod ((jobject)pr.jProvider,
                                  id,                                  id,
                                  joc,                                  joc,
                                  jEselx,                                   jSelectExp,
                                  jType,                                  jType,
                                  jcop,                                  jcop,
                                  (jboolean)fNewPrec);                                  (jboolean)fNewPrec);
Line 6724 
Line 6674 
  
            selxTab.lookup (sPathString, srec);            selxTab.lookup (sPathString, srec);
  
            DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: For selxTab "<<sPathString<<", srec = "<<PEGASUS_STD(hex)<<(int)srec<<PEGASUS_STD(dec)<<", eSelx = "<<PEGASUS_STD(hex)<<(int)srec->eSelx<<PEGASUS_STD(dec)<<", qContext = "<<PEGASUS_STD(hex)<<(int)srec->qContext<<PEGASUS_STD(dec)<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: For selxTab "<<sPathString<<", srec = "<<PEGASUS_STD(hex)<<(int)srec<<PEGASUS_STD(dec)<<", qContext = "<<PEGASUS_STD(hex)<<(int)srec->qContext<<PEGASUS_STD(dec)<<PEGASUS_STD(endl));
  
            selxTab.remove (sPathString);            selxTab.remove (sPathString);
         }         }
Line 6815 
Line 6765 
         {         {
         case METHOD_EVENTPROVIDER:         case METHOD_EVENTPROVIDER:
         {         {
             CMPI_SelectExp *eSelx     = newSelectExp (srec->qContext,              WQLSelectStatement *stmt       = newSelectExp (srec->query,
                                                       prec->ctx,                                                             srec->queryLanguage);
                                                       srec->query,              jint                jStmtRef   = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, stmt);
                                                       srec->queryLanguage,              jobject             jSelectExp = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jStmtRef);
                                                       request->nameSpace,  
                                                       request->classNames,  
                                                       srec->propertyList);  
             jint            jEselxRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx);  
             jobject         jEselx    = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jEselxRef);  
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 6841 
Line 6786 
  
             env->CallVoidMethod ((jobject)pr.jProvider,             env->CallVoidMethod ((jobject)pr.jProvider,
                                  id,                                  id,
                                  jEselx,                                   jSelectExp,
                                  jType,                                  jType,
                                  jcop,                                  jcop,
                                  (jboolean)fFreePrec);                                  (jboolean)fFreePrec);
Line 6857 
Line 6802 
             jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);             jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
             jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);             jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
  
             CMPI_SelectExp *eSelx     = newSelectExp (srec->qContext,              WQLSelectStatement *stmt       = newSelectExp (srec->query,
                                                       prec->ctx,                                                             srec->queryLanguage);
                                                       srec->query,              jint                jStmtRef   = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, stmt);
                                                       srec->queryLanguage,              jobject             jSelectExp = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jStmtRef);
                                                       request->nameSpace,  
                                                       request->classNames,  
                                                       srec->propertyList);  
             jint            jEselxRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx);  
             jobject         jEselx    = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jEselxRef);  
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 6884 
Line 6824 
             env->CallVoidMethod ((jobject)pr.jProvider,             env->CallVoidMethod ((jobject)pr.jProvider,
                                  id,                                  id,
                                  joc,                                  joc,
                                  jEselx,                                   jSelectExp,
                                  jType,                                  jType,
                                  jcop,                                  jcop,
                                  (jboolean)fFreePrec);                                  (jboolean)fFreePrec);
Line 6918 
Line 6858 
  
     if (srec)     if (srec)
     {     {
        if (  srec->eSelx  
           && srec->eSelx->props  
           )  
        {  
           const char **props = srec->eSelx->props;  
   
           while (*props)  
           {  
              const char *prop = *props;  
   
              props++;  
   
              if (prop)  
              {  
                 free ((void *)prop);  
              }  
           }  
   
           free ((void *)srec->eSelx->props);  
        }  
        delete srec->eSelx;  
        delete srec->qContext;        delete srec->qContext;
     }     }
     delete srec;     delete srec;


Legend:
Removed from v.1.41.2.3  
changed lines
  Added in v.1.41.2.4

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2