(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.38.2.2 and 1.59.4.2

version 1.38.2.2, 2006/03/07 18:45:59 version 1.59.4.2, 2007/07/07 01:35:43
Line 29 
Line 29 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author:      Adrian Schuur, schuur@de.ibm.com  
 //  
 // Modified By: Seema Gupta (gseema@in.ibm.com) for PEP135  
 //              Josephine Eskaline Joyce, IBM (jojustin@in.ibm.com) for PEP#101  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
   // NOCHKSRC
  
 #include "JMPIProviderManager.h" #include "JMPIProviderManager.h"
  
Line 47 
Line 43 
 #include <Pegasus/Common/Logger.h> #include <Pegasus/Common/Logger.h>
 #include <Pegasus/Common/MessageLoader.h> //l10n #include <Pegasus/Common/MessageLoader.h> //l10n
 #include <Pegasus/Common/Constants.h> #include <Pegasus/Common/Constants.h>
   #include <Pegasus/Common/FileSystem.h>
   #include <Pegasus/Common/ArrayInternal.h>
  
 #include <Pegasus/Config/ConfigManager.h> #include <Pegasus/Config/ConfigManager.h>
  
 #include <Pegasus/ProviderManager2/ProviderName.h> #include <Pegasus/ProviderManager2/ProviderName.h>
 #include <Pegasus/ProviderManager2/JMPI/JMPIProvider.h> #include <Pegasus/ProviderManager2/JMPI/JMPIProvider.h>
 #include <Pegasus/ProviderManager2/JMPI/JMPIProviderModule.h> #include <Pegasus/ProviderManager2/JMPI/JMPIProviderModule.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 163 
Line 157 
    for (int i = 0; i < (int)(sizeof (methodNames)/sizeof (methodNames[0])); i++)    for (int i = 0; i < (int)(sizeof (methodNames)/sizeof (methodNames[0])); i++)
    {    {
       jmethodID id = env->GetMethodID(jc,methodNames[i][1], methodNames[i][2]);       jmethodID id = env->GetMethodID(jc,methodNames[i][1], methodNames[i][2]);
       DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::debugPrintMethodPointers: "<<methodNames[i][0]<<", "<<methodNames[i][1]<<", id = "<<PEGASUS_STD(hex)<<(int)id<<PEGASUS_STD(dec)<<PEGASUS_STD(endl));        DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::debugPrintMethodPointers: "<<methodNames[i][0]<<", "<<methodNames[i][1]<<", id = "<<PEGASUS_STD(hex)<<(long)id<<PEGASUS_STD(dec)<<PEGASUS_STD(endl));
       env->ExceptionClear();       env->ExceptionClear();
    }    }
  
Line 247 
Line 241 
    env->ExceptionClear();    env->ExceptionClear();
 } }
  
   bool JMPIProviderManager::getInterfaceType (ProviderIdContainer pidc,
                                               String&             interfaceType,
                                               String&             interfaceVersion)
   {
   ///CIMInstance ciProvider       = pidc.getProvider ();
      CIMInstance ciProviderModule = pidc.getModule ();
      Uint32      idx;
      bool        fRet             = true;
   
   ///PEGASUS_STD(cout)<<"--- JMPIProviderManager::getInterfaceType: ciProvider       = "<<ciProvider.getPath ().toString ()<<PEGASUS_STD(endl);
   ///PEGASUS_STD(cout)<<"--- JMPIProviderManager::getInterfaceType: ciProviderModule = "<<ciProviderModule.getPath ().toString ()<<PEGASUS_STD(endl);
   
      idx = ciProviderModule.findProperty ("InterfaceType");
   
      if (idx != PEG_NOT_FOUND)
      {
         CIMValue itValue;
   
         itValue = ciProviderModule.getProperty (idx).getValue ();
   
         itValue.get (interfaceType);
   
         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::getInterfaceType: interfaceType = "<<interfaceType<<PEGASUS_STD(endl));
      }
      else
      {
         fRet = false;
      }
   
      idx = ciProviderModule.findProperty ("InterfaceVersion");
   
      if (idx != PEG_NOT_FOUND)
      {
         CIMValue itValue;
   
         itValue = ciProviderModule.getProperty (idx).getValue ();
   
         itValue.get (interfaceVersion);
   
         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::getInterfaceType: interfaceVersion = "<<interfaceVersion<<PEGASUS_STD(endl));
      }
      else
      {
         fRet = false;
      }
   
      return fRet;
   }
   
   bool JMPIProviderManager::interfaceIsUsed (JNIEnv  *env,
                                              jobject  jObject,
                                              String   searchInterfaceName)
   {
      jobjectArray jInterfaces       = 0;
      jsize        jInterfacesLength = 0;
      bool         fFound            = false;
   
      if (!jObject)
      {
         return false;
      }
   
      jInterfaces = (jobjectArray)env->CallObjectMethod (env->GetObjectClass (jObject),
                                                         JMPIjvm::jv.ClassGetInterfaces);
   
      if (!jInterfaces)
      {
         return false;
      }
   
      jInterfacesLength = env->GetArrayLength (jInterfaces);
   
      for (jsize i = 0; !fFound && i < jInterfacesLength; i++)
      {
         jobject jInterface = env->GetObjectArrayElement (jInterfaces, i);
   
         if (jInterface)
         {
            jstring jInterfaceName = (jstring)env->CallObjectMethod (jInterface,
                                                                     JMPIjvm::jv.ClassGetName);
   
            if (jInterfaceName)
            {
               const char *pszInterfaceName = env->GetStringUTFChars (jInterfaceName,
                                                                      0);
               String      interfaceName    = pszInterfaceName;
   
               if (String::equal (interfaceName, searchInterfaceName))
               {
                  fFound = true;
               }
   
               env->ReleaseStringUTFChars (jInterfaceName, pszInterfaceName);
            }
         }
      }
   
      return fFound;
   }
   
 JMPIProviderManager::IndProvTab    JMPIProviderManager::provTab; JMPIProviderManager::IndProvTab    JMPIProviderManager::provTab;
   Mutex                              JMPIProviderManager::mutexProvTab;
 JMPIProviderManager::IndSelectTab  JMPIProviderManager::selxTab; JMPIProviderManager::IndSelectTab  JMPIProviderManager::selxTab;
   Mutex                              JMPIProviderManager::mutexSelxTab;
 JMPIProviderManager::ProvRegistrar JMPIProviderManager::provReg; JMPIProviderManager::ProvRegistrar JMPIProviderManager::provReg;
   Mutex                              JMPIProviderManager::mutexProvReg;
  
 JMPIProviderManager::JMPIProviderManager(Mode m)  JMPIProviderManager::JMPIProviderManager()
 { {
    mode=m;  
    _subscriptionInitComplete = false;    _subscriptionInitComplete = false;
  
 #ifdef PEGASUS_DEBUG #ifdef PEGASUS_DEBUG
Line 277 
Line 373 
  
     DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::insertProvider: "<<key<<PEGASUS_STD(endl));     DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::insertProvider: "<<key<<PEGASUS_STD(endl));
  
     return provReg.insert(key,name);      Boolean ret = false;
   
       {
          AutoMutex lock (mutexProvReg);
   
          ret = provReg.insert(key,name);
       }
   
       return ret;
 } }
  
 Message * JMPIProviderManager::processMessage(Message * request) throw() Message * JMPIProviderManager::processMessage(Message * request) throw()
Line 415 
Line 519 
 #define CHARS(cstring) (char*)(strlen(cstring)?(const char*)cstring:NULL) #define CHARS(cstring) (char*)(strlen(cstring)?(const char*)cstring:NULL)
  
  
 #define HandlerIntroBase(type,type1,message,request,response,handler,respType) \  #define HandlerIntroBase(type,type1,message,request,response,handler) \
     CIM##type##RequestMessage * request = \     CIM##type##RequestMessage * request = \
         dynamic_cast<CIM##type##RequestMessage *>(const_cast<Message *>(message)); \         dynamic_cast<CIM##type##RequestMessage *>(const_cast<Message *>(message)); \
     PEGASUS_ASSERT(request != 0); \     PEGASUS_ASSERT(request != 0); \
     CIM##type##ResponseMessage * response = \     CIM##type##ResponseMessage * response = \
         new CIM##type##ResponseMessage( \          dynamic_cast<CIM##type##ResponseMessage*>(request->buildResponse()); \
         request->messageId, \  
         CIMException(), \  
         request->queueIds.copyAndPop() \  
         respType \  
     PEGASUS_ASSERT(response != 0); \     PEGASUS_ASSERT(response != 0); \
     response->setKey(request->getKey()); \  
     response->setHttpMethod(request->getHttpMethod()); \  
     type1##ResponseHandler handler(request, response, _responseChunkCallback);     type1##ResponseHandler handler(request, response, _responseChunkCallback);
  
 #define VOIDINTRO );  
 #define NOVOIDINTRO(type) ,type);  
 #define METHODINTRO ,CIMValue(), Array<CIMParamValue>(), request->methodName );  
   
   
 #define HandlerIntroVoid(type,message,request,response,handler) \  
      HandlerIntroBase(type,type,message,request,response,handler,VOIDINTRO)  
   
 #define HandlerIntroMethod(type,message,request,response,handler) \  
      HandlerIntroBase(type,type,message,request,response,handler,METHODINTRO)  
   
 #define HandlerIntroInd(type,message,request,response,handler) \ #define HandlerIntroInd(type,message,request,response,handler) \
      HandlerIntroBase(type,Operation,message,request,response,handler,VOIDINTRO)       HandlerIntroBase(type,Operation,message,request,response,handler)
  
 #define HandlerIntroInit(type,message,request,response,handler) \ #define HandlerIntroInit(type,message,request,response,handler) \
      HandlerIntroBase(type,Operation,message,request,response,handler,VOIDINTRO)       HandlerIntroBase(type,Operation,message,request,response,handler)
  
 #define HandlerIntro(type,message,request,response,handler,respType) \  #define HandlerIntro(type,message,request,response,handler) \
      HandlerIntroBase(type,type,message,request,response,handler,NOVOIDINTRO(respType))       HandlerIntroBase(type,type,message,request,response,handler)
  
 #define HandlerCatch(handler) \ #define HandlerCatch(handler) \
     catch(CIMException & e)  \     catch(CIMException & e)  \
Line 462 
Line 549 
         handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); \         handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); \
     } \     } \
     catch(...) \     catch(...) \
     { PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, \      { PEG_TRACE_CSTRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, \
                 "Exception: Unknown"); \                 "Exception: Unknown"); \
         handler.setStatus(CIM_ERR_FAILED, "Unknown error."); \         handler.setStatus(CIM_ERR_FAILED, "Unknown error."); \
     }     }
Line 486 
Line 573 
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleGetInstanceRequest");     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleGetInstanceRequest");
  
     HandlerIntro(GetInstance,message,request,response,handler,CIMInstance());      HandlerIntro(GetInstance,message,request,response,handler);
  
     typedef enum {     typedef enum {
        METHOD_UNKNOWN = 0,        METHOD_UNKNOWN = 0,
        METHOD_PEGASUS_24,         METHOD_CIMINSTANCEPROVIDER,
        METHOD_PEGASUS_25,         METHOD_INSTANCEPROVIDER,
        METHOD_SNIA_PROVIDER20,         METHOD_INSTANCEPROVIDER2, // same as METHOD_CIMINSTANCEPROVIDER2
     } METHOD_VERSION;     } METHOD_VERSION;
     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;
     JNIEnv          *env           = NULL;     JNIEnv          *env           = NULL;
Line 521 
Line 608 
                                    name.getLogicalName());                                    name.getLogicalName());
         OperationContext context;         OperationContext context;
  
           context.insert(request->operationContext.get(IdentityContainer::NAME));
           context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
           context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
   
         // forward request         // forward request
         JMPIProvider &pr=ph.GetProvider();         JMPIProvider &pr=ph.GetProvider();
  
Line 536 
Line 627 
         {         {
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
  
             STAT_COPYDISPATCHER  
   
             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
Line 547 
Line 636 
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;  
   
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
  
         /* Fix for 4238 */          getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
         // public abstract org.pegasus.jmpi.CIMInstance getInstance (org.pegasus.jmpi.CIMObjectPath cop,                            interfaceType,
         //                                                           org.pegasus.jmpi.CIMClass      cimClass,                            interfaceVersion);
         //                                                           boolean                        includeQualifiers,  
         //                                                           boolean                        includeClassOrigin,  
         //                                                           String                         propertyList[])  
         //        throws org.pegasus.jmpi.CIMException  
         id = env->GetMethodID((jclass)pr.jProviderClass,  
                               "getInstance",  
                               "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;ZZ[Ljava/lang/String;)Lorg/pegasus/jmpi/CIMInstance;");  
   
         if (id != NULL)  
         {  
             eMethodFound = METHOD_PEGASUS_25;  
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstanceRequest: found METHOD_PEGASUS_25."<<PEGASUS_STD(endl));  
         }  
         /* Fix for 4238 */  
  
         if (id == NULL)          if (interfaceType == "JMPI")
         {         {
             env->ExceptionClear();             // public org.pegasus.jmpi.CIMInstance getInstance (org.pegasus.jmpi.CIMObjectPath cop,
   
             // public abstract org.pegasus.jmpi.CIMInstance getInstance (org.pegasus.jmpi.CIMObjectPath cop,  
             //                                                           org.pegasus.jmpi.CIMClass      cimClass,             //                                                           org.pegasus.jmpi.CIMClass      cimClass,
             //                                                           boolean                        localOnly)             //                                                           boolean                        localOnly)
             //        throws org.pegasus.jmpi.CIMException             //        throws org.pegasus.jmpi.CIMException
Line 583 
Line 656 
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_INSTANCEPROVIDER;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstanceRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstanceRequest: found METHOD_INSTANCEPROVIDER."<<PEGASUS_STD(endl));
             }  
         }         }
  
         if (id == NULL)         if (id == NULL)
Line 605 
Line 677 
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_PEGASUS_24;                     eMethodFound = METHOD_CIMINSTANCEPROVIDER;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstanceRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstanceRequest: found METHOD_CIMINSTANCEPROVIDER."<<PEGASUS_STD(endl));
                  }
              }
           }
           else if (interfaceType == "JMPIExperimental")
           {
              /* Fix for 4238 */
              // public org.pegasus.jmpi.CIMInstance getInstance (org.pegasus.jmpi.OperationContext oc
              //                                                  org.pegasus.jmpi.CIMObjectPath    cop,
              //                                                  org.pegasus.jmpi.CIMClass         cimClass,
              //                                                  boolean                           includeQualifiers,
              //                                                  boolean                           includeClassOrigin,
              //                                                  String                            propertyList[])
              //        throws org.pegasus.jmpi.CIMException
              id = env->GetMethodID((jclass)pr.jProviderClass,
                                    "getInstance",
                                    "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;ZZ[Ljava/lang/String;)Lorg/pegasus/jmpi/CIMInstance;");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_INSTANCEPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstanceRequest: found METHOD_INSTANCEPROVIDER2."<<PEGASUS_STD(endl));
              }
              /* Fix for 4238 */
             }             }
   
           if (id == NULL)
           {
              DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstanceRequest: No method found!"<<PEGASUS_STD(endl));
   
              PEG_METHOD_EXIT();
   
              throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                             MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND",
                                                                 "Could not find a method for the provider based on InterfaceType."));
         }         }
  
         JMPIjvm::checkException(env);         JMPIjvm::checkException(env);
  
         switch (eMethodFound)         switch (eMethodFound)
         {         {
         case METHOD_PEGASUS_24:          case METHOD_CIMINSTANCEPROVIDER:
         {         {
             jint    jopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
             jobject jop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jopRef);              jobject jop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jopRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 647 
Line 752 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint    jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);              jlong   jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls);
             jobject jcimClass    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcimClassRef);              jobject jcimClass    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcimClassRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jobjectArray jPropertyList = getList(jv,env,request->propertyList);             jobjectArray jPropertyList = getList(jv,env,request->propertyList);
  
               StatProviderTimeMeasurement providerTime(response);
   
             jobject jciRet = env->CallObjectMethod((jobject)pr.jProvider,             jobject jciRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                    id,                                                    id,
                                                    jop,                                                    jop,
Line 665 
Line 772 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;  
   
             handler.processing();             handler.processing();
  
             if (jciRet) {             if (jciRet) {
                jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);                 jlong        jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                 CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
  
                handler.deliver(*ciRet);                handler.deliver(*ciRet);
             }             }
Line 680 
Line 785 
         }         }
  
         /* Fix for 4238 */         /* Fix for 4238 */
         case METHOD_PEGASUS_25:          case METHOD_INSTANCEPROVIDER2:
         {         {
             jint    jopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
             jobject jop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jopRef);              jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jopRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 713 
Line 821 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint    jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);              jlong   jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls);
             jobject jcimClass    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcimClassRef);              jobject jcimClass    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcimClassRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jobjectArray jPropertyList = getList(jv,env,request->propertyList);             jobjectArray jPropertyList = getList(jv,env,request->propertyList);
   
               StatProviderTimeMeasurement providerTime(response);
   
             jobject      jciRet        = env->CallObjectMethod((jobject)pr.jProvider,             jobject      jciRet        = env->CallObjectMethod((jobject)pr.jProvider,
                                                                id,                                                                id,
                                                                  joc,
                                                                jop,                                                                jop,
                                                                jcimClass,                                                                jcimClass,
                                                                JMPI_INCLUDE_QUALIFIERS,                                                                JMPI_INCLUDE_QUALIFIERS,
Line 729 
Line 841 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
  
             handler.processing();             handler.processing();
  
             if (jciRet) {             if (jciRet) {
                jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);                 jlong        jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                 CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
  
                handler.deliver(*ciRet);                handler.deliver(*ciRet);
             }             }
Line 744 
Line 861 
         }         }
         /* Fix for 4238 */         /* Fix for 4238 */
  
         case METHOD_SNIA_PROVIDER20:          case METHOD_INSTANCEPROVIDER:
         {         {
             jint    jopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
             jobject jop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jopRef);              jobject jop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jopRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 777 
Line 894 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint    jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);              jlong   jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls);
             jobject jcimClass    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcimClassRef);              jobject jcimClass    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcimClassRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               StatProviderTimeMeasurement providerTime(response);
   
             // Modified for Bugzilla# 3679             // Modified for Bugzilla# 3679
             jobject jciRet = env->CallObjectMethod((jobject)pr.jProvider,             jobject jciRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                    id,                                                    id,
Line 791 
Line 910 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;  
   
             handler.processing();             handler.processing();
  
             if (jciRet) {             if (jciRet) {
                jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);                 jlong        jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                 CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
  
                handler.deliver(*ciRet);                handler.deliver(*ciRet);
             }             }
Line 818 
Line 935 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
     STAT_COPYDISPATCHER  
   
     return(response);     return(response);
 } }
  
Line 827 
Line 942 
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleEnumerateInstanceRequest");     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleEnumerateInstanceRequest");
  
     HandlerIntro(EnumerateInstances,message,request,response,handler,Array<CIMInstance>());      HandlerIntro(EnumerateInstances,message,request,response,handler);
  
     typedef enum {     typedef enum {
        METHOD_UNKNOWN = 0,        METHOD_UNKNOWN = 0,
        METHOD_PEGASUS_24,         METHOD_CIMINSTANCEPROVIDER,
        METHOD_PEGASUS_25,         METHOD_CIMINSTANCEPROVIDER2,
        METHOD_SNIA_PROVIDER20,         METHOD_INSTANCEPROVIDER,
          METHOD_INSTANCEPROVIDER2,
     } METHOD_VERSION;     } METHOD_VERSION;
     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;
     JNIEnv          *env           = NULL;     JNIEnv          *env           = NULL;
Line 857 
Line 973 
             request->operationContext.get(ProviderIdContainer::NAME));             request->operationContext.get(ProviderIdContainer::NAME));
  
         // get cached or load new provider module         // get cached or load new provider module
         JMPIProvider::OpProviderHolder ph =          JMPIProvider::OpProviderHolder ph = providerManager.getProvider (name.getPhysicalName(),
             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(),                                                                           name.getLogicalName(),
                String::EMPTY);                String::EMPTY);
  
         // convert arguments         // convert arguments
Line 883 
Line 999 
         {         {
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
  
             STAT_COPYDISPATCHER  
   
             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
Line 892 
Line 1006 
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;  
   
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
  
         /* Fix for 4189 */          getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
         // public java.util.Vector enumerateInstances (org.pegasus.jmpi.CIMObjectPath cop,                            interfaceType,
                             interfaceVersion);
   
           if (interfaceType == "JMPI")
           {
              // public abstract java.util.Vector enumInstances (org.pegasus.jmpi.CIMObjectPath cop,
              //                                                 boolean                        deep,
         //                                             org.pegasus.jmpi.CIMClass      cimClass,         //                                             org.pegasus.jmpi.CIMClass      cimClass,
         //                                             boolean                        includeQualifiers,             //                                                 boolean                        localOnly)
         //                                             boolean                        includeClassOrigin,  
         //                                             java.lang.String[]             propertyList)  
         //         throws org.pegasus.jmpi.CIMException         //         throws org.pegasus.jmpi.CIMException
         id = env->GetMethodID((jclass)pr.jProviderClass,         id = env->GetMethodID((jclass)pr.jProviderClass,
                               "enumerateInstances",                                   "enumInstances",
                               "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;ZZ[Ljava/lang/String;)Ljava/util/Vector;");                                   "(Lorg/pegasus/jmpi/CIMObjectPath;ZLorg/pegasus/jmpi/CIMClass;Z)Ljava/util/Vector;");
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_PEGASUS_25;                 eMethodFound = METHOD_INSTANCEPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_PEGASUS_25."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_INSTANCEPROVIDER."<<PEGASUS_STD(endl));
         }         }
         /* Fix for 4189 */  
  
         if (id == NULL)         if (id == NULL)
         {         {
             env->ExceptionClear();             env->ExceptionClear();
  
             // public abstract java.util.Vector enumInstances (org.pegasus.jmpi.CIMObjectPath cop,                 // public org.pegasus.jmpi.CIMInstance[] enumerateInstances (org.pegasus.jmpi.CIMObjectPath cop,
             //                                                 boolean                        deep,                 //                                                           boolean                        localOnly,
             //                                                 org.pegasus.jmpi.CIMClass      cimClass,                 //                                                           boolean                        includeQualifiers,
             //                                                 boolean                        localOnly)                 //                                                           boolean                        includeClassOrigin,
                  //                                                           java.lang.String[]             propertyList,
                  //                                                           org.pegasus.jmpi.CIMClass      cimClass)
             //        throws org.pegasus.jmpi.CIMException             //        throws org.pegasus.jmpi.CIMException
             id = env->GetMethodID((jclass)pr.jProviderClass,             id = env->GetMethodID((jclass)pr.jProviderClass,
                                   "enumInstances",                                       "enumerateInstances",
                                   "(Lorg/pegasus/jmpi/CIMObjectPath;ZLorg/pegasus/jmpi/CIMClass;Z)Ljava/util/Vector;");                                       "(Lorg/pegasus/jmpi/CIMObjectPath;ZZZ[Ljava/lang/String;Lorg/pegasus/jmpi/CIMClass;)[Lorg/pegasus/jmpi/CIMInstance;");
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_SNIA_PROVIDER20;                     eMethodFound = METHOD_CIMINSTANCEPROVIDER;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_CIMINSTANCEPROVIDER."<<PEGASUS_STD(endl));
             }             }
         }         }
           }
           else if (interfaceType == "JMPIExperimental")
           {
              /* Fix for 4189 */
              // public abstract java.util.Vector enumerateInstances (org.pegasus.jmpi.OperationContext oc
              //                                                      org.pegasus.jmpi.CIMObjectPath    cop,
              //                                                      org.pegasus.jmpi.CIMClass         cimClass,
              //                                                      boolean                           includeQualifiers,
              //                                                      boolean                           includeClassOrigin,
              //                                                      java.lang.String[]                propertyList)
              //         throws org.pegasus.jmpi.CIMException
              id = env->GetMethodID((jclass)pr.jProviderClass,
                                    "enumerateInstances",
                                    "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;ZZ[Ljava/lang/String;)Ljava/util/Vector;");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_INSTANCEPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_INSTANCEPROVIDER2."<<PEGASUS_STD(endl));
              }
              /* Fix for 4189 */
  
         if (id == NULL)         if (id == NULL)
         {         {
             env->ExceptionClear();             env->ExceptionClear();
  
             // public org.pegasus.jmpi.CIMInstance[] enumInstances (org.pegasus.jmpi.CIMObjectPath cop,                 // public abstract org.pegasus.jmpi.CIMInstance[] enumerateInstances (org.pegasus.jmpi.OperationContext oc
             //                                                      boolean                        localOnly,                 //                                                                    org.pegasus.jmpi.CIMObjectPath    cop,
                  //                                                                    org.pegasus.jmpi.CIMClass         cimClass,
             //                                                      boolean                        includeQualifiers,             //                                                      boolean                        includeQualifiers,
             //                                                      boolean                        includeClassOrigin,             //                                                      boolean                        includeClassOrigin,
             //                                                      java.lang.String[]             propertyList,                 //                                                                    java.lang.String[]                propertyList)
             //                                                      org.pegasus.jmpi.CIMClass      cimClass)  
             //         throws org.pegasus.jmpi.CIMException             //         throws org.pegasus.jmpi.CIMException
             id = env->GetMethodID((jclass)pr.jProviderClass,             id = env->GetMethodID((jclass)pr.jProviderClass,
                                   "enumInstances",                                       "enumerateInstances",
                                   "(Lorg/pegasus/jmpi/CIMObjectPath;ZZZ[Ljava/lang/String;Lorg/pegasus/jmpi/CIMClass;)[Lorg/pegasus/jmpi/CIMInstance;");                                       "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;ZZ[Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMInstance;");
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_PEGASUS_24;                     eMethodFound = METHOD_CIMINSTANCEPROVIDER2;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_CIMINSTANCEPROVIDER2."<<PEGASUS_STD(endl));
                  }
             }             }
         }         }
  
           if (id == NULL)
           {
              DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: No method found!"<<PEGASUS_STD(endl));
   
              PEG_METHOD_EXIT();
   
              throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                             MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND",
                                                                 "Could not find a method for the provider based on InterfaceType."));
           }
   
         JMPIjvm::checkException(env);         JMPIjvm::checkException(env);
  
         switch (eMethodFound)         switch (eMethodFound)
         {         {
         case METHOD_PEGASUS_24:          case METHOD_CIMINSTANCEPROVIDER:
         {         {
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);              jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 993 
Line 1145 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint    jccRef = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);              jlong   jccRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls);
             jobject jcc    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jccRef);              jobject jcc    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jccRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jobjectArray jPropertyList = getList(jv,env,request->propertyList);             jobjectArray jPropertyList = getList(jv,env,request->propertyList);
   
               StatProviderTimeMeasurement providerTime(response);
   
             jobjectArray jAr           = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,             jobjectArray jAr           = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                              id,                                                                              id,
                                                                              jcop,                                                                              jcop,
Line 1010 
Line 1165 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;  
   
             handler.processing();             handler.processing();
             if (jAr) {             if (jAr) {
                 for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {                 for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
Line 1021 
Line 1174 
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);                      jlong        jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                     CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                      CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
  
                     /* Fix for 4237 */                     /* Fix for 4237 */
                     CIMClass cls;                     CIMClass cls;
Line 1059 
Line 1212 
             break;             break;
         }         }
  
         /* Fix for 4189 */          case METHOD_CIMINSTANCEPROVIDER2:
         case METHOD_PEGASUS_25:  
         {         {
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);              jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 1093 
Line 1248 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint    jccRef = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);              jlong   jccRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls);
             jobject jcc    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jccRef);              jobject jcc    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jccRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jobjectArray jPropertyList = getList(jv,env,request->propertyList);             jobjectArray jPropertyList = getList(jv,env,request->propertyList);
             jobject      jVec          = env->CallObjectMethod((jobject)pr.jProvider,  
               StatProviderTimeMeasurement providerTime(response);
   
               jobjectArray jAr           = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                id,                                                                id,
                                                                                joc,
                                                                jcop,                                                                jcop,
                                                                jcc,                                                                jcc,
                                                                JMPI_INCLUDE_QUALIFIERS,                                                                JMPI_INCLUDE_QUALIFIERS,
Line 1109 
Line 1268 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
  
             handler.processing();             handler.processing();
             if (jVec) {              if (jAr) {
                 for (int i=0,m=env->CallIntMethod(jVec,JMPIjvm::jv.VectorSize); i<m; i++) {                  for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i);                      jobject jciRet = env->GetObjectArrayElement(jAr,i);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);                      jlong        jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                     CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                      CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
  
                     /* Fix for 4237 */                     /* Fix for 4237 */
                     CIMClass             cls;                     CIMClass             cls;
Line 1151 
Line 1315 
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     iop.setNameSpace(op.getNameSpace());  
   
                     ciRet->setPath(iop);  
                     /* Fix for 4237*/  
   
                     handler.deliver(*ciRet);                     handler.deliver(*ciRet);
                 }                 }
             }             }
             handler.complete();             handler.complete();
             break;             break;
         }         }
         /* Fix for 4189 */  
  
         case METHOD_SNIA_PROVIDER20:          /* Fix for 4189 */
           case METHOD_INSTANCEPROVIDER2:
         {         {
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);              jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 1197 
Line 1359 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint    jccRef = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);              jlong   jccRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls);
             jobject jcc    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jccRef);              jobject jcc    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jccRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             // Modified for Bugzilla# 3679              jobjectArray jPropertyList = getList(jv,env,request->propertyList);
   
               StatProviderTimeMeasurement providerTime(response);
   
             jobject jVec = env->CallObjectMethod((jobject)pr.jProvider,             jobject jVec = env->CallObjectMethod((jobject)pr.jProvider,
                                                  id,                                                  id,
                                                                  joc,
                                                  jcop,                                                  jcop,
                                                  request->deepInheritance,  
                                                  jcc,                                                  jcc,
                                                  JMPI_LOCALONLY);                                                                 JMPI_INCLUDE_QUALIFIERS,
                                                                  request->includeClassOrigin,
                                                                  jPropertyList);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
  
             handler.processing();             handler.processing();
             if (jVec) {             if (jVec) {
Line 1223 
Line 1395 
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);                      jlong        jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                     CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                      CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
  
                     /* Fix for 4237 */                     /* Fix for 4237 */
                     CIMClass cls;                     CIMClass cls;
Line 1265 
Line 1437 
             handler.complete();             handler.complete();
             break;             break;
         }         }
           /* Fix for 4189 */
  
         case METHOD_UNKNOWN:          case METHOD_INSTANCEPROVIDER:
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: should not be here!"<<PEGASUS_STD(endl));              jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
             break;              jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
         }  
         }  
     }  
     HandlerCatch(handler);  
  
     if (env) JMPIjvm::detachThread();              JMPIjvm::checkException(env);
  
     PEG_METHOD_EXIT();              CIMClass cls;
  
     STAT_COPYDISPATCHER              try
               {
                  DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl));
                  AutoMutex lock (pr._cimomMutex);
  
     return(response);                 cls = pr._cimom_handle->getClass(context,
                                                   request->nameSpace,
                                                   request->className,
                                                   false,
                                                   true,
                                                   true,
                                                   CIMPropertyList());
                  DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl));
 } }
               catch (CIMException e)
 Message * JMPIProviderManager::handleEnumerateInstanceNamesRequest(const Message * message) throw()  
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "JMPIProviderManager::handleEnumerateInstanceNamesRequest");                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
                  throw;
               }
  
     HandlerIntro(EnumerateInstanceNames,message,request,response, handler,Array<CIMObjectPath>());              CIMClass *pcls = new CIMClass (cls);
   
               JMPIjvm::checkException(env);
   
               jlong   jccRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls);
               jobject jcc    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jccRef);
   
               JMPIjvm::checkException(env);
   
               StatProviderTimeMeasurement providerTime(response);
   
               // Modified for Bugzilla# 3679
               jobject jVec = env->CallObjectMethod((jobject)pr.jProvider,
                                                    id,
                                                    jcop,
                                                    request->deepInheritance,
                                                    jcc,
                                                    JMPI_LOCALONLY);
   
               JMPIjvm::checkException(env);
   
               handler.processing();
               if (jVec) {
                   for (int i=0,m=env->CallIntMethod(jVec,JMPIjvm::jv.VectorSize); i<m; i++) {
                       JMPIjvm::checkException(env);
   
                       jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i);
   
                       JMPIjvm::checkException(env);
   
                       jlong        jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                       CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
   
                       /* Fix for 4237 */
                       CIMClass cls;
   
                       try
                       {
                          DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl));
                          AutoMutex lock (pr._cimomMutex);
   
                          cls = pr._cimom_handle->getClass(context,
                                                           request->nameSpace,
                                                           ciRet->getClassName(),
                                                           false,
                                                           true,
                                                           true,
                                                           CIMPropertyList());
                          DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl));
                       }
                       catch (CIMException e)
                       {
                          DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
                          throw;
                       }
   
                       const CIMObjectPath& op  = ciRet->getPath();
                       CIMObjectPath        iop = ciRet->buildPath(cls);
   
                       JMPIjvm::checkException(env);
   
                       iop.setNameSpace(op.getNameSpace());
   
                       ciRet->setPath(iop);
                       /* Fix for 4237*/
   
                       handler.deliver(*ciRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_UNKNOWN:
           {
               DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: should not be here!"<<PEGASUS_STD(endl));
               break;
           }
           }
       }
       HandlerCatch(handler);
   
       if (env) JMPIjvm::detachThread();
   
       PEG_METHOD_EXIT();
   
       return(response);
   }
   
   Message * JMPIProviderManager::handleEnumerateInstanceNamesRequest(const Message * message) throw()
   {
       PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "JMPIProviderManager::handleEnumerateInstanceNamesRequest");
   
       HandlerIntro(EnumerateInstanceNames,message,request,response, handler);
  
     typedef enum {     typedef enum {
        METHOD_UNKNOWN = 0,        METHOD_UNKNOWN = 0,
        METHOD_PEGASUS_24,         METHOD_CIMINSTANCEPROVIDER,
        METHOD_PEGASUS_25,         METHOD_CIMINSTANCEPROVIDER2,
        METHOD_SNIA_PROVIDER20,         METHOD_INSTANCEPROVIDER,
          METHOD_INSTANCEPROVIDER2,
     } METHOD_VERSION;     } METHOD_VERSION;
     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;
     JNIEnv          *env           = NULL;     JNIEnv          *env           = NULL;
Line 1318 
Line 1592 
             request->operationContext.get(ProviderIdContainer::NAME));             request->operationContext.get(ProviderIdContainer::NAME));
  
         // get cached or load new provider module         // get cached or load new provider module
         JMPIProvider::OpProviderHolder ph =          JMPIProvider::OpProviderHolder ph = providerManager.getProvider (name.getPhysicalName(),
             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName());                                                                           name.getLogicalName());
  
         // convert arguments         // convert arguments
         OperationContext context;         OperationContext context;
Line 1342 
Line 1616 
         {         {
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
  
             STAT_COPYDISPATCHER  
   
             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
Line 1351 
Line 1623 
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;  
   
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
  
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
   
           if (interfaceType == "JMPI")
           {
         // public abstract java.util.Vector enumInstances (org.pegasus.jmpi.CIMObjectPath cop,         // public abstract java.util.Vector enumInstances (org.pegasus.jmpi.CIMObjectPath cop,
         //                                                 boolean                        deep,         //                                                 boolean                        deep,
         //                                                 org.pegasus.jmpi.CIMClass      cimClass)         //                                                 org.pegasus.jmpi.CIMClass      cimClass)
Line 1365 
Line 1643 
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_INSTANCEPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: found METHOD_INSTANCEPROVIDER."<<PEGASUS_STD(endl));
         }         }
  
         if (id == NULL)         if (id == NULL)
         {         {
             env->ExceptionClear();             env->ExceptionClear();
  
             // public org.pegasus.jmpi.CIMObjectPath[] enumerateInstanceNames (org.pegasus.jmpi.CIMObjectPath cop,                 // public org.pegasus.jmpi.CIMObjectPath[] enumerateInstanceNames (org.pegasus.jmpi.CIMObjectPath op,
             //                                                                 org.pegasus.jmpi.CIMClass      cimClass)                 //                                                                 org.pegasus.jmpi.CIMClass      cc)
             //         throws org.pegasus.jmpi.CIMException             //         throws org.pegasus.jmpi.CIMException
             id = env->GetMethodID((jclass)pr.jProviderClass,             id = env->GetMethodID((jclass)pr.jProviderClass,
                                   "enumerateInstanceNames",                                   "enumerateInstanceNames",
Line 1382 
Line 1660 
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_PEGASUS_24;                     eMethodFound = METHOD_CIMINSTANCEPROVIDER;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: found METHOD_CIMINSTANCEPROVIDER."<<PEGASUS_STD(endl));
             }             }
         }         }
           }
           else if (interfaceType == "JMPIExperimental")
           {
              // public abstract java.util.Vector enumerateInstanceNames (org.pegasus.jmpi.OperationContext oc
              //                                                          org.pegasus.jmpi.CIMObjectPath    cop,
              //                                                          org.pegasus.jmpi.CIMClass         cimClass)
              //         throws org.pegasus.jmpi.CIMException
              id = env->GetMethodID((jclass)pr.jProviderClass,
                                    "enumerateInstanceNames",
                                    "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_INSTANCEPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: found METHOD_INSTANCEPROVIDER2."<<PEGASUS_STD(endl));
              }
  
         if (id == NULL)         if (id == NULL)
         {         {
             env->ExceptionClear();             env->ExceptionClear();
  
             // public java.util.Vector enumerateInstanceNames (org.pegasus.jmpi.CIMObjectPath cop,                 // public abstract org.pegasus.jmpi.CIMObjectPath[] enumerateInstanceNames (org.pegasus.jmpi.OperationContext oc
                  //                                                                          org.pegasus.jmpi.CIMObjectPath    cop,
             //                                                 org.pegasus.jmpi.CIMClass      cimClass)             //                                                 org.pegasus.jmpi.CIMClass      cimClass)
             //         throws org.pegasus.jmpi.CIMException             //         throws org.pegasus.jmpi.CIMException
             id = env->GetMethodID((jclass)pr.jProviderClass,             id = env->GetMethodID((jclass)pr.jProviderClass,
                                   "enumerateInstanceNames",                                   "enumerateInstanceNames",
                                   "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;");                                       "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;)[Lorg/pegasus/jmpi/CIMObjectPath;");
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_PEGASUS_25;                     eMethodFound = METHOD_CIMINSTANCEPROVIDER2;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: found METHOD_PEGASUS_25."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: found METHOD_CIMINSTANCEPROVIDER2."<<PEGASUS_STD(endl));
                  }
             }             }
         }         }
  
         if (id == NULL)         if (id == NULL)
         {         {
            DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: No method found!"<<PEGASUS_STD(endl));            DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: No method found!"<<PEGASUS_STD(endl));
   
              PEG_METHOD_EXIT();
   
              throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                             MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND",
                                                                 "Could not find a method for the provider based on InterfaceType."));
         }         }
  
         JMPIjvm::checkException(env);         JMPIjvm::checkException(env);
  
         switch (eMethodFound)         switch (eMethodFound)
         {         {
         case METHOD_PEGASUS_24:          case METHOD_CIMINSTANCEPROVIDER:
           {
               jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
   
               JMPIjvm::checkException(env);
   
               CIMClass cls;
   
               try
               {
                  DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl));
                  AutoMutex lock (pr._cimomMutex);
   
                  cls = pr._cimom_handle->getClass(context,
                                                   request->nameSpace,
                                                   request->className,
                                                   false,
                                                   true,
                                                   true,
                                                   CIMPropertyList());
                  DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl));
               }
               catch (CIMException e)
               {
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
                  throw;
               }
   
               CIMClass *pcls = new CIMClass (cls);
   
               JMPIjvm::checkException(env);
   
               jlong   jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls);
               jobject jcimClass    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcimClassRef);
   
               JMPIjvm::checkException(env);
   
               StatProviderTimeMeasurement providerTime(response);
   
               jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                      id,
                                                                      jcop,
                                                                      jcimClass);
   
               JMPIjvm::checkException(env);
   
               handler.processing();
               if (jAr) {
                   for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
                       JMPIjvm::checkException(env);
   
                       jobject jcopRet = env->GetObjectArrayElement(jAr,i);
   
                       JMPIjvm::checkException(env);
   
                       jlong          jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
                       CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef);
   
                       JMPIjvm::checkException(env);
   
                       handler.deliver(*copRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_CIMINSTANCEPROVIDER2:
         {         {
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);              jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 1447 
Line 1820 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint    jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);              jlong   jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls);
             jobject jcimClass    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcimClassRef);              jobject jcimClass    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcimClassRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               StatProviderTimeMeasurement providerTime(response);
   
             jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,             jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                    id,                                                                    id,
                                                                      joc,
                                                                    jcop,                                                                    jcop,
                                                                    jcimClass);                                                                    jcimClass);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
  
             handler.processing();             handler.processing();
             if (jAr) {             if (jAr) {
Line 1470 
Line 1851 
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jint           jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);                      jlong          jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
                     CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRetRef);                      CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
Line 1482 
Line 1863 
             break;             break;
         }         }
  
         case METHOD_PEGASUS_25:          case METHOD_INSTANCEPROVIDER2:
         {         {
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);              jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 1515 
Line 1899 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint    jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);              jlong   jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls);
             jobject jcimClass    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcimClassRef);              jobject jcimClass    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcimClassRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               StatProviderTimeMeasurement providerTime(response);
   
             jobject jVec = env->CallObjectMethod((jobject)pr.jProvider,             jobject jVec = env->CallObjectMethod((jobject)pr.jProvider,
                                                  id,                                                  id,
                                                    joc,
                                                  jcop,                                                  jcop,
                                                  jcimClass);                                                  jcimClass);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
  
             handler.processing();             handler.processing();
             if (jVec) {             if (jVec) {
Line 1538 
Line 1930 
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jint           jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);                      jlong          jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
                     CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRetRef);                      CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
Line 1550 
Line 1942 
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          case METHOD_INSTANCEPROVIDER:
         {         {
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);              jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 1583 
Line 1975 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint    jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);              jlong   jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls);
             jobject jcimClass    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcimClassRef);              jobject jcimClass    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcimClassRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               StatProviderTimeMeasurement providerTime(response);
   
             jobject jVec = env->CallObjectMethod((jobject)pr.jProvider,             jobject jVec = env->CallObjectMethod((jobject)pr.jProvider,
                                                  id,                                                  id,
                                                  jcop,                                                  jcop,
Line 1596 
Line 1990 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;  
   
             handler.processing();             handler.processing();
             if (jVec) {             if (jVec) {
                 for (int i=0,m=env->CallIntMethod(jVec,JMPIjvm::jv.VectorSize); i<m; i++) {                 for (int i=0,m=env->CallIntMethod(jVec,JMPIjvm::jv.VectorSize); i<m; i++) {
Line 1607 
Line 1999 
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jint           jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);                      jlong          jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
                     CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRetRef);                      CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
Line 1632 
Line 2024 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
     STAT_COPYDISPATCHER  
   
     return(response);     return(response);
 } }
  
Line 1641 
Line 2031 
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleCreateInstanceRequest");     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleCreateInstanceRequest");
  
     HandlerIntro(CreateInstance,message,request,response,handler,CIMObjectPath());      HandlerIntro(CreateInstance,message,request,response,handler);
  
     typedef enum {     typedef enum {
        METHOD_UNKNOWN = 0,        METHOD_UNKNOWN = 0,
        METHOD_SNIA_PROVIDER20,         METHOD_INSTANCEPROVIDER, // same as METHOD_CIMINSTANCEPROVIDER
          METHOD_INSTANCEPROVIDER2 // same as METHOD_CIMINSTANCEPROVIDER2
     } METHOD_VERSION;     } METHOD_VERSION;
     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;
     JNIEnv          *env           = NULL;     JNIEnv          *env           = NULL;
Line 1670 
Line 2061 
             request->operationContext.get(ProviderIdContainer::NAME));             request->operationContext.get(ProviderIdContainer::NAME));
  
         // get cached or load new provider module         // get cached or load new provider module
         JMPIProvider::OpProviderHolder ph =          JMPIProvider::OpProviderHolder ph = providerManager.getProvider (name.getPhysicalName(),
             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(),                                                                           name.getLogicalName(),
               String::EMPTY);               String::EMPTY);
  
         // convert arguments  
         OperationContext context;  
   
         context.insert(request->operationContext.get(IdentityContainer::NAME));  
         context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));  
         context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));  
   
         // forward request         // forward request
         JMPIProvider &pr = ph.GetProvider();         JMPIProvider &pr = ph.GetProvider();
  
Line 1696 
Line 2080 
         {         {
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
  
             STAT_COPYDISPATCHER  
   
             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
Line 1705 
Line 2087 
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;  
   
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
  
         // public abstract org.pegasus.jmpi.CIMObjectPath createInstance (org.pegasus.jmpi.CIMObjectPath cop,          getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
   
           if (interfaceType == "JMPI")
           {
              // public org.pegasus.jmpi.CIMObjectPath createInstance (org.pegasus.jmpi.CIMObjectPath cop,
         //                                                                org.pegasus.jmpi.CIMInstance   cimInstance)         //                                                                org.pegasus.jmpi.CIMInstance   cimInstance)
         //        throws org.pegasus.jmpi.CIMException         //        throws org.pegasus.jmpi.CIMException
         id = env->GetMethodID((jclass)pr.jProviderClass,         id = env->GetMethodID((jclass)pr.jProviderClass,
Line 1718 
Line 2106 
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_INSTANCEPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateInstanceRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateInstanceRequest: found METHOD_INSTANCEPROVIDER."<<PEGASUS_STD(endl));
              }
           }
           else if (interfaceType == "JMPIExperimental")
           {
              // public org.pegasus.jmpi.CIMObjectPath createInstance (org.pegasus.jmpi.OperationContext oc
              //                                                       org.pegasus.jmpi.CIMObjectPath    cop,
              //                                                       org.pegasus.jmpi.CIMInstance      cimInstance)
              //        throws org.pegasus.jmpi.CIMException
              id = env->GetMethodID((jclass)pr.jProviderClass,
                                    "createInstance",
                                    "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMInstance;)Lorg/pegasus/jmpi/CIMObjectPath;");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_INSTANCEPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateInstanceRequest: found METHOD_INSTANCEPROVIDER2."<<PEGASUS_STD(endl));
              }
           }
   
           if (id == NULL)
           {
              DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateInstanceRequest: No method found!"<<PEGASUS_STD(endl));
   
              PEG_METHOD_EXIT();
   
              throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                             MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND",
                                                                 "Could not find a method for the provider based on InterfaceType."));
         }         }
  
         JMPIjvm::checkException(env);         JMPIjvm::checkException(env);
  
         switch (eMethodFound)         switch (eMethodFound)
         {         {
         case METHOD_SNIA_PROVIDER20:          case METHOD_INSTANCEPROVIDER:
           {
               jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
   
               JMPIjvm::checkException(env);
   
               CIMInstance *ci     = new CIMInstance (request->newInstance);
               jlong        jciRef = DEBUG_ConvertCToJava (CIMInstance*, jlong, ci);
               jobject      jci    = env->NewObject(jv->CIMInstanceClassRef,jv->CIMInstanceNewJ,jciRef);
   
               JMPIjvm::checkException(env);
   
               DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateInstanceRequest: id = "<<id<<", jcop = "<<jcop<<", jci = "<<jci<<PEGASUS_STD(endl));
   
               StatProviderTimeMeasurement providerTime(response);
   
               jobject jcopRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                       id,
                                                       jcop,
                                                       jci);
   
               JMPIjvm::checkException(env);
   
               handler.processing();
   
               if (jcopRet) {
                   jlong          jCopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
                   CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jCopRetRef);
   
                   handler.deliver(*copRet);
               }
               handler.complete();
               break;
           }
   
           case METHOD_INSTANCEPROVIDER2:
         {         {
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);              jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             CIMInstance *ci     = new CIMInstance (request->newInstance);             CIMInstance *ci     = new CIMInstance (request->newInstance);
             jint         jciRef = DEBUG_ConvertCToJava (CIMInstance*, jint, ci);              jlong        jciRef = DEBUG_ConvertCToJava (CIMInstance*, jlong, ci);
             jobject      jci    = env->NewObject(jv->CIMInstanceClassRef,jv->CIMInstanceNewI,jciRef);              jobject      jci    = env->NewObject(jv->CIMInstanceClassRef,jv->CIMInstanceNewJ,jciRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateInstanceRequest: id = "<<id<<", jcop = "<<jcop<<", jci = "<<jci<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateInstanceRequest: id = "<<id<<", jcop = "<<jcop<<", jci = "<<jci<<PEGASUS_STD(endl));
  
               StatProviderTimeMeasurement providerTime(response);
   
             jobject jcopRet = env->CallObjectMethod((jobject)pr.jProvider,             jobject jcopRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                     id,                                                     id,
                                                       joc,
                                                     jcop,                                                     jcop,
                                                     jci);                                                     jci);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
  
             handler.processing();             handler.processing();
  
             if (jcopRet) {             if (jcopRet) {
                 jint           jCopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);                  jlong          jCopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
                 CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jCopRetRef);                  CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jCopRetRef);
  
                 handler.deliver(*copRet);                 handler.deliver(*copRet);
             }             }
Line 1775 
Line 2238 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
     STAT_COPYDISPATCHER  
   
     return(response);     return(response);
 } }
  
Line 1784 
Line 2245 
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleModifyInstanceRequest");     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleModifyInstanceRequest");
  
     HandlerIntroVoid(ModifyInstance,message,request,response,handler);      HandlerIntro(ModifyInstance,message,request,response,handler);
  
     typedef enum {     typedef enum {
        METHOD_UNKNOWN = 0,        METHOD_UNKNOWN = 0,
        METHOD_PEGASUS_24,         METHOD_CIMINSTANCEPROVIDER,
        METHOD_SNIA_PROVIDER20,         METHOD_INSTANCEPROVIDER,
          METHOD_INSTANCEPROVIDER2, // same as METHOD_CIMINSTANCEPROVIDER2
     } METHOD_VERSION;     } METHOD_VERSION;
     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;
     JNIEnv          *env           = NULL;     JNIEnv          *env           = NULL;
Line 1816 
Line 2278 
         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleModifyInstanceRequest: provider name physical = "<<name.getPhysicalName()<<", logical = "<<name.getLogicalName()<<PEGASUS_STD(endl));         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleModifyInstanceRequest: provider name physical = "<<name.getPhysicalName()<<", logical = "<<name.getLogicalName()<<PEGASUS_STD(endl));
  
         // get cached or load new provider module         // get cached or load new provider module
         JMPIProvider::OpProviderHolder ph =          JMPIProvider::OpProviderHolder ph = providerManager.getProvider (name.getPhysicalName(),
             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);                                                                           name.getLogicalName(),
                                                                            String::EMPTY);
         // convert arguments  
         OperationContext context;  
   
         context.insert(request->operationContext.get(IdentityContainer::NAME));  
         context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));  
         context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));  
  
         // forward request         // forward request
         JMPIProvider &pr = ph.GetProvider();         JMPIProvider &pr = ph.GetProvider();
  
         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,"Calling provider.modifyInstance: " + pr.getName());         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,"Calling provider.modifyInstance: " + pr.getName());
  
         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleModifyInstanceRequest: Calling provider "<<PEGASUS_STD(hex)<<(int)&pr<<PEGASUS_STD(dec)<<", name = "<<pr.getName ()<<", module = "<<pr.getModule()<<" modifyInstance: "<<pr.getName()<<PEGASUS_STD(endl));          DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleModifyInstanceRequest: Calling provider "<<PEGASUS_STD(hex)<<(long)&pr<<PEGASUS_STD(dec)<<", name = "<<pr.getName ()<<", module = "<<pr.getModule()<<" modifyInstance: "<<pr.getName()<<PEGASUS_STD(endl));
  
         JvmVector *jv = 0;         JvmVector *jv = 0;
  
Line 1841 
Line 2297 
         {         {
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
  
             STAT_COPYDISPATCHER  
   
             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
Line 1850 
Line 2304 
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;  
   
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
  
           if (interfaceType == "JMPI")
           {
         // public abstract void setInstance (org.pegasus.jmpi.CIMObjectPath cop,         // public abstract void setInstance (org.pegasus.jmpi.CIMObjectPath cop,
         //                                   org.pegasus.jmpi.CIMInstance   cimInstance)         //                                   org.pegasus.jmpi.CIMInstance   cimInstance)
         //        org.pegasus.jmpi.throws CIMException         //        org.pegasus.jmpi.throws CIMException
Line 1863 
Line 2323 
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_INSTANCEPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleModifyInstanceRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleModifyInstanceRequest: found METHOD_INSTANCEPROVIDER."<<PEGASUS_STD(endl));
         }         }
  
         if (id == NULL)         if (id == NULL)
Line 1882 
Line 2342 
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_PEGASUS_24;                     eMethodFound = METHOD_CIMINSTANCEPROVIDER;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleModifyInstanceRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleModifyInstanceRequest: found METHOD_CIMINSTANCEPROVIDER."<<PEGASUS_STD(endl));
                  }
              }
           }
           else if (interfaceType == "JMPIExperimental")
           {
              // public abstract void setInstance (org.pegasus.jmpi.OperationContext oc,
              //                                   org.pegasus.jmpi.CIMObjectPath    op,
              //                                   org.pegasus.jmpi.CIMInstance      cimInstance);
              //        throws org.pegasus.jmpi.CIMException
              id = env->GetMethodID((jclass)pr.jProviderClass,
                                    "setInstance",
                                    "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMInstance;)V");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_INSTANCEPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleModifyInstanceRequest: found METHOD_INSTANCEPROVIDER2."<<PEGASUS_STD(endl));
              }
             }             }
   
           if (id == NULL)
           {
              DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleModifyInstanceRequest: No method found!"<<PEGASUS_STD(endl));
   
              PEG_METHOD_EXIT();
   
              throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                             MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND",
                                                                 "Could not find a method for the provider based on InterfaceType."));
         }         }
  
         JMPIjvm::checkException(env);         JMPIjvm::checkException(env);
  
         switch (eMethodFound)         switch (eMethodFound)
         {         {
         case METHOD_PEGASUS_24:          case METHOD_INSTANCEPROVIDER2:
           {
               jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
   
               JMPIjvm::checkException(env);
   
               CIMInstance *ci     = new CIMInstance (request->modifiedInstance);
               jlong        jciRef = DEBUG_ConvertCToJava (CIMInstance*, jlong, ci);
               jobject      jci    = env->NewObject(jv->CIMInstanceClassRef,jv->CIMInstanceNewJ,jciRef);
   
               JMPIjvm::checkException(env);
   
               jobjectArray jPropertyList = getList(jv,env,request->propertyList);
   
               StatProviderTimeMeasurement providerTime(response);
   
               env->CallVoidMethod((jobject)pr.jProvider,
                                   id,
                                   joc,
                                   jcop,
                                   jci);
   
               JMPIjvm::checkException(env);
   
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
               break;
           }
   
           case METHOD_CIMINSTANCEPROVIDER:
         {         {
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);              jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             CIMInstance *ci     = new CIMInstance (request->modifiedInstance);             CIMInstance *ci     = new CIMInstance (request->modifiedInstance);
             jint         jciRef = DEBUG_ConvertCToJava (CIMInstance*, jint, ci);              jlong        jciRef = DEBUG_ConvertCToJava (CIMInstance*, jlong, ci);
             jobject      jci    = env->NewObject(jv->CIMInstanceClassRef,jv->CIMInstanceNewI,jciRef);              jobject      jci    = env->NewObject(jv->CIMInstanceClassRef,jv->CIMInstanceNewJ,jciRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jobjectArray jPropertyList = getList(jv,env,request->propertyList);             jobjectArray jPropertyList = getList(jv,env,request->propertyList);
  
               StatProviderTimeMeasurement providerTime(response);
   
             env->CallVoidMethod((jobject)pr.jProvider,             env->CallVoidMethod((jobject)pr.jProvider,
                                 id,                                 id,
                                 jcop,                                 jcop,
Line 1914 
Line 2441 
                                 jPropertyList);                                 jPropertyList);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
   
             STAT_PMS_PROVIDEREND;  
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          case METHOD_INSTANCEPROVIDER:
         {         {
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);              jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             CIMInstance *ci     = new CIMInstance (request->modifiedInstance);             CIMInstance *ci     = new CIMInstance (request->modifiedInstance);
             jint         jciRef = DEBUG_ConvertCToJava (CIMInstance*, jint, ci);              jlong        jciRef = DEBUG_ConvertCToJava (CIMInstance*, jlong, ci);
             jobject      jci    = env->NewObject(jv->CIMInstanceClassRef,jv->CIMInstanceNewI,jciRef);              jobject      jci    = env->NewObject(jv->CIMInstanceClassRef,jv->CIMInstanceNewJ,jciRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               StatProviderTimeMeasurement providerTime(response);
   
             env->CallVoidMethod((jobject)pr.jProvider,             env->CallVoidMethod((jobject)pr.jProvider,
                                 id,                                 id,
                                 jcop,                                 jcop,
                                 jci);                                 jci);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
   
             STAT_PMS_PROVIDEREND;  
             break;             break;
         }         }
  
Line 1956 
Line 2481 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
     STAT_COPYDISPATCHER  
   
     return(response);     return(response);
 } }
  
Line 1965 
Line 2488 
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleDeleteInstanceRequest");     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleDeleteInstanceRequest");
  
     HandlerIntroVoid(DeleteInstance,message,request,response,handler);      HandlerIntro(DeleteInstance,message,request,response,handler);
  
     typedef enum {     typedef enum {
        METHOD_UNKNOWN = 0,        METHOD_UNKNOWN = 0,
        METHOD_SNIA_PROVIDER20,         METHOD_INSTANCEPROVIDER,  // same as METHOD_CIMINSTANCEPROVIDER
          METHOD_INSTANCEPROVIDER2, // same as METHOD_CIMINSTANCEPROVIDER2
     } METHOD_VERSION;     } METHOD_VERSION;
     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;
     JNIEnv          *env           = NULL;     JNIEnv          *env           = NULL;
Line 1994 
Line 2518 
             request->operationContext.get(ProviderIdContainer::NAME));             request->operationContext.get(ProviderIdContainer::NAME));
  
         // get cached or load new provider module         // get cached or load new provider module
         JMPIProvider::OpProviderHolder ph =          JMPIProvider::OpProviderHolder ph = providerManager.getProvider (name.getPhysicalName(),
             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);                                                                           name.getLogicalName(),
                                                                            String::EMPTY);
         // convert arguments  
         OperationContext context;  
   
         context.insert(request->operationContext.get(IdentityContainer::NAME));  
         context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));  
         context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));  
  
         // forward request         // forward request
         JMPIProvider &pr = ph.GetProvider();         JMPIProvider &pr = ph.GetProvider();
Line 2019 
Line 2537 
         {         {
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
  
             STAT_COPYDISPATCHER  
   
             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
Line 2028 
Line 2544 
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;  
   
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
  
           if (interfaceType == "JMPI")
           {
         // public abstract void deleteInstance (org.pegasus.jmpi.CIMObjectPath cop)         // public abstract void deleteInstance (org.pegasus.jmpi.CIMObjectPath cop)
         //        throws org.pegasus.jmpi.CIMException         //        throws org.pegasus.jmpi.CIMException
         id = env->GetMethodID((jclass)pr.jProviderClass,         id = env->GetMethodID((jclass)pr.jProviderClass,
Line 2040 
Line 2562 
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_INSTANCEPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteInstanceRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteInstanceRequest: found METHOD_INSTANCEPROVIDER."<<PEGASUS_STD(endl));
              }
           }
           else if (interfaceType == "JMPIExperimental")
           {
              // public abstract void deleteInstance (org.pegasus.jmpi.OperationContext oc,
              //                                      org.pegasus.jmpi.CIMObjectPath    cop)
              //        throws org.pegasus.jmpi.CIMException
              id = env->GetMethodID((jclass)pr.jProviderClass,
                                    "deleteInstance",
                                    "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;)V");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_INSTANCEPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteInstanceRequest: found METHOD_INSTANCEPROVIDER2."<<PEGASUS_STD(endl));
              }
           }
   
           if (id == NULL)
           {
              DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteInstanceRequest: No method found!"<<PEGASUS_STD(endl));
   
              PEG_METHOD_EXIT();
   
              throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                             MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND",
                                                                 "Could not find a method for the provider based on InterfaceType."));
         }         }
  
         JMPIjvm::checkException(env);         JMPIjvm::checkException(env);
  
         switch (eMethodFound)         switch (eMethodFound)
         {         {
         case METHOD_SNIA_PROVIDER20:          case METHOD_INSTANCEPROVIDER2:
         {         {
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);              jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               StatProviderTimeMeasurement providerTime(response);
   
             env->CallVoidMethod((jobject)pr.jProvider,             env->CallVoidMethod((jobject)pr.jProvider,
                                 id,                                 id,
                                   joc,
                                 jcop);                                 jcop);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
               break;
           }
   
           case METHOD_INSTANCEPROVIDER:
           {
               jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
   
               JMPIjvm::checkException(env);
   
               StatProviderTimeMeasurement providerTime(response);
   
               env->CallVoidMethod((jobject)pr.jProvider,
                                   id,
                                   jcop);
   
               JMPIjvm::checkException(env);
             break;             break;
         }         }
  
Line 2078 
Line 2655 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
     STAT_COPYDISPATCHER  
   
     return(response);     return(response);
 } }
  
Line 2087 
Line 2662 
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleExecQueryRequest");     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleExecQueryRequest");
  
     HandlerIntro(ExecQuery,message,request,response,handler,Array<CIMObject>());      HandlerIntro(ExecQuery,message,request,response,handler);
  
     typedef enum {     typedef enum {
        METHOD_UNKNOWN = 0,        METHOD_UNKNOWN = 0,
        METHOD_PEGASUS_24,         METHOD_CIMINSTANCEPROVIDER,
        METHOD_PEGASUS_25,         METHOD_CIMINSTANCEPROVIDER2,
        METHOD_SNIA_PROVIDER20,         METHOD_INSTANCEPROVIDER,
          METHOD_INSTANCEPROVIDER2,
     } METHOD_VERSION;     } METHOD_VERSION;
     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;
     JNIEnv          *env           = NULL;     JNIEnv          *env           = NULL;
Line 2117 
Line 2693 
             request->operationContext.get(ProviderIdContainer::NAME));             request->operationContext.get(ProviderIdContainer::NAME));
  
         // get cached or load new provider module         // get cached or load new provider module
         JMPIProvider::OpProviderHolder ph =          JMPIProvider::OpProviderHolder ph = providerManager.getProvider (name.getPhysicalName(),
             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);                                                                           name.getLogicalName(),
                                                                            String::EMPTY);
  
         // convert arguments         // convert arguments
         OperationContext context;         OperationContext context;
Line 2142 
Line 2719 
         {         {
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
  
             STAT_COPYDISPATCHER  
   
             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
Line 2151 
Line 2726 
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;  
   
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
  
           if (interfaceType == "JMPI")
           {
         // public abstract java.util.Vector execQuery (org.pegasus.jmpi.CIMObjectPath cop,         // public abstract java.util.Vector execQuery (org.pegasus.jmpi.CIMObjectPath cop,
         //                                             java.lang.String               queryStatement,         //                                             java.lang.String               queryStatement,
         //                                             int                            ql,         //                                             int                            ql,
Line 2167 
Line 2748 
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_INSTANCEPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: found METHOD_INSTANCEPROVIDER."<<PEGASUS_STD(endl));
         }         }
  
         if (id == NULL)         if (id == NULL)
Line 2186 
Line 2767 
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_PEGASUS_24;                     eMethodFound = METHOD_CIMINSTANCEPROVIDER;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: found METHOD_CIMINSTANCEPROVIDER."<<PEGASUS_STD(endl));
                  }
             }             }
         }         }
           else if (interfaceType == "JMPIExperimental")
           {
              // public abstract java.util.Vector execQuery (org.pegasus.jmpi.OperationContext oc,
              //                                             org.pegasus.jmpi.CIMObjectPath    cop,
              //                                             org.pegasus.jmpi.CIMClass         cimClass,
              //                                             java.lang.String                  queryStatement,
              //                                             java.lang.String                  queryLanguage)
              //        throws org.pegasus.jmpi.CIMException
              id = env->GetMethodID((jclass)pr.jProviderClass,
                                    "execQuery",
                                    "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector;");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_INSTANCEPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: found METHOD_INSTANCEPROVIDER2."<<PEGASUS_STD(endl));
              }
  
         if (id == NULL)         if (id == NULL)
         {         {
             env->ExceptionClear();             env->ExceptionClear();
  
             // public abstract java.util.Vector execQuery(org.pegasus.jmpi.CIMObjectPath cop,                 // public abstract org.pegasus.jmpi.CIMInstance[] execQuery (org.pegasus.jmpi.OperationContext oc,
                  //                                                           org.pegasus.jmpi.CIMObjectPath    cop,
             //                                            org.pegasus.jmpi.CIMClass      cimClass,             //                                            org.pegasus.jmpi.CIMClass      cimClass,
             //                                            java.lang.String               query,                 //                                                           java.lang.String                  queryStatement,
             //                                            java.lang.String               ql)                 //                                                           java.lang.String                  queryLanguage)
             //        throws org.pegasus.jmpi.CIMException             //        throws org.pegasus.jmpi.CIMException
             id = env->GetMethodID((jclass)pr.jProviderClass,             id = env->GetMethodID((jclass)pr.jProviderClass,
                                   "execQuery",                                   "execQuery",
                                   "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector;");                                       "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;Ljava/lang/String;Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMInstance;");
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_PEGASUS_25;                     eMethodFound = METHOD_CIMINSTANCEPROVIDER2;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: found METHOD_PEGASUS_25."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: found METHOD_CIMINSTANCEPROVIDER2."<<PEGASUS_STD(endl));
                  }
             }             }
         }         }
  
         if (id == NULL)         if (id == NULL)
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: found no method!"<<PEGASUS_STD(endl));             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: found no method!"<<PEGASUS_STD(endl));
   
               PEG_METHOD_EXIT();
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND",
                                                                  "Could not find a method for the provider based on InterfaceType."));
         }         }
  
         JMPIjvm::checkException(env);         JMPIjvm::checkException(env);
  
         switch (eMethodFound)         switch (eMethodFound)
         {         {
         case METHOD_PEGASUS_24:          case METHOD_CIMINSTANCEPROVIDER:
         {         {
             jint    jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewI, jcopref);              jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewJ, jcopref);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 2256 
Line 2863 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint jcls = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);              jlong jcls = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls);
  
             jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcls);              jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcls);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               StatProviderTimeMeasurement providerTime(response);
   
             jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,             jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                    id,                                                                    id,
                                                                    jcop,                                                                    jcop,
Line 2271 
Line 2880 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;  
   
             handler.processing();             handler.processing();
             if (jAr) {             if (jAr) {
                 for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {                 for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
Line 2282 
Line 2889 
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);                      jlong        jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                     CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                      CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
Line 2294 
Line 2901 
             break;             break;
         }         }
  
         case METHOD_PEGASUS_25:          case METHOD_CIMINSTANCEPROVIDER2:
         {         {
             jint    jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewI, jcopref);              jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewJ, jcopref);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 2330 
Line 2940 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint jcls = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);              jlong jcls = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls);
  
             jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcls);              jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcls);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jobjectArray jVec = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,              StatProviderTimeMeasurement providerTime(response);
   
               jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                      id,
                                                                      joc,
                                                                      jcop,
                                                                      jquery,
                                                                      jqueryLanguage,
                                                                      jCc);
   
               JMPIjvm::checkException(env);
   
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
   
               handler.processing();
               if (jAr) {
                   for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
                       JMPIjvm::checkException(env);
   
                       jobject jciRet = env->GetObjectArrayElement(jAr,i);
   
                       JMPIjvm::checkException(env);
   
                       jlong        jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                       CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
   
                       JMPIjvm::checkException(env);
   
                       handler.deliver(*ciRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_INSTANCEPROVIDER2:
           {
               jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewJ, jcopref);
   
               JMPIjvm::checkException(env);
   
               jstring jqueryLanguage = env->NewStringUTF(request->queryLanguage.getCString());
               jstring jquery         = env->NewStringUTF(request->query.getCString());
   
               CIMClass cls;
   
               try
               {
                  DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl));
                  AutoMutex lock (pr._cimomMutex);
   
                  cls = pr._cimom_handle->getClass(context,
                                                   request->nameSpace,
                                                   request->className,
                                                   false,
                                                   true,
                                                   true,
                                                   CIMPropertyList());
                  DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl));
               }
               catch (CIMException e)
               {
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
                  throw;
               }
   
               CIMClass *pcls = new CIMClass (cls);
   
               jlong jcls = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls);
   
               jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcls);
   
               JMPIjvm::checkException(env);
   
               StatProviderTimeMeasurement providerTime(response);
   
               jobject jVec = env->CallObjectMethod ((jobject)pr.jProvider,
                                                                    id,                                                                    id,
                                                     joc,
                                                                    jcop,                                                                    jcop,
                                                                    jCc,                                                                    jCc,
                                                                    jquery,                                                                    jquery,
Line 2345 
Line 3041 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
  
             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);
                       DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: jciRet = "<<jciRet<<PEGASUS_STD(endl));
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);                      jlong        jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                     CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                      CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     handler.deliver(*ciRet);                     handler.deliver(*ciRet);
                 }                 }
             }             }
               DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: done!"<<PEGASUS_STD(endl));
             handler.complete();             handler.complete();
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          case METHOD_INSTANCEPROVIDER:
         {         {
             jint    jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewI, jcopref);              jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewJ, jcopref);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 2404 
Line 3109 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint jcls = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);              jlong jcls = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls);
  
             jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcls);              jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcls);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint jql = 0; // @BUG - how to convert?              jlong jql = 0; // @BUG - how to convert?
  
             jobjectArray jVec = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,              StatProviderTimeMeasurement providerTime(response);
   
               jobject jVec = env->CallObjectMethod ((jobject)pr.jProvider,
                                                                     id,                                                                     id,
                                                                     jcop,                                                                     jcop,
                                                                     jquery,                                                                     jquery,
Line 2421 
Line 3128 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;  
   
             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);
  
                     jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);                      jlong        jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                     CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                      CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
Line 2457 
Line 3162 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
     STAT_COPYDISPATCHER  
   
     return(response);     return(response);
 } }
  
Line 2466 
Line 3169 
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleAssociatorsRequest");     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleAssociatorsRequest");
  
     HandlerIntro(Associators,message,request,response,handler,Array<CIMObject>());      HandlerIntro(Associators,message,request,response,handler);
  
     typedef enum {     typedef enum {
        METHOD_UNKNOWN = 0,        METHOD_UNKNOWN = 0,
        METHOD_PEGASUS_24,         METHOD_CIMASSOCIATORPROVIDER,
        METHOD_SNIA_PROVIDER20,         METHOD_CIMASSOCIATORPROVIDER2,
          METHOD_ASSOCIATORPROVIDER,
          METHOD_ASSOCIATORPROVIDER2,
     } METHOD_VERSION;     } METHOD_VERSION;
     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;
     JNIEnv          *env           = NULL;     JNIEnv          *env           = NULL;
Line 2499 
Line 3204 
             request->operationContext.get(ProviderIdContainer::NAME));             request->operationContext.get(ProviderIdContainer::NAME));
  
         // get cached or load new provider module         // get cached or load new provider module
         JMPIProvider::OpProviderHolder ph =          JMPIProvider::OpProviderHolder ph = providerManager.getProvider (name.getPhysicalName(),
             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);                                                                           name.getLogicalName(),
                                                                            String::EMPTY);
  
         // convert arguments         // convert arguments
         OperationContext context;         OperationContext context;
Line 2524 
Line 3230 
         {         {
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
  
             STAT_COPYDISPATCHER  
   
             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
Line 2533 
Line 3237 
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;  
   
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
  
         // public abstract java.util.Vector associators (org.pegasus.jmpi.CIMObjectPath assocName,          if (interfaceType == "JMPI")
           {
              // public java.util.Vector associators (org.pegasus.jmpi.CIMObjectPath assocName,
         //                                               org.pegasus.jmpi.CIMObjectPath pathName,         //                                               org.pegasus.jmpi.CIMObjectPath pathName,
         //                                               java.lang.String               resultClass,         //                                               java.lang.String               resultClass,
         //                                               java.lang.String               role,         //                                               java.lang.String               role,
Line 2550 
Line 3260 
         id = env->GetMethodID((jclass)pr.jProviderClass,         id = env->GetMethodID((jclass)pr.jProviderClass,
                               "associators",                               "associators",
                               "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;");                               "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;");
 //@BUG was:                   "(Lorg/pegasus/jmpi/CIMObjectPath;                                Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;"  
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_ASSOCIATORPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found METHOD_ASSOCIATORPROVIDER."<<PEGASUS_STD(endl));
         }         }
  
         if (id == NULL)         if (id == NULL)
         {         {
             env->ExceptionClear();             env->ExceptionClear();
  
             // public abstract java.util.Vector associators (org.pegasus.jmpi.CIMObjectPath assocName,                 // public org.pegasus.jmpi.CIMInstance[] associators (org.pegasus.jmpi.CIMObjectPath assocName,
                  //                                                    org.pegasus.jmpi.CIMObjectPath pathName,
             //                                               java.lang.String               resultClass,             //                                               java.lang.String               resultClass,
             //                                               java.lang.String               role,             //                                               java.lang.String               role,
             //                                               java.lang.String               resultRole,             //                                               java.lang.String               resultRole,
Line 2573 
Line 3283 
             //             //
             id = env->GetMethodID((jclass)pr.jProviderClass,             id = env->GetMethodID((jclass)pr.jProviderClass,
                                   "associators",                                   "associators",
                                   "(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;");                                       "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ[Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMInstance;");
 //@BUG was:                       "(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ[Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMInstance;"  
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_PEGASUS_24;                     eMethodFound = METHOD_CIMASSOCIATORPROVIDER;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found METHOD_CIMASSOCIATORPROVIDER."<<PEGASUS_STD(endl));
             }             }
         }         }
           }
           else if (interfaceType == "JMPIExperimental")
           {
              // public java.util.Vector associators (org.pegasus.jmpi.OperationContext oc,
              //                                      org.pegasus.jmpi.CIMObjectPath    assocName,
              //                                      org.pegasus.jmpi.CIMObjectPath    pathName,
              //                                      java.lang.String                  resultClass,
              //                                      java.lang.String                  role,
              //                                      java.lang.String                  resultRole,
              //                                      boolean                           includeQualifiers,
              //                                      boolean                           includeClassOrigin,
              //                                      java.lang.String[]                propertyList)
              //        throws org.pegasus.jmpi.CIMException
              //
              id = env->GetMethodID((jclass)pr.jProviderClass,
                                    "associators",
                                    "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;");
  
         if (id == NULL)             if (id != NULL)
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found no method!"<<PEGASUS_STD(endl));                 eMethodFound = METHOD_ASSOCIATORPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found METHOD_ASSOCIATORPROVIDER2."<<PEGASUS_STD(endl));
         }         }
  
         JMPIjvm::checkException(env);             if (id == NULL)
   
         switch (eMethodFound)  
         {  
         case METHOD_PEGASUS_24:  
         {         {
             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, assocPath);                 env->ExceptionClear();
             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);  
                  // public org.pegasus.jmpi.CIMInstance[] associators (org.pegasus.jmpi.OperationContext oc,
             JMPIjvm::checkException(env);                 //                                                    org.pegasus.jmpi.CIMObjectPath assocName,
                  //                                                    org.pegasus.jmpi.CIMObjectPath pathName,
                  //                                                    java.lang.String               resultClass,
                  //                                                    java.lang.String               role,
                  //                                                    java.lang.String               resultRole,
                  //                                                    boolean                        includeQualifiers,
                  //                                                    boolean                        includeClassOrigin,
                  //                                                    java.lang.String[]             propertyList)
                  //        throws org.pegasus.jmpi.CIMException
                  //
                  id = env->GetMethodID((jclass)pr.jProviderClass,
                                        "associators",
                                        "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ[Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMInstance;");
   
                  if (id != NULL)
                  {
                      eMethodFound = METHOD_CIMASSOCIATORPROVIDER2;
                      DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found METHOD_CIMASSOCIATORPROVIDER2."<<PEGASUS_STD(endl));
                  }
              }
           }
   
           if (id == NULL)
           {
               DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found no method!"<<PEGASUS_STD(endl));
   
               PEG_METHOD_EXIT();
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND",
                                                                  "Could not find a method for the provider based on InterfaceType."));
           }
   
           JMPIjvm::checkException(env);
   
           switch (eMethodFound)
           {
           case METHOD_CIMASSOCIATORPROVIDER:
           {
               jlong   jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, assocPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef);
   
               JMPIjvm::checkException(env);
   
               jlong   jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef);
   
               JMPIjvm::checkException(env);
   
               jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString());
               jstring jRole        = env->NewStringUTF(request->role.getCString());
               jstring jResultRole  = env->NewStringUTF(request->resultRole.getCString());
   
               JMPIjvm::checkException(env);
   
               jobjectArray jPropertyList = getList(jv,env,request->propertyList);
   
   #ifdef PEGASUS_DEBUG
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: assocName          = "<<assocPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: pathName           = "<<objectPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultClass        = "<<request->resultClass<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: role               = "<<request->role<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultRole         = "<<request->resultRole<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeQualifiers  = "<<false<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));
   #endif
   
               StatProviderTimeMeasurement providerTime(response);
   
               jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     jAssociationName,
                                                                     jPathName,
                                                                     jResultClass,
                                                                     jRole,
                                                                     jResultRole,
                                                                     JMPI_INCLUDE_QUALIFIERS,
                                                                     request->includeClassOrigin,
                                                                     jPropertyList);
   
               JMPIjvm::checkException(env);
   
               handler.processing();
               if (jAr) {
                   for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
                       JMPIjvm::checkException(env);
   
                       jobject jciRet = env->GetObjectArrayElement(jAr,i);
   
                       JMPIjvm::checkException(env);
   
                       jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
   
                       JMPIjvm::checkException(env);
   
                       CIMInstance         *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
                       CIMClass             cls;
   
                       try
                       {
                          DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl));
                          AutoMutex lock (pr._cimomMutex);
   
                          cls = pr._cimom_handle->getClass(context,
                                                           request->nameSpace,
                                                           ciRet->getClassName(),
                                                           false,
                                                           true,
                                                           true,
                                                           CIMPropertyList());
                          DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl));
                       }
                       catch (CIMException e)
                       {
                          DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
                          throw;
                       }
   
                       const CIMObjectPath& op    = ciRet->getPath();
                       CIMObjectPath        iop   = ciRet->buildPath(cls);
   
                       JMPIjvm::checkException(env);
   
                       iop.setNameSpace(op.getNameSpace());
                       ciRet->setPath(iop);
   
                       handler.deliver(*ciRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_CIMASSOCIATORPROVIDER2:
           {
               jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, assocPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef);
   
               JMPIjvm::checkException(env);
   
               jlong   jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef);
   
               JMPIjvm::checkException(env);
   
               jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString());
               jstring jRole        = env->NewStringUTF(request->role.getCString());
               jstring jResultRole  = env->NewStringUTF(request->resultRole.getCString());
   
               JMPIjvm::checkException(env);
   
               jobjectArray jPropertyList = getList(jv,env,request->propertyList);
   
   #ifdef PEGASUS_DEBUG
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: assocName          = "<<assocPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: pathName           = "<<objectPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultClass        = "<<request->resultClass<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: role               = "<<request->role<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultRole         = "<<request->resultRole<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeQualifiers  = "<<false<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));
   #endif
   
               StatProviderTimeMeasurement providerTime(response);
   
               jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     joc,
                                                                     jAssociationName,
                                                                     jPathName,
                                                                     jResultClass,
                                                                     jRole,
                                                                     jResultRole,
                                                                     JMPI_INCLUDE_QUALIFIERS,
                                                                     request->includeClassOrigin,
                                                                     jPropertyList);
   
               JMPIjvm::checkException(env);
   
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
   
               handler.processing();
               if (jAr) {
                   for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
                       JMPIjvm::checkException(env);
   
                       jobject jciRet = env->GetObjectArrayElement(jAr,i);
   
                       JMPIjvm::checkException(env);
   
                       jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
   
                       JMPIjvm::checkException(env);
   
                       CIMInstance         *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
                       CIMClass             cls;
   
                       try
                       {
                          DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl));
                          AutoMutex lock (pr._cimomMutex);
   
                          cls = pr._cimom_handle->getClass(context,
                                                           request->nameSpace,
                                                           ciRet->getClassName(),
                                                           false,
                                                           true,
                                                           true,
                                                           CIMPropertyList());
                          DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl));
                       }
                       catch (CIMException e)
                       {
                          DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
                          throw;
                       }
   
                       const CIMObjectPath& op    = ciRet->getPath();
                       CIMObjectPath        iop   = ciRet->buildPath(cls);
   
                       JMPIjvm::checkException(env);
   
                       iop.setNameSpace(op.getNameSpace());
                       ciRet->setPath(iop);
   
                       handler.deliver(*ciRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_ASSOCIATORPROVIDER2:
           {
               jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, assocPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef);
   
               JMPIjvm::checkException(env);
   
               jlong   jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef);
   
               JMPIjvm::checkException(env);
  
             jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString());             jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString());
             jstring jRole        = env->NewStringUTF(request->role.getCString());             jstring jRole        = env->NewStringUTF(request->role.getCString());
Line 2609 
Line 3585 
  
 #ifdef PEGASUS_DEBUG #ifdef PEGASUS_DEBUG
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: assocName          = "<<assocPath->toString ()<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: assocName          = "<<assocPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: pathName           = "<<objectPath->toString ()<<PEGASUS_STD(endl));
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultClass        = "<<request->resultClass<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultClass        = "<<request->resultClass<<PEGASUS_STD(endl));
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: role               = "<<request->role<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: role               = "<<request->role<<PEGASUS_STD(endl));
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultRole         = "<<request->resultRole<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultRole         = "<<request->resultRole<<PEGASUS_STD(endl));
Line 2616 
Line 3593 
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));
 #endif #endif
  
               StatProviderTimeMeasurement providerTime(response);
   
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                   id,                                                                   id,
                                                                     joc,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                     jPathName,
                                                                   jResultClass,                                                                   jResultClass,
                                                                   jRole,                                                                   jRole,
                                                                   jResultRole,                                                                   jResultRole,
Line 2628 
Line 3609 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
  
             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);
  
                     jint jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);                      jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     CIMInstance         *ciRet = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                      CIMInstance         *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
                     CIMClass             cls;                     CIMClass             cls;
  
                     try                     try
Line 2681 
Line 3667 
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          case METHOD_ASSOCIATORPROVIDER:
         {         {
             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, assocPath);              jlong   jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, assocPath);
             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);              jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint    jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
             jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jPathNameRef);              jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 2711 
Line 3697 
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));
 #endif #endif
  
               StatProviderTimeMeasurement providerTime(response);
   
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                  id,                                                                  id,
                                                                  jAssociationName,                                                                  jAssociationName,
Line 2724 
Line 3712 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;  
   
             handler.processing();             handler.processing();
             if (jVec) {             if (jVec) {
                 for (int i=0,m=env->CallIntMethod(jVec,JMPIjvm::jv.VectorSize); i<m; i++) {                 for (int i=0,m=env->CallIntMethod(jVec,JMPIjvm::jv.VectorSize); i<m; i++) {
Line 2735 
Line 3721 
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jint                 jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);                      jlong                jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                     CIMInstance         *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                      CIMInstance         *ciRet     = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
                     CIMClass             cls;                     CIMClass             cls;
  
                     try                     try
Line 2787 
Line 3773 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
     STAT_COPYDISPATCHER  
   
     return(response);     return(response);
 } }
  
Line 2796 
Line 3780 
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleAssociatorNamesRequest");     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleAssociatorNamesRequest");
  
     HandlerIntro(AssociatorNames,message,request,response,handler,Array<CIMObjectPath>());      HandlerIntro(AssociatorNames,message,request,response,handler);
  
     typedef enum {     typedef enum {
        METHOD_UNKNOWN = 0,        METHOD_UNKNOWN = 0,
        METHOD_PEGASUS_24,         METHOD_CIMASSOCIATORPROVIDER,
        METHOD_SNIA_PROVIDER20         METHOD_CIMASSOCIATORPROVIDER2,
          METHOD_ASSOCIATORPROVIDER,
          METHOD_ASSOCIATORPROVIDER2
     } METHOD_VERSION;     } METHOD_VERSION;
     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;
     JNIEnv          *env           = NULL;     JNIEnv          *env           = NULL;
Line 2829 
Line 3815 
             request->operationContext.get(ProviderIdContainer::NAME));             request->operationContext.get(ProviderIdContainer::NAME));
  
         // get cached or load new provider module         // get cached or load new provider module
         JMPIProvider::OpProviderHolder ph =          JMPIProvider::OpProviderHolder ph = providerManager.getProvider (name.getPhysicalName(),
             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);                                                                           name.getLogicalName(),
                                                                            String::EMPTY);
         // convert arguments  
         OperationContext context;  
   
         context.insert(request->operationContext.get(IdentityContainer::NAME));  
         context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));  
         context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));  
  
         // forward request         // forward request
         JMPIProvider &pr = ph.GetProvider();         JMPIProvider &pr = ph.GetProvider();
Line 2854 
Line 3834 
         {         {
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
  
             STAT_COPYDISPATCHER  
   
             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
Line 2863 
Line 3841 
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;  
   
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
  
         // public abstract java.util.Vector associatorNames (org.pegasus.jmpi.CIMObjectPath assocName,          getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
   
           if (interfaceType == "JMPI")
           {
              // public java.util.Vector associatorNames (org.pegasus.jmpi.CIMObjectPath assocName,
         //                                                   org.pegasus.jmpi.CIMObjectPath pathName,         //                                                   org.pegasus.jmpi.CIMObjectPath pathName,
         //                                                   java.lang.String               resultClass,         //                                                   java.lang.String               resultClass,
         //                                                   java.lang.String               role,         //                                                   java.lang.String               role,
Line 2876 
Line 3860 
         id = env->GetMethodID((jclass)pr.jProviderClass,         id = env->GetMethodID((jclass)pr.jProviderClass,
                               "associatorNames",                               "associatorNames",
                               "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector;");                               "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector;");
 //@BUG was:                   "(Lorg/pegasus/jmpi/CIMObjectPath;                                Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector;"  
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_ASSOCIATORPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found METHOD_ASSOCIATORPROVIDER."<<PEGASUS_STD(endl));
         }         }
  
         if (id == NULL)         if (id == NULL)
         {         {
             env->ExceptionClear();             env->ExceptionClear();
  
             // public abstract java.util.Vector associatorNames (org.pegasus.jmpi.CIMObjectPath assocName,                 // public org.pegasus.jmpi.CIMObjectPath[] associatorNames (org.pegasus.jmpi.CIMObjectPath assocName,
                  //                                                          org.pegasus.jmpi.CIMObjectPath pathName,
             //                                                   java.lang.String               resultClass,             //                                                   java.lang.String               resultClass,
             //                                                   java.lang.String               role,             //                                                   java.lang.String               role,
             //                                                   java.lang.String               resultRole)             //                                                   java.lang.String               resultRole)
             //        throws org.pegasus.jmpi.CIMException             //        throws org.pegasus.jmpi.CIMException
             id = env->GetMethodID((jclass)pr.jProviderClass,             id = env->GetMethodID((jclass)pr.jProviderClass,
                                   "associatorNames",                                   "associatorNames",
                                   "(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector;");                                       "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMObjectPath;");
 //@BUG was:                       "(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMObjectPath;"  
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_PEGASUS_24;                     eMethodFound = METHOD_CIMASSOCIATORPROVIDER;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found METHOD_CIMASSOCIATORPROVIDER."<<PEGASUS_STD(endl));
             }             }
         }         }
   
         if (id == NULL)  
         {  
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found no method!"<<PEGASUS_STD(endl));  
         }         }
           else if (interfaceType == "JMPIExperimental")
         JMPIjvm::checkException(env);  
   
         switch (eMethodFound)  
         {  
         case METHOD_PEGASUS_24:  
         {         {
             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, assocPath);             // public java.util.Vector associatorNames (org.pegasus.jmpi.OperationContext oc,
             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);             //                                          org.pegasus.jmpi.CIMObjectPath    assocName,
              //                                          org.pegasus.jmpi.CIMObjectPath    pathName,
              //                                          java.lang.String                  resultClass,
              //                                          java.lang.String                  role,
              //                                          java.lang.String                  resultRole)
              //        throws org.pegasus.jmpi.CIMException
              id = env->GetMethodID((jclass)pr.jProviderClass,
                                    "associatorNames",
                                    "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector;");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_ASSOCIATORPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found METHOD_ASSOCIATORPROVIDER2."<<PEGASUS_STD(endl));
              }
   
              if (id == NULL)
              {
                  env->ExceptionClear();
   
                  // public org.pegasus.jmpi.CIMObjectPath[] associatorNames (org.pegasus.jmpi.OperationContext oc,
                  //                                                          org.pegasus.jmpi.CIMObjectPath    assocName,
                  //                                                          org.pegasus.jmpi.CIMObjectPath    pathName,
                  //                                                          java.lang.String                  resultClass,
                  //                                                          java.lang.String                  role,
                  //                                                          java.lang.String                  resultRole)
                  //        throws org.pegasus.jmpi.CIMException
                  id = env->GetMethodID((jclass)pr.jProviderClass,
                                        "associatorNames",
                                        "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMObjectPath;");
   
                  if (id != NULL)
                  {
                      eMethodFound = METHOD_CIMASSOCIATORPROVIDER2;
                      DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found METHOD_CIMASSOCIATORPROVIDER2."<<PEGASUS_STD(endl));
                  }
              }
           }
   
           if (id == NULL)
           {
               DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found no method!"<<PEGASUS_STD(endl));
   
               PEG_METHOD_EXIT();
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND",
                                                                  "Could not find a method for the provider based on InterfaceType."));
           }
   
           JMPIjvm::checkException(env);
   
           switch (eMethodFound)
           {
           case METHOD_CIMASSOCIATORPROVIDER:
           {
               jlong   jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, assocPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef);
   
               JMPIjvm::checkException(env);
   
               jlong   jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 2934 
Line 3970 
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultRole  = "<<request->resultRole<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultRole  = "<<request->resultRole<<PEGASUS_STD(endl));
 #endif #endif
  
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,              StatProviderTimeMeasurement providerTime(response);
   
               jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     jAssociationName,
                                                                     jPathName,
                                                                     jResultClass,
                                                                     jRole,
                                                                     jResultRole);
   
               JMPIjvm::checkException(env);
   
               handler.processing();
               if (jAr) {
                   for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
                       JMPIjvm::checkException(env);
   
                       jobject jcopRet = env->GetObjectArrayElement(jAr,i);
   
                       JMPIjvm::checkException(env);
   
                       jlong          jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
                       CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef);
   
                       JMPIjvm::checkException(env);
   
                       handler.deliver(*copRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_CIMASSOCIATORPROVIDER2:
           {
               jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
               jlong   jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, assocPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef);
   
               JMPIjvm::checkException(env);
   
               jlong   jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef);
   
               JMPIjvm::checkException(env);
   
               jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString());
               jstring jRole        = env->NewStringUTF(request->role.getCString());
               jstring jResultRole  = env->NewStringUTF(request->resultRole.getCString());
   
               JMPIjvm::checkException(env);
   
   #ifdef PEGASUS_DEBUG
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: assocName   = "<<assocPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultClass = "<<request->resultClass<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: role        = "<<request->role<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultRole  = "<<request->resultRole<<PEGASUS_STD(endl));
   #endif
   
               StatProviderTimeMeasurement providerTime(response);
   
               jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                   id,                                                                   id,
                                                                     joc,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                     jPathName,
                                                                   jResultClass,                                                                   jResultClass,
                                                                   jRole,                                                                   jRole,
                                                                   jResultRole);                                                                   jResultRole);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
   
               handler.processing();
               if (jAr) {
                   for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
                       JMPIjvm::checkException(env);
   
                       jobject jcopRet = env->GetObjectArrayElement(jAr,i);
   
                       JMPIjvm::checkException(env);
   
                       jlong          jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
                       CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef);
   
                       JMPIjvm::checkException(env);
   
                       handler.deliver(*copRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_ASSOCIATORPROVIDER:
           {
               jlong   jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, assocPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef);
   
               JMPIjvm::checkException(env);
   
               jlong   jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef);
   
               JMPIjvm::checkException(env);
   
               jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString());
               jstring jRole        = env->NewStringUTF(request->role.getCString());
               jstring jResultRole  = env->NewStringUTF(request->resultRole.getCString());
   
               JMPIjvm::checkException(env);
   
   #ifdef PEGASUS_DEBUG
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: assocName   = "<<assocPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: pathName    = "<<objectPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultClass = "<<request->resultClass<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: role        = "<<request->role<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultRole  = "<<request->resultRole<<PEGASUS_STD(endl));
   #endif
   
               StatProviderTimeMeasurement providerTime(response);
   
               jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     jAssociationName,
                                                                     jPathName,
                                                                     jResultClass,
                                                                     jRole,
                                                                     jResultRole);
   
               JMPIjvm::checkException(env);
  
             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 jcopRet = env->GetObjectArrayElement(jVec,i);                      jobject jcopRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jint           jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);                      jlong          jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
                     CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRet);                      CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
Line 2966 
Line 4130 
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          case METHOD_ASSOCIATORPROVIDER2:
         {         {
             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, assocPath);              jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);              jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, assocPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint    jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
             jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jPathNameRef);              jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 2992 
Line 4159 
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultRole  = "<<request->resultRole<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultRole  = "<<request->resultRole<<PEGASUS_STD(endl));
 #endif #endif
  
               StatProviderTimeMeasurement providerTime(response);
   
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                   id,                                                                   id,
                                                                     joc,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                   jPathName,                                                                   jPathName,
                                                                   jResultClass,                                                                   jResultClass,
Line 3002 
Line 4172 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
  
             handler.processing();             handler.processing();
             if (jVec) {             if (jVec) {
Line 3013 
Line 4188 
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jint           jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);                      jlong          jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
                     CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRetRef);                      CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
Line 3038 
Line 4213 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
     STAT_COPYDISPATCHER  
   
     return(response);     return(response);
 } }
  
Line 3047 
Line 4220 
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleReferencesRequest");     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleReferencesRequest");
  
     HandlerIntro(References,message,request,response,handler,Array<CIMObject>());      HandlerIntro(References,message,request,response,handler);
  
     typedef enum {     typedef enum {
        METHOD_UNKNOWN = 0,        METHOD_UNKNOWN = 0,
        METHOD_PEGASUS_24,         METHOD_CIMASSOCIATORPROVIDER,
        METHOD_SNIA_PROVIDER20,         METHOD_CIMASSOCIATORPROVIDER2,
          METHOD_ASSOCIATORPROVIDER,
          METHOD_ASSOCIATORPROVIDER2,
     } METHOD_VERSION;     } METHOD_VERSION;
     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;
     JNIEnv          *env           = NULL;     JNIEnv          *env           = NULL;
Line 3080 
Line 4255 
             request->operationContext.get(ProviderIdContainer::NAME));             request->operationContext.get(ProviderIdContainer::NAME));
  
         // get cached or load new provider module         // get cached or load new provider module
         JMPIProvider::OpProviderHolder ph =          JMPIProvider::OpProviderHolder ph = providerManager.getProvider (name.getPhysicalName(),
             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);                                                                           name.getLogicalName(),
                                                                            String::EMPTY);
  
         // convert arguments         // convert arguments
         OperationContext context;         OperationContext context;
Line 3105 
Line 4281 
         {         {
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
  
             STAT_COPYDISPATCHER  
   
             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
Line 3114 
Line 4288 
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;  
   
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
  
         // public abstract java.util.Vector references (org.pegasus.jmpi.CIMObjectPath assocName,          if (interfaceType == "JMPI")
           {
              // public java.util.Vector references (org.pegasus.jmpi.CIMObjectPath assocName,
         //                                              org.pegasus.jmpi.CIMObjectPath pathName,         //                                              org.pegasus.jmpi.CIMObjectPath pathName,
         //                                              java.lang.String               role,         //                                              java.lang.String               role,
         //                                              boolean                        includeQualifiers,         //                                              boolean                        includeQualifiers,
Line 3128 
Line 4308 
         id = env->GetMethodID((jclass)pr.jProviderClass,         id = env->GetMethodID((jclass)pr.jProviderClass,
                               "references",                               "references",
                               "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;");                               "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;");
 //@BUG was:                   "(Lorg/pegasus/jmpi/CIMObjectPath;                                Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;"  
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_ASSOCIATORPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_ASSOCIATORPROVIDER."<<PEGASUS_STD(endl));
         }         }
  
         if (id == NULL)         if (id == NULL)
         {         {
             env->ExceptionClear();             env->ExceptionClear();
  
             // public abstract java.util.Vector references (org.pegasus.jmpi.CIMObjectPath assocName,                 // public org.pegasus.jmpi.CIMInstance[] references (org.pegasus.jmpi.CIMObjectPath assocName,
                  //                                                   org.pegasus.jmpi.CIMObjectPath pathName,
             //                                              java.lang.String               role,             //                                              java.lang.String               role,
             //                                              boolean                        includeQualifiers,             //                                              boolean                        includeQualifiers,
             //                                              boolean                        includeClassOrigin,             //                                              boolean                        includeClassOrigin,
Line 3148 
Line 4328 
             //        throws org.pegasus.jmpi.CIMException             //        throws org.pegasus.jmpi.CIMException
             id = env->GetMethodID((jclass)pr.jProviderClass,             id = env->GetMethodID((jclass)pr.jProviderClass,
                                   "references",                                   "references",
                                   "(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;");                                       "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMInstance;");
 //@BUG was:                       "(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMInstance;"  
                  if (id != NULL)
                  {
                      eMethodFound = METHOD_CIMASSOCIATORPROVIDER;
                      DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_CIMASSOCIATORPROVIDER."<<PEGASUS_STD(endl));
                  }
              }
           }
           else if (interfaceType == "JMPIExperimental")
           {
              // public java.util.Vector references (org.pegasus.jmpi.OperationContext oc,
              //                                     org.pegasus.jmpi.CIMObjectPath    assocName,
              //                                     org.pegasus.jmpi.CIMObjectPath    pathName,
              //                                     java.lang.String                  role,
              //                                     boolean                           includeQualifiers,
              //                                     boolean                           includeClassOrigin,
              //                                     java.lang.String[]                propertyList)
              //        throws org.pegasus.jmpi.CIMException
              id = env->GetMethodID((jclass)pr.jProviderClass,
                                    "references",
                                    "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_ASSOCIATORPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_ASSOCIATORPROVIDER2."<<PEGASUS_STD(endl));
              }
   
              if (id == NULL)
              {
                  env->ExceptionClear();
   
                  // public org.pegasus.jmpi.CIMInstance[] references (org.pegasus.jmpi.OperationContext oc,
                  //                                                   org.pegasus.jmpi.CIMObjectPath    assocName,
                  //                                                   org.pegasus.jmpi.CIMObjectPath    pathName,
                  //                                                   java.lang.String                  role,
                  //                                                   boolean                           includeQualifiers,
                  //                                                   boolean                           includeClassOrigin,
                  //                                                   java.lang.String[]                propertyList)
                  //        throws org.pegasus.jmpi.CIMException
                  id = env->GetMethodID((jclass)pr.jProviderClass,
                                        "references",
                                        "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMInstance;");
   
                  if (id != NULL)
                  {
                      eMethodFound = METHOD_CIMASSOCIATORPROVIDER2;
                      DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_CIMASSOCIATORPROVIDER2."<<PEGASUS_STD(endl));
                  }
              }
           }
   
           if (id == NULL)
           {
               DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found no method!"<<PEGASUS_STD(endl));
   
               PEG_METHOD_EXIT();
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND",
                                                                  "Could not find a method for the provider based on InterfaceType."));
           }
   
           JMPIjvm::checkException(env);
   
           switch (eMethodFound)
           {
           case METHOD_CIMASSOCIATORPROVIDER:
           {
               jlong   jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, resultPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef);
   
               JMPIjvm::checkException(env);
   
               jlong   jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef);
   
               JMPIjvm::checkException(env);
   
               jstring jRole = env->NewStringUTF(request->role.getCString());
   
               JMPIjvm::checkException(env);
   
               jobjectArray jPropertyList = getList(jv,env,request->propertyList);
   
   #ifdef PEGASUS_DEBUG
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: assocName          = "<<resultPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: role               = "<<request->role<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeQualifiers  = "<<false<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));
   #endif
   
               StatProviderTimeMeasurement providerTime(response);
   
               jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     jAssociationName,
                                                                     jPathName,
                                                                     jRole,
                                                                     JMPI_INCLUDE_QUALIFIERS,
                                                                     request->includeClassOrigin,
                                                                     jPropertyList);
   
               JMPIjvm::checkException(env);
   
               handler.processing();
               if (jAr) {
                   for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
                       JMPIjvm::checkException(env);
   
                       jobject jciRet = env->GetObjectArrayElement(jAr,i);
   
                       JMPIjvm::checkException(env);
   
                       jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
   
                       JMPIjvm::checkException(env);
   
                       CIMInstance         *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
                       CIMClass             cls;
   
                       try
                       {
                          DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl));
                          AutoMutex lock (pr._cimomMutex);
   
                          cls = pr._cimom_handle->getClass(context,
                                                           request->nameSpace,
                                                           ciRet->getClassName(),
                                                           false,
                                                           true,
                                                           true,
                                                           CIMPropertyList());
                          DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl));
                       }
                       catch (CIMException e)
                       {
                          DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
                          throw;
                       }
   
                       const CIMObjectPath& op    = ciRet->getPath();
                       CIMObjectPath        iop   = ciRet->buildPath(cls);
   
                       JMPIjvm::checkException(env);
   
                       iop.setNameSpace(op.getNameSpace());
                       ciRet->setPath(iop);
   
                       handler.deliver(*ciRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_CIMASSOCIATORPROVIDER2:
           {
               jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, resultPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef);
   
               JMPIjvm::checkException(env);
   
               jlong   jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef);
   
               JMPIjvm::checkException(env);
   
               jstring jRole = env->NewStringUTF(request->role.getCString());
   
               JMPIjvm::checkException(env);
   
               jobjectArray jPropertyList = getList(jv,env,request->propertyList);
   
   #ifdef PEGASUS_DEBUG
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: assocName          = "<<resultPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: role               = "<<request->role<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeQualifiers  = "<<false<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));
   #endif
   
               StatProviderTimeMeasurement providerTime(response);
   
               jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     joc,
                                                                     jAssociationName,
                                                                     jPathName,
                                                                     jRole,
                                                                     JMPI_INCLUDE_QUALIFIERS,
                                                                     request->includeClassOrigin,
                                                                     jPropertyList);
   
               JMPIjvm::checkException(env);
   
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
   
               handler.processing();
               if (jAr) {
                   for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
                       JMPIjvm::checkException(env);
   
                       jobject jciRet = env->GetObjectArrayElement(jAr,i);
   
                       JMPIjvm::checkException(env);
   
                       jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
   
                       JMPIjvm::checkException(env);
   
                       CIMInstance         *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
                       CIMClass             cls;
   
                       try
                       {
                          DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl));
                          AutoMutex lock (pr._cimomMutex);
   
                          cls = pr._cimom_handle->getClass(context,
                                                           request->nameSpace,
                                                           ciRet->getClassName(),
                                                           false,
                                                           true,
                                                           true,
                                                           CIMPropertyList());
                          DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl));
                       }
                       catch (CIMException e)
                       {
                          DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
                          throw;
                       }
   
                       const CIMObjectPath& op    = ciRet->getPath();
                       CIMObjectPath        iop   = ciRet->buildPath(cls);
  
             if (id != NULL)                      JMPIjvm::checkException(env);
             {  
                 eMethodFound = METHOD_PEGASUS_24;                      iop.setNameSpace(op.getNameSpace());
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                      ciRet->setPath(iop);
   
                       handler.deliver(*ciRet);
             }             }
         }         }
               handler.complete();
               break;
           }
  
         if (id == NULL)          case METHOD_ASSOCIATORPROVIDER:
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found no method!"<<PEGASUS_STD(endl));              jlong   jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, resultPath);
         }              jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef);
  
         JMPIjvm::checkException(env);         JMPIjvm::checkException(env);
  
         switch (eMethodFound)              jlong   jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
         {              jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef);
         case METHOD_PEGASUS_24:  
         {  
             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, resultPath);  
             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);  
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 3182 
Line 4605 
  
 #ifdef PEGASUS_DEBUG #ifdef PEGASUS_DEBUG
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: assocName          = "<<resultPath->toString ()<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: assocName          = "<<resultPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: pathName           = "<<objectPath->toString ()<<PEGASUS_STD(endl));
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: role               = "<<request->role<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: role               = "<<request->role<<PEGASUS_STD(endl));
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeQualifiers  = "<<false<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeQualifiers  = "<<false<<PEGASUS_STD(endl));
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));
 #endif #endif
  
               StatProviderTimeMeasurement providerTime(response);
   
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                   id,                                                                   id,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                     jPathName,
                                                                   jRole,                                                                   jRole,
                                                                   JMPI_INCLUDE_QUALIFIERS,                                                                   JMPI_INCLUDE_QUALIFIERS,
                                                                   request->includeClassOrigin,                                                                   request->includeClassOrigin,
Line 3197 
Line 4624 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;  
   
             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);  
   
                     jobject jciRet = env->GetObjectArrayElement(jVec,i);  
   
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jint jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);                      jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     CIMInstance         *ciRet = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                      jlong                jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                       CIMInstance         *ciRet     = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
                     CIMClass             cls;                     CIMClass             cls;
  
                     try                     try
Line 3250 
Line 4672 
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          case METHOD_ASSOCIATORPROVIDER2:
         {         {
             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, resultPath);              jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);              jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, resultPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint    jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
             jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jPathNameRef);              jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 3276 
Line 4701 
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));
 #endif #endif
  
               StatProviderTimeMeasurement providerTime(response);
   
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                   id,                                                                   id,
                                                                     joc,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                   jPathName,                                                                   jPathName,
                                                                   jRole,                                                                   jRole,
Line 3287 
Line 4715 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
  
             handler.processing();             handler.processing();
             if (jVec) {             if (jVec) {
Line 3298 
Line 4731 
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jint                 jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);                      jlong                jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                     CIMInstance         *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                      CIMInstance         *ciRet     = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
                     CIMClass             cls;                     CIMClass             cls;
  
                     try                     try
Line 3350 
Line 4783 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
     STAT_COPYDISPATCHER  
   
     return(response);     return(response);
 } }
  
Line 3359 
Line 4790 
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleReferenceNamesRequest");     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleReferenceNamesRequest");
  
     HandlerIntro(ReferenceNames,message,request,response,handler,Array<CIMObjectPath>());      HandlerIntro(ReferenceNames,message,request,response,handler);
  
     typedef enum {     typedef enum {
        METHOD_UNKNOWN = 0,        METHOD_UNKNOWN = 0,
        METHOD_PEGASUS_24,         METHOD_CIMASSOCIATORPROVIDER,
        METHOD_SNIA_PROVIDER20,         METHOD_CIMASSOCIATORPROVIDER2,
          METHOD_ASSOCIATORPROVIDER,
          METHOD_ASSOCIATORPROVIDER2,
     } METHOD_VERSION;     } METHOD_VERSION;
     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;
     JNIEnv          *env           = NULL;     JNIEnv          *env           = NULL;
Line 3392 
Line 4825 
             request->operationContext.get(ProviderIdContainer::NAME));             request->operationContext.get(ProviderIdContainer::NAME));
  
         // get cached or load new provider module         // get cached or load new provider module
         JMPIProvider::OpProviderHolder ph =          JMPIProvider::OpProviderHolder ph = providerManager.getProvider (name.getPhysicalName(),
             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);                                                                           name.getLogicalName(),
                                                                            String::EMPTY);
         // convert arguments  
         OperationContext context;  
   
         context.insert(request->operationContext.get(IdentityContainer::NAME));  
         context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));  
         context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));  
  
         JMPIProvider &pr = ph.GetProvider();         JMPIProvider &pr = ph.GetProvider();
  
Line 3416 
Line 4843 
         {         {
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
  
             STAT_COPYDISPATCHER  
   
             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
Line 3425 
Line 4850 
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;  
   
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
  
         // public abstract java.util.Vector referenceNames (org.pegasus.jmpi.CIMObjectPath assocName,          getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
   
           if (interfaceType == "JMPI")
           {
              // public java.util.Vector referenceNames (org.pegasus.jmpi.CIMObjectPath assocName,
         //                                                  org.pegasus.jmpi.CIMObjectPath pathName,         //                                                  org.pegasus.jmpi.CIMObjectPath pathName,
         //                                                  java.lang.String               role)         //                                                  java.lang.String               role)
         //        throws org.pegasus.jmpi.CIMException         //        throws org.pegasus.jmpi.CIMException
         id = env->GetMethodID((jclass)pr.jProviderClass,         id = env->GetMethodID((jclass)pr.jProviderClass,
                               "referenceNames",                               "referenceNames",
                               "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)Ljava/util/Vector;");                               "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)Ljava/util/Vector;");
 //@BUG was:                   "(Lorg/pegasus/jmpi/CIMObjectPath;                                Ljava/lang/String;)Ljava/util/Vector;"  
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_ASSOCIATORPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found METHOD_ASSOCIATORPROVIDER."<<PEGASUS_STD(endl));
              }
   
              if (id == NULL)
              {
                  env->ExceptionClear();
   
                  // public org.pegasus.jmpi.CIMObjectPath[] referenceNames (org.pegasus.jmpi.CIMObjectPath assocName,
                  //                                                         org.pegasus.jmpi.CIMObjectPath pathName,
                  //                                                         java.lang.String               role)
                  //        throws org.pegasus.jmpi.CIMException
                  id = env->GetMethodID((jclass)pr.jProviderClass,
                                        "referenceNames",
                                        "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMObjectPath;");
   
                  if (id != NULL)
                  {
                      eMethodFound = METHOD_CIMASSOCIATORPROVIDER;
                      DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found METHOD_CIMASSOCIATORPROVIDER."<<PEGASUS_STD(endl));
                  }
              }
           }
           else if (interfaceType == "JMPIExperimental")
           {
              // public java.util.Vector referenceNames (org.pegasus.jmpi.OperationContext oc,
              //                                         org.pegasus.jmpi.CIMObjectPath    assocName,
              //                                         org.pegasus.jmpi.CIMObjectPath    pathName,
              //                                         java.lang.String                  role)
              //        throws org.pegasus.jmpi.CIMException
              id = env->GetMethodID((jclass)pr.jProviderClass,
                                    "referenceNames",
                                    "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)Ljava/util/Vector;");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_ASSOCIATORPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found METHOD_ASSOCIATORPROVIDER2."<<PEGASUS_STD(endl));
         }         }
  
         if (id == NULL)         if (id == NULL)
         {         {
             env->ExceptionClear();             env->ExceptionClear();
  
             // public abstract java.util.Vector referenceNames (org.pegasus.jmpi.CIMObjectPath assocName,                 // public org.pegasus.jmpi.CIMObjectPath[] referenceNames (org.pegasus.jmpi.OperationContext oc,
                  //                                                         org.pegasus.jmpi.CIMObjectPath    assocName,
                  //                                                         org.pegasus.jmpi.CIMObjectPath    pathName,
             //                                                  java.lang.String               role)             //                                                  java.lang.String               role)
             //        throws org.pegasus.jmpi.CIMException             //        throws org.pegasus.jmpi.CIMException
             id = env->GetMethodID((jclass)pr.jProviderClass,             id = env->GetMethodID((jclass)pr.jProviderClass,
                                   "referenceNames",                                   "referenceNames",
                                   "(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)Ljava/util/Vector;");                                       "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMObjectPath;");
 //@BUG was:                       "(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMObjectPath;"  
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_PEGASUS_24;                     eMethodFound = METHOD_CIMASSOCIATORPROVIDER2;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found METHOD_CIMASSOCIATORPROVIDER2."<<PEGASUS_STD(endl));
                  }
             }             }
         }         }
  
         if (id == NULL)         if (id == NULL)
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found no method!"<<PEGASUS_STD(endl));             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found no method!"<<PEGASUS_STD(endl));
   
               PEG_METHOD_EXIT();
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND",
                                                                  "Could not find a method for the provider based on InterfaceType."));
         }         }
  
         JMPIjvm::checkException(env);         JMPIjvm::checkException(env);
  
         switch (eMethodFound)         switch (eMethodFound)
         {         {
         case METHOD_PEGASUS_24:          case METHOD_CIMASSOCIATORPROVIDER:
         {         {
             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, resultPath);              jlong   jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, resultPath);
             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);              jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef);
   
               JMPIjvm::checkException(env);
   
               jlong   jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 3488 
Line 4967 
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: role               = "<<request->role<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: role               = "<<request->role<<PEGASUS_STD(endl));
 #endif #endif
  
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,              StatProviderTimeMeasurement providerTime(response);
   
               jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     jPathName,
                                                                     jAssociationName,
                                                                     jRole);
   
               JMPIjvm::checkException(env);
   
               handler.processing();
               if (jAr) {
                   for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
                       JMPIjvm::checkException(env);
   
                       jobject jcopRet = env->GetObjectArrayElement(jAr,i);
   
                       JMPIjvm::checkException(env);
   
                       jlong jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
   
                       JMPIjvm::checkException(env);
   
                       CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef);
   
                       handler.deliver(*copRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_CIMASSOCIATORPROVIDER2:
           {
               jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, resultPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef);
   
               JMPIjvm::checkException(env);
   
               jlong   jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef);
   
               JMPIjvm::checkException(env);
   
               jstring jRole = env->NewStringUTF(request->role.getCString());
   
               JMPIjvm::checkException(env);
   
   #ifdef PEGASUS_DEBUG
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: assocName          = "<<objectPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: role               = "<<request->role<<PEGASUS_STD(endl));
   #endif
   
               StatProviderTimeMeasurement providerTime(response);
   
               jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                   id,                                                                   id,
                                                                     joc,
                                                                     jPathName,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                   jRole);                                                                   jRole);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
   
               handler.processing();
               if (jAr) {
                   for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
                       JMPIjvm::checkException(env);
   
                       jobject jcopRet = env->GetObjectArrayElement(jAr,i);
   
                       JMPIjvm::checkException(env);
   
                       jlong jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
   
                       JMPIjvm::checkException(env);
   
                       CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef);
   
                       handler.deliver(*copRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_ASSOCIATORPROVIDER:
           {
               jlong   jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, resultPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef);
   
               JMPIjvm::checkException(env);
   
               jlong   jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef);
   
               JMPIjvm::checkException(env);
   
               jstring jRole = env->NewStringUTF(request->role.getCString());
   
               JMPIjvm::checkException(env);
   
   #ifdef PEGASUS_DEBUG
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: assocName          = "<<objectPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: pathName           = "<<resultPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: role               = "<<request->role<<PEGASUS_STD(endl));
   #endif
   
               StatProviderTimeMeasurement providerTime(response);
   
               jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     jAssociationName,
                                                                     jPathName,
                                                                     jRole);
   
               JMPIjvm::checkException(env);
  
             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 jcopRet = env->GetObjectArrayElement(jVec,i);                      jobject jcopRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jint jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);                      jlong jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRetRef);                      CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef);
  
                     handler.deliver(*copRet);                     handler.deliver(*copRet);
                 }                 }
Line 3519 
Line 5117 
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          case METHOD_ASSOCIATORPROVIDER2:
         {         {
             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, resultPath);              jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);              jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, resultPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint    jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
             jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jPathNameRef);              jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 3541 
Line 5142 
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: role               = "<<request->role<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: role               = "<<request->role<<PEGASUS_STD(endl));
 #endif #endif
  
               StatProviderTimeMeasurement providerTime(response);
   
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                   id,                                                                   id,
                                                                     joc,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                   jPathName,                                                                   jPathName,
                                                                   jRole);                                                                   jRole);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
  
             handler.processing();             handler.processing();
             if (jVec) {             if (jVec) {
Line 3560 
Line 5169 
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jint jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);                      jlong jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRetRef);                      CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef);
  
                     handler.deliver(*copRet);                     handler.deliver(*copRet);
                 }                 }
Line 3586 
Line 5195 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
     STAT_COPYDISPATCHER  
   
     return(response);     return(response);
 } }
  
Line 3595 
Line 5202 
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleGetPropertyRequest");     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleGetPropertyRequest");
  
     HandlerIntro(GetProperty,message,request,response,handler,CIMValue());      HandlerIntro(GetProperty,message,request,response,handler);
  
     typedef enum {     typedef enum {
        METHOD_UNKNOWN = 0,        METHOD_UNKNOWN = 0,
        METHOD_SNIA_PROVIDER20,         METHOD_PROPERTYPROVIDER,
          METHOD_PROPERTYPROVIDER2,
     } METHOD_VERSION;     } METHOD_VERSION;
     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;
     JNIEnv          *env           = NULL;     JNIEnv          *env           = NULL;
Line 3624 
Line 5232 
             request->operationContext.get(ProviderIdContainer::NAME));             request->operationContext.get(ProviderIdContainer::NAME));
  
         // get cached or load new provider module         // get cached or load new provider module
         JMPIProvider::OpProviderHolder ph =          JMPIProvider::OpProviderHolder ph = providerManager.getProvider (name.getPhysicalName(),
             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);                                                                           name.getLogicalName(),
                                                                            String::EMPTY);
         // convert arguments  
         OperationContext context;  
   
         context.insert(request->operationContext.get(IdentityContainer::NAME));  
         context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));  
         context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));  
  
         // forward request         // forward request
         JMPIProvider &pr = ph.GetProvider();         JMPIProvider &pr = ph.GetProvider();
Line 3649 
Line 5251 
         {         {
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
  
             STAT_COPYDISPATCHER  
   
             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
Line 3658 
Line 5258 
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;  
   
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
  
           if (interfaceType == "JMPI")
           {
         // public abstract org.pegasus.jmpi.CIMValue getPropertyValue (org.pegasus.jmpi.CIMObjectPath cop,         // public abstract org.pegasus.jmpi.CIMValue getPropertyValue (org.pegasus.jmpi.CIMObjectPath cop,
         //                                                             java.lang.String               oclass,         //                                                             java.lang.String               oclass,
         //                                                             java.lang.String               pName)         //                                                             java.lang.String               pName)
Line 3673 
Line 5279 
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_PROPERTYPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetPropertyRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetPropertyRequest: found METHOD_PROPERTYPROVIDER."<<PEGASUS_STD(endl));
              }
           }
           else if (interfaceType == "JMPIExperimental")
           {
              // public abstract org.pegasus.jmpi.CIMValue getPropertyValue (org.pegasus.jmpi.OperationContext oc,
              //                                                             org.pegasus.jmpi.CIMObjectPath    cop,
              //                                                             java.lang.String                  oclass,
              //                                                             java.lang.String                  pName)
              //        throws org.pegasus.jmpi.CIMException
              //
              id = env->GetMethodID((jclass)pr.jProviderClass,
                                    "getPropertyValue",
                                    "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;)Lorg/pegasus/jmpi/CIMValue;");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_PROPERTYPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetPropertyRequest: found METHOD_PROPERTYPROVIDER2."<<PEGASUS_STD(endl));
              }
         }         }
  
         if (id == NULL)         if (id == NULL)
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetPropertyRequest: found no method!"<<PEGASUS_STD(endl));             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetPropertyRequest: found no method!"<<PEGASUS_STD(endl));
   
               PEG_METHOD_EXIT();
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND",
                                                                  "Could not find a method for the provider based on InterfaceType."));
         }         }
  
         JMPIjvm::checkException(env);         JMPIjvm::checkException(env);
  
         switch (eMethodFound)          switch (eMethodFound)
         {          {
         case METHOD_SNIA_PROVIDER20:          case METHOD_PROPERTYPROVIDER:
           {
               jlong   jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewJ, jcopref);
   
               JMPIjvm::checkException(env);
   
               jstring joclass = env->NewStringUTF(request->instanceName.getClassName().getString().getCString());
   
               JMPIjvm::checkException(env);
   
               jstring jpName = env->NewStringUTF(request->propertyName.getString().getCString());
   
               JMPIjvm::checkException(env);
   
               StatProviderTimeMeasurement providerTime(response);
   
               jobject jvalRet = env->CallObjectMethod ((jobject)pr.jProvider,
                                                        id,
                                                        jcop,
                                                        joclass,
                                                        jpName);
   
               JMPIjvm::checkException(env);
   
               handler.processing();
   
               if (jvalRet)
               {
                  jlong     jvalRetRef = env->CallLongMethod(jvalRet,JMPIjvm::jv.CIMValueCInst);
                  CIMValue *valRet     = DEBUG_ConvertJavaToC (jlong, CIMValue*, jvalRetRef);
   
                  JMPIjvm::checkException(env);
   
                  handler.deliver(*valRet);
               }
               handler.complete();
               break;
           }
   
           case METHOD_PROPERTYPROVIDER2:
         {         {
             jint    jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewI, jcopref);              jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewJ, jcopref);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 3701 
Line 5375 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_GETSTARTTIME;              StatProviderTimeMeasurement providerTime(response);
  
             jobject jvalRet = env->CallObjectMethod ((jobject)pr.jProvider,             jobject jvalRet = env->CallObjectMethod ((jobject)pr.jProvider,
                                                      id,                                                      id,
                                                        joc,
                                                      jcop,                                                      jcop,
                                                      joclass,                                                      joclass,
                                                      jpName);                                                      jpName);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
  
             handler.processing();             handler.processing();
  
             if (jvalRet)             if (jvalRet)
             {             {
                jint      jvalRetRef = env->CallIntMethod(jvalRet,JMPIjvm::jv.CIMValueCInst);                 jlong     jvalRetRef = env->CallLongMethod(jvalRet,JMPIjvm::jv.CIMValueCInst);
                CIMValue *valRet     = DEBUG_ConvertJavaToC (jint, CIMValue*, jvalRetRef);                 CIMValue *valRet     = DEBUG_ConvertJavaToC (jlong, CIMValue*, jvalRetRef);
  
                JMPIjvm::checkException(env);                JMPIjvm::checkException(env);
  
Line 3741 
Line 5421 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
     STAT_COPYDISPATCHER  
   
     return(response);     return(response);
 } }
  
Line 3750 
Line 5428 
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleSetPropertyRequest");     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleSetPropertyRequest");
  
     HandlerIntroVoid(SetProperty,message,request,response,handler);      HandlerIntro(SetProperty,message,request,response,handler);
  
     typedef enum {     typedef enum {
        METHOD_UNKNOWN = 0,        METHOD_UNKNOWN = 0,
        METHOD_SNIA_PROVIDER20,         METHOD_PROPERTYPROVIDER,
          METHOD_PROPERTYPROVIDER2,
     } METHOD_VERSION;     } METHOD_VERSION;
     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;
     JNIEnv          *env           = NULL;     JNIEnv          *env           = NULL;
Line 3779 
Line 5458 
             request->operationContext.get(ProviderIdContainer::NAME));             request->operationContext.get(ProviderIdContainer::NAME));
  
         // get cached or load new provider module         // get cached or load new provider module
         JMPIProvider::OpProviderHolder ph =          JMPIProvider::OpProviderHolder ph = providerManager.getProvider (name.getPhysicalName(),
             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);                                                                           name.getLogicalName(),
                                                                            String::EMPTY);
         // convert arguments  
         OperationContext context;  
   
         context.insert(request->operationContext.get(IdentityContainer::NAME));  
         context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));  
         context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));  
  
         // forward request         // forward request
         JMPIProvider &pr = ph.GetProvider();         JMPIProvider &pr = ph.GetProvider();
Line 3804 
Line 5477 
         {         {
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
  
             STAT_COPYDISPATCHER  
   
             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
Line 3813 
Line 5484 
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;  
   
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
  
           if (interfaceType == "JMPI")
           {
         // public abstract void setPropertyValue (org.pegasus.jmpi.CIMObjectPath cop,         // public abstract void setPropertyValue (org.pegasus.jmpi.CIMObjectPath cop,
         //                                        java.lang.String               oclass,         //                                        java.lang.String               oclass,
         //                                        java.lang.String               pName,         //                                        java.lang.String               pName,
Line 3829 
Line 5506 
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_PROPERTYPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleSetPropertyRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleSetPropertyRequest: found METHOD_PROPERTYPROVIDER."<<PEGASUS_STD(endl));
              }
           }
           else if (interfaceType == "JMPIExperimental")
           {
              // public abstract void setPropertyValue (org.pegasus.jmpi.OperationContext oc,
              //                                        org.pegasus.jmpi.CIMObjectPath    cop,
              //                                        java.lang.String                  oclass,
              //                                        java.lang.String                  pName,
              //                                        org.pegasus.jmpi.CIMValue         val)
              //        throws org.pegasus.jmpi.CIMException
              //
              id = env->GetMethodID((jclass)pr.jProviderClass,
                                    "setPropertyValue",
                                    "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Lorg/pegasus/jmpi/CIMValue;)V");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_PROPERTYPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleSetPropertyRequest: found METHOD_PROPERTYPROVIDER2."<<PEGASUS_STD(endl));
              }
         }         }
  
         if (id == NULL)         if (id == NULL)
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleSetPropertyRequest: found no method!"<<PEGASUS_STD(endl));             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleSetPropertyRequest: found no method!"<<PEGASUS_STD(endl));
   
               PEG_METHOD_EXIT();
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND",
                                                                  "Could not find a method for the provider based on InterfaceType."));
         }         }
  
         JMPIjvm::checkException(env);         JMPIjvm::checkException(env);
  
         switch (eMethodFound)         switch (eMethodFound)
         {         {
         case METHOD_SNIA_PROVIDER20:          case METHOD_PROPERTYPROVIDER:
           {
               jlong   jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewJ, jcopref);
   
               JMPIjvm::checkException(env);
   
               jstring joclass = env->NewStringUTF(request->instanceName.getClassName().getString().getCString());
   
               JMPIjvm::checkException(env);
   
               jstring jpName = env->NewStringUTF(request->propertyName.getString().getCString());
   
               JMPIjvm::checkException(env);
   
               CIMValue *val = new CIMValue (request->newValue);
   
               JMPIjvm::checkException(env);
   
               jlong   jvalref = DEBUG_ConvertCToJava (CIMValue*, jlong, val);
               jobject jval    = env->NewObject(jv->CIMValueClassRef, jv->CIMValueNewJ, jvalref);
   
               JMPIjvm::checkException(env);
   
               StatProviderTimeMeasurement providerTime(response);
   
               env->CallVoidMethod ((jobject)pr.jProvider,
                                    id,
                                    jcop,
                                    joclass,
                                    jpName,
                                    jval);
   
               JMPIjvm::checkException(env);
               break;
           }
   
           case METHOD_PROPERTYPROVIDER2:
         {         {
             jint    jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewI, jcopref);              jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewJ, jcopref);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 3861 
Line 5604 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint    jvalref = DEBUG_ConvertCToJava (CIMValue*, jint, val);              jlong   jvalref = DEBUG_ConvertCToJava (CIMValue*, jlong, val);
             jobject jval    = env->NewObject(jv->CIMValueClassRef, jv->CIMValueNewI, jvalref);              jobject jval    = env->NewObject(jv->CIMValueClassRef, jv->CIMValueNewJ, jvalref);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_GETSTARTTIME;              StatProviderTimeMeasurement providerTime(response);
  
             env->CallVoidMethod ((jobject)pr.jProvider,             env->CallVoidMethod ((jobject)pr.jProvider,
                                  id,                                  id,
                                    joc,
                                  jcop,                                  jcop,
                                  joclass,                                  joclass,
                                  jpName,                                  jpName,
Line 3877 
Line 5621 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
             break;             break;
         }         }
  
Line 3894 
Line 5643 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
     STAT_COPYDISPATCHER  
   
     return(response);     return(response);
 } }
  
Line 3903 
Line 5650 
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleInvokeMethodRequest");     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleInvokeMethodRequest");
  
     HandlerIntroMethod(InvokeMethod,message,request,response,handler);      HandlerIntro(InvokeMethod,message,request,response,handler);
  
     typedef enum {     typedef enum {
        METHOD_UNKNOWN = 0,        METHOD_UNKNOWN = 0,
        METHOD_PEGASUS_24,         METHOD_CIMMETHODPROVIDER,
        METHOD_SNIA_PROVIDER20,         METHOD_CIMMETHODPROVIDER2,
          METHOD_METHODPROVIDER,
          METHOD_METHODPROVIDER2,
     } METHOD_VERSION;     } METHOD_VERSION;
     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;
     JNIEnv          *env           = NULL;     JNIEnv          *env           = NULL;
Line 3933 
Line 5682 
             request->operationContext.get(ProviderIdContainer::NAME));             request->operationContext.get(ProviderIdContainer::NAME));
  
         // get cached or load new provider module         // get cached or load new provider module
         JMPIProvider::OpProviderHolder ph =          JMPIProvider::OpProviderHolder ph = providerManager.getProvider (name.getPhysicalName(),
             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);                                                                           name.getLogicalName(),
                                                                            String::EMPTY);
         // convert arguments  
         OperationContext context;  
   
         context.insert(request->operationContext.get(IdentityContainer::NAME));  
         context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));  
         context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));  
  
         JMPIProvider &pr=ph.GetProvider();         JMPIProvider &pr=ph.GetProvider();
  
Line 3957 
Line 5700 
         {         {
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
  
             STAT_COPYDISPATCHER  
   
             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
Line 3966 
Line 5707 
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;  
   
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
  
           if (interfaceType == "JMPI")
           {
         // public abstract org.pegasus.jmpi.CIMValue invokeMethod (org.pegasus.jmpi.CIMObjectPath cop,         // public abstract org.pegasus.jmpi.CIMValue invokeMethod (org.pegasus.jmpi.CIMObjectPath cop,
         //                                                         java.lang.String               name,         //                                                         java.lang.String               name,
         //                                                         java.util.Vector               in,         //                                                         java.util.Vector               in,
Line 3981 
Line 5728 
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_METHODPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleInvokeMethodRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleInvokeMethodRequest: found METHOD_METHODPROVIDER."<<PEGASUS_STD(endl));
         }         }
  
         if (id == NULL)         if (id == NULL)
Line 4000 
Line 5747 
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_PEGASUS_24;                     eMethodFound = METHOD_CIMMETHODPROVIDER;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleInvokeMethodRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleInvokeMethodRequest: found METHOD_CIMMETHODPROVIDER."<<PEGASUS_STD(endl));
                  }
              }
           }
           else if (interfaceType == "JMPIExperimental")
           {
              // public abstract org.pegasus.jmpi.CIMValue invokeMethod (org.pegasus.jmpi.OperationContext oc,
              //                                                         org.pegasus.jmpi.CIMObjectPath    cop,
              //                                                         java.lang.String                  name,
              //                                                         java.util.Vector                  in,
              //                                                         java.util.Vector                  out)
              //        throws org.pegasus.jmpi.CIMException
              id = env->GetMethodID((jclass)pr.jProviderClass,
                                    "invokeMethod",
                                    "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/util/Vector;Ljava/util/Vector;)Lorg/pegasus/jmpi/CIMValue;");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_METHODPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleInvokeMethodRequest: found METHOD_METHODPROVIDER2."<<PEGASUS_STD(endl));
              }
   
              if (id == NULL)
              {
                  env->ExceptionClear();
   
                  // public org.pegasus.jmpi.CIMValue invokeMethod (org.pegasus.jmpi.OperationContext oc,
                  //                                                org.pegasus.jmpi.CIMObjectPath    op,
                  //                                                java.lang.String                  methodName,
                  //                                                org.pegasus.jmpi.CIMArgument[]    inArgs,
                  //                                                org.pegasus.jmpi.CIMArgument[]    outArgs)
                  //        throws org.pegasus.jmpi.CIMException
                  id = env->GetMethodID((jclass)pr.jProviderClass,
                                        "invokeMethod",
                                        "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;[Lorg/pegasus/jmpi/CIMArgument;[Lorg/pegasus/jmpi/CIMArgument;)Lorg/pegasus/jmpi/CIMValue;");
   
                  if (id != NULL)
                  {
                      eMethodFound = METHOD_CIMMETHODPROVIDER2;
                      DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleInvokeMethodRequest: found METHOD_CIMMETHODPROVIDER2."<<PEGASUS_STD(endl));
                  }
             }             }
         }         }
  
           if (id == NULL)
           {
              DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleInvokeMethodRequest: No method found!"<<PEGASUS_STD(endl));
   
              PEG_METHOD_EXIT();
   
              throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                             MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND",
                                                                 "Could not find a method for the provider based on InterfaceType."));
           }
   
         JMPIjvm::checkException(env);         JMPIjvm::checkException(env);
  
         switch (eMethodFound)         switch (eMethodFound)
         {         {
         case METHOD_PEGASUS_24:          case METHOD_CIMMETHODPROVIDER:
           {
               jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
   
               JMPIjvm::checkException(env);
   
               jstring jMethod = env->NewStringUTF(request->methodName.getString().getCString());
   
               JMPIjvm::checkException(env);
   
               Uint32 m=request->inParameters.size();
   
               jobjectArray jArIn=(jobjectArray)env->NewObjectArray(m,jv->CIMArgumentClassRef,NULL);
   
               for (Uint32 i=0; i<m; i++) {
                 CIMParamValue *parm    = new CIMParamValue(request->inParameters[i]);
                 jlong          jArgRef = DEBUG_ConvertCToJava (CIMParamValue*, jlong, parm);
                 jobject        jArg    = env->NewObject(jv->CIMArgumentClassRef,jv->CIMArgumentNewJ,jArgRef);
   
                 env->SetObjectArrayElement(jArIn,i,jArg);
               }
   
               jobjectArray jArOut=(jobjectArray)env->NewObjectArray(24,jv->CIMArgumentClassRef,NULL);
   
               StatProviderTimeMeasurement providerTime(response);
   
               jobject jValueRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                         id,
                                                         jcop,
                                                         jMethod,
                                                         jArIn,
                                                         jArOut);
               JMPIjvm::checkException(env);
   
               handler.processing();
   
               jlong     jValueRetRef = env->CallLongMethod(jValueRet,JMPIjvm::jv.CIMValueCInst);
               CIMValue *valueRet     = DEBUG_ConvertJavaToC (jlong, CIMValue*, jValueRetRef);
   
               handler.deliver(*valueRet);
   
               for (int i=0; i<24; i++) {
                   jobject jArg = env->GetObjectArrayElement(jArOut,i);
   
                   JMPIjvm::checkException(env);
   
                   if (jArg==NULL)
                      break;
   
                   jlong          jpRef = env->CallLongMethod(jArg,JMPIjvm::jv.CIMArgumentCInst);
                   CIMParamValue *p     = DEBUG_ConvertJavaToC (jlong, CIMParamValue*, jpRef);
   
                   JMPIjvm::checkException(env);
   
                   handler.deliverParamValue(*p);
               }
   
               handler.complete();
               break;
           }
   
           case METHOD_CIMMETHODPROVIDER2:
         {         {
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);              jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 4026 
Line 5889 
  
             for (Uint32 i=0; i<m; i++) {             for (Uint32 i=0; i<m; i++) {
               CIMParamValue *parm    = new CIMParamValue(request->inParameters[i]);               CIMParamValue *parm    = new CIMParamValue(request->inParameters[i]);
               jint           jArgRef = DEBUG_ConvertCToJava (CIMParamValue*, jint, parm);                jlong          jArgRef = DEBUG_ConvertCToJava (CIMParamValue*, jlong, parm);
               jobject        jArg    = env->NewObject(jv->CIMArgumentClassRef,jv->CIMArgumentNewI,jArgRef);                jobject        jArg    = env->NewObject(jv->CIMArgumentClassRef,jv->CIMArgumentNewJ,jArgRef);
  
               env->SetObjectArrayElement(jArIn,i,jArg);               env->SetObjectArrayElement(jArIn,i,jArg);
             }             }
  
             jobjectArray jArOut=(jobjectArray)env->NewObjectArray(24,jv->CIMArgumentClassRef,NULL);             jobjectArray jArOut=(jobjectArray)env->NewObjectArray(24,jv->CIMArgumentClassRef,NULL);
  
               StatProviderTimeMeasurement providerTime(response);
   
             jobject jValueRet = env->CallObjectMethod((jobject)pr.jProvider,             jobject jValueRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                       id,                                                       id,
                                                         joc,
                                                       jcop,                                                       jcop,
                                                       jMethod,                                                       jMethod,
                                                       jArIn,                                                       jArIn,
                                                       jArOut);                                                       jArOut);
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
  
             handler.processing();             handler.processing();
  
             jint      jValueRetRef = env->CallIntMethod(jValueRet,JMPIjvm::jv.CIMValueCInst);              jlong     jValueRetRef = env->CallLongMethod(jValueRet,JMPIjvm::jv.CIMValueCInst);
             CIMValue *valueRet     = DEBUG_ConvertJavaToC (jint, CIMValue*, jValueRetRef);              CIMValue *valueRet     = DEBUG_ConvertJavaToC (jlong, CIMValue*, jValueRetRef);
  
             handler.deliver(*valueRet);             handler.deliver(*valueRet);
  
Line 4059 
Line 5930 
                 if (jArg==NULL)                 if (jArg==NULL)
                    break;                    break;
  
                 jint           jpRef = env->CallIntMethod(jArg,JMPIjvm::jv.CIMArgumentCInst);                  jlong          jpRef = env->CallLongMethod(jArg,JMPIjvm::jv.CIMArgumentCInst);
                 CIMParamValue *p     = DEBUG_ConvertJavaToC (jint, CIMParamValue*, jpRef);                  CIMParamValue *p     = DEBUG_ConvertJavaToC (jlong, CIMParamValue*, jpRef);
  
                 JMPIjvm::checkException(env);                 JMPIjvm::checkException(env);
  
Line 4071 
Line 5942 
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          case METHOD_METHODPROVIDER:
           {
               jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
   
               JMPIjvm::checkException(env);
   
               jstring jMethod = env->NewStringUTF(request->methodName.getString().getCString());
   
               JMPIjvm::checkException(env);
   
               jobject jVecIn = env->NewObject(jv->VectorClassRef,jv->VectorNew);
   
               JMPIjvm::checkException(env);
   
               for (int i=0,m=request->inParameters.size(); i<m; i++)
               {
                   const CIMParamValue &parm  = request->inParameters[i];
                   const CIMValue       v     = parm.getValue();
                   CIMProperty         *p     = new CIMProperty(parm.getParameterName(),v,v.getArraySize());
                   jlong                jpRef = DEBUG_ConvertCToJava (CIMProperty*, jlong, p);
                   jobject              jp    = env->NewObject(jv->CIMPropertyClassRef,jv->CIMPropertyNewJ,jpRef);
   
                   env->CallVoidMethod(jVecIn,jv->VectorAddElement,jp);
                }
   
               jobject jVecOut=env->NewObject(jv->VectorClassRef,jv->VectorNew);
               JMPIjvm::checkException(env);
   
               StatProviderTimeMeasurement providerTime(response);
   
               jobject jValueRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                         id,
                                                         jcop,
                                                         jMethod,
                                                         jVecIn,
                                                         jVecOut);
               JMPIjvm::checkException(env);
   
               handler.processing();
   
               jlong     jValueRetRef = env->CallLongMethod(jValueRet,JMPIjvm::jv.CIMValueCInst);
               CIMValue *valueRet     = DEBUG_ConvertJavaToC (jlong, CIMValue*, jValueRetRef);
   
               handler.deliver(*valueRet);
   
               for (int i=0,m=env->CallIntMethod(jVecOut,JMPIjvm::jv.VectorSize); i<m; i++)
               {
                   JMPIjvm::checkException(env);
   
                   jobject jProp = env->CallObjectMethod(jVecOut,JMPIjvm::jv.VectorElementAt,i);
   
                   JMPIjvm::checkException(env);
   
                   jlong        jpRef = env->CallLongMethod(jProp,JMPIjvm::jv.CIMPropertyCInst);
                   CIMProperty *p     = DEBUG_ConvertJavaToC (jlong, CIMProperty*, jpRef);
   
                   JMPIjvm::checkException(env);
   
                   handler.deliverParamValue(CIMParamValue(p->getName().getString(),p->getValue()));
               }
   
               handler.complete();
               break;
           }
   
           case METHOD_METHODPROVIDER2:
         {         {
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);              jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);              jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
   
               jlong   jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 4091 
Line 6031 
                 const CIMParamValue &parm  = request->inParameters[i];                 const CIMParamValue &parm  = request->inParameters[i];
                 const CIMValue       v     = parm.getValue();                 const CIMValue       v     = parm.getValue();
                 CIMProperty         *p     = new CIMProperty(parm.getParameterName(),v,v.getArraySize());                 CIMProperty         *p     = new CIMProperty(parm.getParameterName(),v,v.getArraySize());
                 jint                 jpRef = DEBUG_ConvertCToJava (CIMProperty*, jint, p);                  jlong                jpRef = DEBUG_ConvertCToJava (CIMProperty*, jlong, p);
                 jobject              jp    = env->NewObject(jv->CIMPropertyClassRef,jv->CIMPropertyNewI,jpRef);                  jobject              jp    = env->NewObject(jv->CIMPropertyClassRef,jv->CIMPropertyNewJ,jpRef);
  
                 env->CallVoidMethod(jVecIn,jv->VectorAddElement,jp);                 env->CallVoidMethod(jVecIn,jv->VectorAddElement,jp);
              }              }
Line 4100 
Line 6040 
             jobject jVecOut=env->NewObject(jv->VectorClassRef,jv->VectorNew);             jobject jVecOut=env->NewObject(jv->VectorClassRef,jv->VectorNew);
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               StatProviderTimeMeasurement providerTime(response);
   
             jobject jValueRet = env->CallObjectMethod((jobject)pr.jProvider,             jobject jValueRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                       id,                                                       id,
                                                         joc,
                                                       jcop,                                                       jcop,
                                                       jMethod,                                                       jMethod,
                                                       jVecIn,                                                       jVecIn,
                                                       jVecOut);                                                       jVecOut);
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
  
             handler.processing();             handler.processing();
  
             jint      jValueRetRef = env->CallIntMethod(jValueRet,JMPIjvm::jv.CIMValueCInst);              jlong     jValueRetRef = env->CallLongMethod(jValueRet,JMPIjvm::jv.CIMValueCInst);
             CIMValue *valueRet     = DEBUG_ConvertJavaToC (jint, CIMValue*, jValueRetRef);              CIMValue *valueRet     = DEBUG_ConvertJavaToC (jlong, CIMValue*, jValueRetRef);
  
             handler.deliver(*valueRet);             handler.deliver(*valueRet);
  
Line 4125 
Line 6073 
  
                 JMPIjvm::checkException(env);                 JMPIjvm::checkException(env);
  
                 jint         jpRef = env->CallIntMethod(jProp,JMPIjvm::jv.CIMPropertyCInst);                  jlong        jpRef = env->CallLongMethod(jProp,JMPIjvm::jv.CIMPropertyCInst);
                 CIMProperty *p     = DEBUG_ConvertJavaToC (jint, CIMProperty*, jpRef);                  CIMProperty *p     = DEBUG_ConvertJavaToC (jlong, CIMProperty*, jpRef);
  
                 JMPIjvm::checkException(env);                 JMPIjvm::checkException(env);
  
Line 4150 
Line 6098 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
     STAT_COPYDISPATCHER  
   
     return(response);     return(response);
 } }
  
Line 4166 
Line 6112 
     return 0;     return 0;
 } }
  
   WQLSelectStatement *
   newSelectExp (String& query,
                 String& queryLanguage)
   {
      WQLSelectStatement *stmt = new WQLSelectStatement (queryLanguage, query);
   
      try
      {
         WQLParser::parse (query, *stmt);
      }
      catch (const Exception &e)
      {
         cerr << "Error: newSelectExp caught: " << e.getMessage () << endl;
      }
   
      return stmt;
   }
   
 Message * JMPIProviderManager::handleCreateSubscriptionRequest(const Message * message) throw() Message * JMPIProviderManager::handleCreateSubscriptionRequest(const Message * message) throw()
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "JMPIProviderManager::handleCreateSubscriptionRequest");     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "JMPIProviderManager::handleCreateSubscriptionRequest");
Line 4174 
Line 6138 
  
     typedef enum {     typedef enum {
        METHOD_UNKNOWN = 0,        METHOD_UNKNOWN = 0,
        METHOD_SNIA_PROVIDER20,         METHOD_EVENTPROVIDER,
          METHOD_EVENTPROVIDER2,
     } METHOD_VERSION;     } METHOD_VERSION;
     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;
     JNIEnv          *env           = NULL;     JNIEnv          *env           = NULL;
  
     try {     try {
         String               providerName,          String               fileName,
                                providerName,
                              providerLocation;                              providerLocation;
         CIMInstance          req_provider,         CIMInstance          req_provider,
                              req_providerModule;                              req_providerModule;
   
         ProviderIdContainer  pidc                = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME);         ProviderIdContainer  pidc                = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME);
  
         req_provider       = pidc.getProvider();         req_provider       = pidc.getProvider();
         req_providerModule = pidc.getModule();         req_providerModule = pidc.getModule();
  
         LocateIndicationProviderNames(req_provider, req_providerModule,providerName,providerLocation);          LocateIndicationProviderNames (req_provider,
                                          req_providerModule,
         Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,                                         providerName,
                                          providerLocation);
   
           fileName = resolveFileName (providerLocation);
   
           Logger::put (Logger::STANDARD_LOG,
                        System::CIMSERVER,
                        Logger::TRACE,
             "JMPIProviderManager::handleCreateSubscriptionRequest - Host name: $0  Name space: $1  Provider name(s): $2",             "JMPIProviderManager::handleCreateSubscriptionRequest - Host name: $0  Name space: $1  Provider name(s): $2",
             System::getHostName(),             System::getHostName(),
             request->nameSpace.getString(),             request->nameSpace.getString(),
             providerName);             providerName);
  
         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", providername = "<<providerName<<PEGASUS_STD(endl));          DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: hostname = "
                                <<System::getHostName()
         String fileName = resolveFileName(providerLocation);                               <<", namespace = "
                                <<request->nameSpace.getString()
                                <<", providername = "
                                <<providerName
                                <<", fileName = "
                                <<fileName
                                <<PEGASUS_STD(endl));
  
         // get cached or load new provider module         // get cached or load new provider module
         JMPIProvider::OpProviderHolder ph =          JMPIProvider::OpProviderHolder ph = providerManager.getProvider (fileName,
             providerManager.getProvider(fileName, providerName, String::EMPTY);                                                                           providerName,
                                                                            String::EMPTY);
   
           //
           //  Save the provider instance from the request
           //
           ph.GetProvider ().setProviderInstance (req_provider);
   
           JMPIProvider &pr = ph.GetProvider ();
   
           //
           //  Increment count of current subscriptions for this provider
           //
           pr.testIfZeroAndIncrementSubscriptions ();
  
           SubscriptionFilterConditionContainer  sub_cntr = request->operationContext.get (SubscriptionFilterConditionContainer::NAME);
         indProvRecord *prec = NULL;         indProvRecord *prec = NULL;
           bool                                  fNewPrec = false;
   
           {
              AutoMutex lock (mutexProvTab);
  
         provTab.lookup(providerName,prec);         provTab.lookup(providerName,prec);
  
         if (prec)             if (!prec)
         {  
             prec->count++;  
         }  
         else  
         {         {
                  fNewPrec = true;
   
             prec=new indProvRecord();             prec=new indProvRecord();
             provTab.insert(providerName,prec);  
         }  
  
         //                 // convert arguments
         //  Save the provider instance from the request                 prec->ctx = new OperationContext ();
         //  
         ph.GetProvider ().setProviderInstance (req_provider);  
  
         indSelectRecord     *srec  = new indSelectRecord();                 prec->ctx->insert (request->operationContext.get (IdentityContainer::NAME));
         const CIMObjectPath &sPath = request->subscriptionInstance.getPath();                 prec->ctx->insert (request->operationContext.get (AcceptLanguageListContainer::NAME));
                  prec->ctx->insert (request->operationContext.get (ContentLanguageListContainer::NAME));
                  prec->ctx->insert (request->operationContext.get (SubscriptionInstanceContainer::NAME));
                  prec->ctx->insert (request->operationContext.get (SubscriptionFilterConditionContainer::NAME));
  
         selxTab.insert(sPath.toString(),srec);                 prec->enabled = true;
  
         // convert arguments                 prec->handler = new EnableIndicationsResponseHandler (0,
         OperationContext *context=new OperationContext();                                                                       0,
                                                                        req_provider,
                                                                        _indicationCallback,
                                                                        _responseChunkCallback);
  
         if (prec->ctx==NULL)                 DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: Adding to provTab "<<providerName<<PEGASUS_STD(endl));
         {  
             prec->ctx=context;                 provTab.insert (providerName, prec);
              }
         }         }
  
         context->insert(request->operationContext.get(IdentityContainer::NAME));          {
         context->insert(request->operationContext.get(AcceptLanguageListContainer::NAME));             AutoMutex lock (prec->mutex);
         context->insert(request->operationContext.get(ContentLanguageListContainer::NAME));  
         context->insert(request->operationContext.get(SubscriptionInstanceContainer::NAME));  
         context->insert(request->operationContext.get(SubscriptionFilterConditionContainer::NAME));  
  
         CIMObjectPath subscriptionName = request->subscriptionInstance.getPath();             prec->count++;
           }
  
         SubscriptionFilterConditionContainer sub_cntr =  request->operationContext.get          // Add a selection record for JNI CIMOMHandle deliverEvent calls
                 (SubscriptionFilterConditionContainer::NAME);          indSelectRecord *srec = new indSelectRecord ();
  
         JMPIProvider &pr = ph.GetProvider();          {
              srec->query         = request->query;
              srec->queryLanguage = sub_cntr.getQueryLanguage ();
              srec->propertyList  = request->propertyList;
  
         CIMOMHandleQueryContext *qcontext=new CIMOMHandleQueryContext(CIMNamespaceName(request->nameSpace.getString()),             CIMOMHandleQueryContext *qContext = new CIMOMHandleQueryContext (CIMNamespaceName (request->nameSpace.getString ()),
                                                                       *pr._cimom_handle);                                                                       *pr._cimom_handle);
              srec->qContext = qContext;
  
         CMPI_SelectExp *eSelx = new CMPI_SelectExp(*context,             CIMObjectPath        sPath = request->subscriptionInstance.getPath ();
                                                    qcontext,             Array<CIMKeyBinding> kb;
                                                    request->query,  
                                                    sub_cntr.getQueryLanguage());  
  
         srec->eSelx=eSelx;             // Technically we only need Name and Handler for uniqueness
         srec->qContext=qcontext;             kb = sPath.getKeyBindings ();
  
         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.createSubscriptionRequest: " + pr.getName());             // Add an entry for every provider.
              kb.append (CIMKeyBinding ("Provider",
         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: Calling provider createSubscriptionRequest: "<<pr.getName()<<PEGASUS_STD(endl));                                       pr.getName (),
                                        CIMKeyBinding::STRING));
  
         for(Uint32 i = 0, n = request->classNames.size(); i < n; i++) {             sPath.setKeyBindings (kb);
             CIMObjectPath className(  
                 System::getHostName(),  
                 request->nameSpace,  
                 request->classNames[i]);  
             eSelx->classNames.append(className);  
         }  
  
         CIMPropertyList propertyList = request->propertyList;             AutoMutex lock (mutexSelxTab);
  
         if (!propertyList.isNull())             DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: Adding to selxTab "<<sPath.toString ()<<PEGASUS_STD(endl));
         {  
            Array<CIMName> p      = propertyList.getPropertyNameArray();  
            int            pCount = p.size();  
  
            eSelx->props=(const char**)malloc((1+pCount)*sizeof(char*));             selxTab.insert (sPath.toString (), srec);
  
            for (int i=0; i<pCount; i++)             DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: For selxTab "<<sPath.toString ()<<", srec = "<<PEGASUS_STD(hex)<<(long)srec<<PEGASUS_STD(dec)<<", qContext = "<<PEGASUS_STD(hex)<<(long)qContext<<PEGASUS_STD(dec)<<PEGASUS_STD(endl));
            {  
               eSelx->props[i]=strdup(p[i].getString().getCString());  
            }  
            eSelx->props[pCount]=NULL;  
         }         }
  
           PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.createSubscriptionRequest: " + pr.getName());
   
           DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: Calling provider createSubscriptionRequest: "<<pr.getName()<<PEGASUS_STD(endl));
   
         JvmVector *jv = 0;         JvmVector *jv = 0;
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
Line 4298 
Line 6287 
         {         {
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
  
             STAT_COPYDISPATCHER  
   
             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
Line 4307 
Line 6294 
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;  
   
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
  
           getInterfaceType (pidc,
                             interfaceType,
                             interfaceVersion);
   
           if (interfaceType == "JMPI")
           {
         // public void activateFilter (org.pegasus.jmpi.SelectExp     filter,         // public void activateFilter (org.pegasus.jmpi.SelectExp     filter,
         //                             java.lang.String               eventType,         //                             java.lang.String               eventType,
         //                             org.pegasus.jmpi.CIMObjectPath classPath,         //                             org.pegasus.jmpi.CIMObjectPath classPath,
         //                             java.lang.String               owner)             //                             boolean                        firstActivation)
         //        throws org.pegasus.jmpi.CIMException         //        throws org.pegasus.jmpi.CIMException
         id = env->GetMethodID((jclass)pr.jProviderClass,         id = env->GetMethodID((jclass)pr.jProviderClass,
                               "activateFilter",                               "activateFilter",
Line 4322 
Line 6315 
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_EVENTPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: found METHOD_EVENTPROVIDER."<<PEGASUS_STD(endl));
              }
           }
           else if (interfaceType == "JMPIExperimental")
           {
              // public void activateFilter (org.pegasus.jmpi.OperationContext oc,
              //                             org.pegasus.jmpi.SelectExp        filter,
              //                             java.lang.String                  eventType,
              //                             org.pegasus.jmpi.CIMObjectPath    classPath,
              //                             boolean                           firstActivation)
              //        throws org.pegasus.jmpi.CIMException
              id = env->GetMethodID ((jclass)pr.jProviderClass,
                                     "activateFilter",
                                     "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;Lorg/pegasus/jmpi/CIMObjectPath;Z)V");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_EVENTPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: found METHOD_EVENTPROVIDER2."<<PEGASUS_STD(endl));
              }
           }
   
           if (id == NULL)
           {
              DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: No method found!"<<PEGASUS_STD(endl));
   
              PEG_METHOD_EXIT();
   
              throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                             MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND",
                                                                 "Could not find a method for the provider based on InterfaceType."));
         }         }
  
         JMPIjvm::checkException(env);         JMPIjvm::checkException(env);
  
         switch (eMethodFound)         switch (eMethodFound)
         {         {
         case METHOD_SNIA_PROVIDER20:          case METHOD_EVENTPROVIDER:
         {         {
             jint    jSelRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx);              WQLSelectStatement *stmt       = newSelectExp (srec->query,
             jobject jSel    = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jSelRef);                                                             srec->queryLanguage);
               jlong               jStmtRef   = DEBUG_ConvertCToJava (WQLSelectStatement *, jlong, stmt);
               jobject             jSelectExp = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewJ,jStmtRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, &eSelx->classNames[0]);              jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString());
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);  
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString());              CIMObjectPath *cop     = new CIMObjectPath (System::getHostName(),
                                                           request->nameSpace,
                                                           request->classNames[0]);
               jlong          jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, cop);
               jobject        jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               StatProviderTimeMeasurement providerTime(response);
   
             env->CallVoidMethod((jobject)pr.jProvider,             env->CallVoidMethod((jobject)pr.jProvider,
                                 id,                                 id,
                                 jSel,                                   jSelectExp,
                                 jType,                                 jType,
                                 jcop,                                 jcop,
                                 (jboolean)0);                                   (jboolean)fNewPrec);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
               break;
           }
  
             //          case METHOD_EVENTPROVIDER2:
             //  Increment count of current subscriptions for this provider  
             //  
             if (ph.GetProvider ().testIfZeroAndIncrementSubscriptions ())  
             {             {
                 //              jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
                 //  If there were no current subscriptions before the increment,              jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
                 //  the first subscription has been created  
                 //  Call the provider's enableIndications method              WQLSelectStatement *stmt       = newSelectExp (srec->query,
                 //                                                             srec->queryLanguage);
                 if (_subscriptionInitComplete)              jlong               jStmtRef   = DEBUG_ConvertCToJava (WQLSelectStatement *, jlong, stmt);
               jobject             jSelectExp = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewJ,jStmtRef);
   
               JMPIjvm::checkException(env);
   
               jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString());
   
               JMPIjvm::checkException(env);
   
               CIMObjectPath *cop     = new CIMObjectPath (System::getHostName(),
                                                           request->nameSpace,
                                                           request->classNames[0]);
               jlong          jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, cop);
               jobject        jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
   
               JMPIjvm::checkException(env);
   
               StatProviderTimeMeasurement providerTime(response);
   
               env->CallVoidMethod ((jobject)pr.jProvider,
                                    id,
                                    joc,
                                    jSelectExp,
                                    jType,
                                    jcop,
                                    (jboolean)fNewPrec);
   
               JMPIjvm::checkException(env);
   
               if (joc)
                 {                 {
                     prec->enabled = true;                 env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
                     CIMRequestMessage * request = 0;  
                     CIMResponseMessage * response = 0;  
                     prec->handler = new EnableIndicationsResponseHandler(  
                         request,  
                         response,  
                         req_provider,  
                         _indicationCallback,  
                         _responseChunkCallback);  
                 }  
             }  
  
             STAT_PMS_PROVIDEREND;                 JMPIjvm::checkException(env);
               }
             break;             break;
         }         }
  
Line 4389 
Line 6438 
             break;             break;
         }         }
         }         }
   
     }     }
     HandlerCatch(handler);     HandlerCatch(handler);
  
Line 4408 
Line 6456 
  
     typedef enum {     typedef enum {
        METHOD_UNKNOWN = 0,        METHOD_UNKNOWN = 0,
        METHOD_SNIA_PROVIDER20,         METHOD_EVENTPROVIDER,
          METHOD_EVENTPROVIDER2,
     } METHOD_VERSION;     } METHOD_VERSION;
     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;
     JNIEnv          *env           = NULL;     JNIEnv          *env           = NULL;
       bool                     fFreePrec    = false;
       indProvRecord           *prec         = NULL;
       indSelectRecord         *srec         = NULL;
  
     try {     try {
         String              providerName,          String              fileName,
                               providerName,
                             providerLocation;                             providerLocation;
         CIMInstance         req_provider,         CIMInstance         req_provider,
                             req_providerModule;                             req_providerModule;
Line 4423 
Line 6476 
         req_provider       = pidc.getProvider();         req_provider       = pidc.getProvider();
         req_providerModule = pidc.getModule();         req_providerModule = pidc.getModule();
  
         LocateIndicationProviderNames(req_provider, req_providerModule, providerName,providerLocation);          LocateIndicationProviderNames (req_provider,
                                          req_providerModule,
         Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,                                         providerName,
                                          providerLocation);
   
           fileName = resolveFileName (providerLocation);
   
           Logger::put (Logger::STANDARD_LOG,
                        System::CIMSERVER,
                        Logger::TRACE,
             "JMPIProviderManager::handleDeleteSubscriptionRequest - Host name: $0  Name space: $1  Provider name(s): $2",             "JMPIProviderManager::handleDeleteSubscriptionRequest - Host name: $0  Name space: $1  Provider name(s): $2",
             System::getHostName(),             System::getHostName(),
             request->nameSpace.getString(),             request->nameSpace.getString(),
             providerName);             providerName);
  
         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", providername = "<<providerName<<PEGASUS_STD(endl));          DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: hostname = "
                                <<System::getHostName()
         String fileName = resolveFileName(providerLocation);                               <<", namespace = "
                                <<request->nameSpace.getString()
                                <<", providername = "
                                <<providerName
                                <<", fileName = "
                                <<fileName
                                <<PEGASUS_STD(endl));
  
         // get cached or load new provider module         // get cached or load new provider module
         JMPIProvider::OpProviderHolder ph =          JMPIProvider::OpProviderHolder ph = providerManager.getProvider (fileName,
             providerManager.getProvider(fileName, providerName, String::EMPTY);                                                                           providerName,
                                                                            String::EMPTY);
  
         indProvRecord *prec = NULL;          JMPIProvider &pr = ph.GetProvider ();
   
           {
              AutoMutex lock (mutexProvTab);
  
         provTab.lookup(providerName,prec);         provTab.lookup(providerName,prec);
           }
   
           {
              AutoMutex lock (prec->mutex);
   
         if (--prec->count <= 0)         if (--prec->count <= 0)
         {         {
                  DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: Removing provTab "<<providerName<<PEGASUS_STD(endl));
   
             provTab.remove(providerName);             provTab.remove(providerName);
             prec=NULL;  
                  fFreePrec = true;
              }
         }         }
  
         indSelectRecord     *srec        = NULL;          {
         const CIMObjectPath &sPath       = request->subscriptionInstance.getPath();             CIMObjectPath        sPath = request->subscriptionInstance.getPath ();
         String               sPathString = sPath.toString();             Array<CIMKeyBinding> kb;
  
         selxTab.lookup(sPathString,srec);             // Technically we only need Name and Handler for uniqueness
              kb = sPath.getKeyBindings ();
  
         CMPI_SelectExp          *eSelx    = srec->eSelx;             // Add an entry for every provider.
         CIMOMHandleQueryContext *qContext = srec->qContext;             kb.append (CIMKeyBinding ("Provider",
                                        pr.getName (),
                                        CIMKeyBinding::STRING));
  
         selxTab.remove(sPathString);             sPath.setKeyBindings (kb);
  
         // convert arguments             String sPathString = sPath.toString ();
         OperationContext context;  
  
         context.insert(request->operationContext.get(IdentityContainer::NAME));             AutoMutex lock (mutexSelxTab);
         context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));  
         context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));  
         context.insert(request->operationContext.get(SubscriptionInstanceContainer::NAME));  
  
         CIMObjectPath subscriptionName = request->subscriptionInstance.getPath();             DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: Removing selxTab "<<sPathString<<PEGASUS_STD(endl));
  
         JMPIProvider & pr=ph.GetProvider();             if (!selxTab.lookup (sPathString, srec))
              {
                  PEGASUS_ASSERT(0);
              }
   
              DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: For selxTab "<<sPathString<<", srec = "<<PEGASUS_STD(hex)<<(long)srec<<PEGASUS_STD(dec)<<", qContext = "<<PEGASUS_STD(hex)<<(long)srec->qContext<<PEGASUS_STD(dec)<<PEGASUS_STD(endl));
   
              selxTab.remove (sPathString);
           }
  
         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.deleteSubscriptionRequest: " + pr.getName());         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.deleteSubscriptionRequest: " + pr.getName());
  
Line 4483 
Line 6569 
         {         {
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
  
             STAT_COPYDISPATCHER  
   
             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,             throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",                                            MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));                                                               "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
Line 4492 
Line 6576 
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;  
   
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
  
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
   
           if (interfaceType == "JMPI")
           {
         // public void deActivateFilter (org.pegasus.jmpi.SelectExp    filter,         // public void deActivateFilter (org.pegasus.jmpi.SelectExp    filter,
         //                              java.lang.String               eventType,         //                              java.lang.String               eventType,
         //                              org.pegasus.jmpi.CIMObjectPath classPath,         //                              org.pegasus.jmpi.CIMObjectPath classPath,
Line 4507 
Line 6597 
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_EVENTPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: found METHOD_EVENTPROVIDER."<<PEGASUS_STD(endl));
              }
           }
           else if (interfaceType == "JMPIExperimental")
           {
              // public void deActivateFilter (org.pegasus.jmpi.OperationContext oc,
              //                               org.pegasus.jmpi.SelectExp        filter,
              //                               java.lang.String                  eventType,
              //                               org.pegasus.jmpi.CIMObjectPath    classPath,
              //                               boolean                           lastActivation)
              //        throws org.pegasus.jmpi.CIMException
              id = env->GetMethodID((jclass)pr.jProviderClass,
                                    "deActivateFilter",
                                    "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;Lorg/pegasus/jmpi/CIMObjectPath;Z)V");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_EVENTPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: found METHOD_EVENTPROVIDER2."<<PEGASUS_STD(endl));
              }
           }
   
           if (id == NULL)
           {
              DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: No method found!"<<PEGASUS_STD(endl));
   
              PEG_METHOD_EXIT();
   
              throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                             MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND",
                                                                 "Could not find a method for the provider based on InterfaceType."));
         }         }
  
         JMPIjvm::checkException(env);         JMPIjvm::checkException(env);
  
         switch (eMethodFound)         switch (eMethodFound)
         {         {
         case METHOD_SNIA_PROVIDER20:          case METHOD_EVENTPROVIDER:
         {         {
             jint    jObj = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx);              WQLSelectStatement *stmt       = newSelectExp (srec->query,
             jobject jSel = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jObj);                                                             srec->queryLanguage);
               jlong               jStmtRef   = DEBUG_ConvertCToJava (WQLSelectStatement *, jlong, stmt);
               jobject             jSelectExp = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewJ,jStmtRef);
   
               JMPIjvm::checkException(env);
   
               jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString());
   
               JMPIjvm::checkException(env);
   
               CIMObjectPath *cop     = new CIMObjectPath (System::getHostName(),
                                                           request->nameSpace,
                                                           request->classNames[0]);
               jlong          jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, cop);
               jobject        jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
   
               JMPIjvm::checkException(env);
   
               StatProviderTimeMeasurement providerTime(response);
   
               env->CallVoidMethod ((jobject)pr.jProvider,
                                    id,
                                    jSelectExp,
                                    jType,
                                    jcop,
                                    (jboolean)fFreePrec);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
               break;
           }
  
             jObj = DEBUG_ConvertCToJava (CIMObjectPath*, jint, &eSelx->classNames[0]);          case METHOD_EVENTPROVIDER2:
           {
               jlong   jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef);
  
             jobject jRef = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jObj);              WQLSelectStatement *stmt       = newSelectExp (srec->query,
                                                              srec->queryLanguage);
               jlong               jStmtRef   = DEBUG_ConvertCToJava (WQLSelectStatement *, jlong, stmt);
               jobject             jSelectExp = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewJ,jStmtRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 4532 
Line 6685 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               CIMObjectPath *cop     = new CIMObjectPath (System::getHostName(),
                                                           request->nameSpace,
                                                           request->classNames[0]);
               jlong          jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, cop);
               jobject        jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef);
   
               JMPIjvm::checkException(env);
   
               StatProviderTimeMeasurement providerTime(response);
   
             env->CallVoidMethod((jobject)pr.jProvider,             env->CallVoidMethod((jobject)pr.jProvider,
                                 id,                                 id,
                                 jSel,                                   joc,
                                    jSelectExp,
                                 jType,                                 jType,
                                 jRef,                                   jcop,
                                 (jboolean)(prec==NULL));                                   (jboolean)fFreePrec);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             //              if (joc)
             //  Decrement count of current subscriptions for this provider  
             //  
             if (ph.GetProvider ().decrementSubscriptionsAndTestIfZero ())  
             {  
                 //  
                 //  If there are no current subscriptions after the decrement,  
                 //  the last subscription has been deleted  
                 //  Call the provider's disableIndications method  
                 //  
                 if (_subscriptionInitComplete)  
                 {                 {
                     prec->enabled = false;                 env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
                     if (prec->handler) delete prec->handler;  
                     prec->handler = NULL;  
                 }  
             }  
  
             STAT_PMS_PROVIDEREND;                 JMPIjvm::checkException(env);
               }
             delete eSelx;  
             delete qContext;  
             delete srec;  
             break;             break;
         }         }
  
Line 4573 
Line 6720 
             break;             break;
         }         }
         }         }
   
           //
           //  Decrement count of current subscriptions for this provider
           //
           pr.decrementSubscriptionsAndTestIfZero ();
     }     }
     HandlerCatch(handler);     HandlerCatch(handler);
  
       if (srec)
       {
          delete srec->qContext;
       }
       delete srec;
   
       if (fFreePrec)
       {
          delete prec->ctx;
          delete prec->handler;
          delete prec;
       }
   
     if (env) JMPIjvm::detachThread();     if (env) JMPIjvm::detachThread();
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
     STAT_COPYDISPATCHER  
   
     return(response);     return(response);
 } }
  
Line 4624 
Line 6787 
  
     PEGASUS_ASSERT(response != 0);     PEGASUS_ASSERT(response != 0);
  
     // preserve message key  
     response->setKey(request->getKey());  
   
     //     //
     //  Set HTTP method in response from request     //  Set HTTP method in response from request
     //     //
Line 4658 
Line 6818 
  
     PEGASUS_ASSERT(response != 0);     PEGASUS_ASSERT(response != 0);
  
     // preserve message key  
     response->setKey(request->getKey());  
   
     //  Set HTTP method in response from request     //  Set HTTP method in response from request
     response->setHttpMethod (request->getHttpMethod ());     response->setHttpMethod (request->getHttpMethod ());
  
Line 4686 
Line 6843 
  
     PEGASUS_ASSERT(response != 0);     PEGASUS_ASSERT(response != 0);
  
     // preserve message key  
     response->setKey(request->getKey());  
   
     //  Set HTTP method in response from request     //  Set HTTP method in response from request
     response->setHttpMethod (request->getHttpMethod ());     response->setHttpMethod (request->getHttpMethod ());
  
Line 4713 
Line 6867 
            request->operationContext.get(ProviderIdContainer::NAME));            request->operationContext.get(ProviderIdContainer::NAME));
  
         // get cached or load new provider module         // get cached or load new provider module
         JMPIProvider::OpProviderHolder ph =          JMPIProvider::OpProviderHolder ph = providerManager.getProvider (name.getPhysicalName(),
             providerManager.getProvider(name.getPhysicalName(),                                                                           name.getLogicalName(),
                name.getLogicalName(), String::EMPTY);                                                                           String::EMPTY);
  
     }     }
     HandlerCatch(handler);     HandlerCatch(handler);
Line 4752 
Line 6906 
     //  provider's enableIndications method     //  provider's enableIndications method
     //     //
     Array <JMPIProvider *> enableProviders;     Array <JMPIProvider *> enableProviders;
   
     enableProviders = providerManager.getIndicationProvidersToEnable ();     enableProviders = providerManager.getIndicationProvidersToEnable ();
  
     Uint32 numProviders = enableProviders.size ();     Uint32 numProviders = enableProviders.size ();
   
       DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleSubscriptionInitCompleteRequest: numProviders = "<<numProviders<<PEGASUS_STD(endl));
   
   #if 0
     for (Uint32 i = 0; i < numProviders; i++)     for (Uint32 i = 0; i < numProviders; i++)
     {     {
         try         try
         {         {
             CIMInstance provider;             CIMInstance provider;
   
             provider = enableProviders [i]->getProviderInstance ();             provider = enableProviders [i]->getProviderInstance ();
  
               DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleSubscriptionInitCompleteRequest: name = "<<enableProviders[i]->getName ()<<PEGASUS_STD(endl));
   
             //             //
             //  Get cached or load new provider module             //  Get cached or load new provider module
             //             //
             JMPIProvider::OpProviderHolder ph = providerManager.getProvider              JMPIProvider::OpProviderHolder  ph   = providerManager.getProvider (enableProviders[i]->getModule ()->getFileName (),
                 (enableProviders [i]->getModule ()->getFileName (),  
                  enableProviders [i]->getName ());                  enableProviders [i]->getName ());
   
             indProvRecord * prec = NULL;             indProvRecord * prec = NULL;
             provTab.lookup (enableProviders [i]->getName (), prec);  
             if (prec)  
             {             {
                 prec->enabled = true;                 AutoMutex lock (mutexProvTab);
                 CIMRequestMessage * request = 0;  
                 CIMResponseMessage * response = 0;                 provTab.lookup (enableProviders[i]->getName (), prec);
                 prec->handler = new EnableIndicationsResponseHandler(  
                     request,  
                     response,  
                     provider,  
                     _indicationCallback,  
                     _responseChunkCallback);  
             }             }
         }         }
         catch (CIMException & e)         catch (CIMException & e)
Line 4796 
Line 6949 
         }         }
         catch(...)         catch(...)
         {         {
             PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL2,              PEG_TRACE_CSTRING (TRC_PROVIDERMANAGER, Tracer::LEVEL2,
                 "Unknown error in handleSubscriptionInitCompleteRequest");                 "Unknown error in handleSubscriptionInitCompleteRequest");
         }         }
     }     }
   #endif
  
     PEG_METHOD_EXIT ();     PEG_METHOD_EXIT ();
     return (response);     return (response);
Line 4848 
Line 7002 
  
 String JMPIProviderManager::resolveFileName(String fileName) String JMPIProviderManager::resolveFileName(String fileName)
 { {
     String name;      String name = ConfigManager::getHomedPath(ConfigManager::getInstance()->getCurrentValue("providerDir"));
     #if defined(PEGASUS_OS_TYPE_WINDOWS)      // physfilename = everything up to the delimiter pointing at class start
     name = fileName; // + String(".dll");      // in case there is no delimiter anymore, it takes the entire filename
     #elif defined(PEGASUS_OS_HPUX) && defined(PEGASUS_PLATFORM_HPUX_PARISC_ACC)      String physfilename = fileName.subString(0, fileName.find(":"));
     name = ConfigManager::getHomedPath(ConfigManager::getInstance()->getCurrentValue("providerDir"));      // look in all(multiple) homed pathes for the physical file
     name.append(String("/") + fileName); // + String(".sl"));      name = FileSystem::getAbsoluteFileName(name, physfilename);
     #elif defined(PEGASUS_OS_HPUX) && !defined(PEGASUS_PLATFORM_HPUX_PARISC_ACC)      // construct back the fully specified jar:<classname> provider name
     name = ConfigManager::getHomedPath(ConfigManager::getInstance()->getCurrentValue("providerDir"));      name = FileSystem::extractFilePath(name) + fileName;
     name.append(String("/") + fileName); // + String(".so"));  
     #elif defined(PEGASUS_OS_OS400)  
     name = filrName;  
     #else  
     name = ConfigManager::getHomedPath(ConfigManager::getInstance()->getCurrentValue("providerDir"));  
     name.append(String("/") + fileName); // + String(".so"));  
     #endif  
     return name;     return name;
 } }
  


Legend:
Removed from v.1.38.2.2  
changed lines
  Added in v.1.59.4.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2