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

version 1.29, 2005/06/07 18:11:17 version 1.59.4.2, 2007/07/07 01:35:43
Line 1 
Line 1 
 //%2005////////////////////////////////////////////////////////////////////////  //%2006////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
Line 8 
Line 8 
 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 // EMC Corporation; VERITAS Software Corporation; The Open Group. // EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; Symantec Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 27 
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 45 
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 67 
Line 63 
 #define DDD(x) #define DDD(x)
 #endif #endif
  
   // request->localOnly is replaced with JMPI_LOCALONLY for getInstance () and enumerateInstances ()
   #define JMPI_LOCALONLY false
   
   /* Fix for 4092 */
   // request->includeQualifiers is replaced with JMPI_INCLUDE_QUALIFIERS for getInstance (),
   //    setInstance (), enumerateInstances (), associators (), and references ()
   #define JMPI_INCLUDE_QUALIFIERS false
   
 #include "Convert.h" #include "Convert.h"
  
 void JMPIProviderManager::debugPrintMethodPointers (JNIEnv *env, jclass jc) void JMPIProviderManager::debugPrintMethodPointers (JNIEnv *env, jclass jc)
 { {
    // cd ${PEGAUSE_HOME}/src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/tests/JMPI_TestPropertyTypes    // cd ${PEGAUSE_HOME}/src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/tests/JMPI_TestPropertyTypes
    // javap -s -p JMPI_TestPropertyTypes    // javap -s -p JMPI_TestPropertyTypes
    static const char *methodNames[][2] = {     static const char *methodNames[][3] = {
       // CIMProvider       // CIMProvider
       //   cimom-2003-11-24/org/snia/wbem/provider/CIMProvider.java       //   cimom-2003-11-24/org/snia/wbem/provider/CIMProvider.java
       //   src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/CIMProvider.java       //   src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/CIMProvider.java
       {"initialize","(Lorg/pegasus/jmpi/CIMOMHandle;)V"},        {"snia 2.0","initialize","(Lorg/pegasus/jmpi/CIMOMHandle;)V"},
       {"cleanup","()V"},        {"snia 2.0","cleanup","()V"},
       // InstanceProvider       // InstanceProvider
       //   cimom-2003-11-24/org/snia/wbem/provider/InstanceProvider.java       //   cimom-2003-11-24/org/snia/wbem/provider/InstanceProvider.java
       //   src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/CIMInstanceProvider.java       //   src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/CIMInstanceProvider.java
       {"enumInstances","(Lorg/pegasus/jmpi/CIMObjectPath;ZLorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;"},        {"snia 2.0","enumInstances","(Lorg/pegasus/jmpi/CIMObjectPath;ZLorg/pegasus/jmpi/CIMClass;Z)Ljava/util/Vector;"},
       {"enumInstances","(Lorg/pegasus/jmpi/CIMObjectPath;ZLorg/pegasus/jmpi/CIMClass;Z)Ljava/util/Vector;"},        {"pegasus 2.4","enumInstances","(Lorg/pegasus/jmpi/CIMObjectPath;ZZZ[Ljava/lang/String;Lorg/pegasus/jmpi/CIMClass;)[Lorg/pegasus/jmpi/CIMInstance;"},
       {"getInstance","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;Z)Lorg/pegasus/jmpi/CIMInstance;"},        /* Begin Fix for 4189 */
       {"createInstance","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMInstance;)Lorg/pegasus/jmpi/CIMObjectPath;"},        {"pegasus 2.5","enumerateInstances","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;ZZ[Ljava/lang/String;)Ljava/util/Vector;"},
       {"setInstance","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMInstance;)V"},        /* End Fix for 4189 */
       {"deleteInstance","(Lorg/pegasus/jmpi/CIMObjectPath;)V"},        {"snia 2.0","enumInstances","(Lorg/pegasus/jmpi/CIMObjectPath;ZLorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;"},
       {"execQuery","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ILorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;"},        {"pegasus 2.4","enumerateInstanceNames","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;)[Lorg/pegasus/jmpi/CIMObjectPath;"},
         {"pegasus 2.5","enumerateInstanceNames","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;"},
         {"snia 2.0","getInstance","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;Z)Lorg/pegasus/jmpi/CIMInstance;"},
         {"pegasus 2.4","getInstance","(Lorg/pegasus/jmpi/CIMObjectPath;ZZZ[Ljava/lang/String;Lorg/pegasus/jmpi/CIMClass;)Lorg/pegasus/jmpi/CIMInstance;"},
         /* Begin Fix for 4238 */
         {"pegasus 2.5","getInstance","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;ZZ[Ljava/lang/String;)Lorg/pegasus/jmpi/CIMInstance;"},
         /* End Fix for 4238 */
         {"snia 2.0","createInstance","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMInstance;)Lorg/pegasus/jmpi/CIMObjectPath;"},
         {"snia 2.0","setInstance","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMInstance;)V"},
         {"pegasus 2.4","setInstance","(Lorg/pegasus/jmpi/CIMObjectPath;Z[Ljava/lang/String)V"},
         {"snia 2.0","deleteInstance","(Lorg/pegasus/jmpi/CIMObjectPath;)V"},
         {"snia 2.0","execQuery","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ILorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;"},
         {"pegasus 2.4","execQuery","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Lorg/pegasus/jmpi/CIMClass;)[Lorg/pegasus/jmpi/CIMInstance;"},
         {"pegasus 2.5","execQuery","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector;"},
       // MethodProvider       // MethodProvider
       //   cimom-2003-11-24/org/snia/wbem/provider/MethodProvider.java       //   cimom-2003-11-24/org/snia/wbem/provider/MethodProvider.java
       //   src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/CIMMethodProvider.java       //   src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/CIMMethodProvider.java
       {"invokeMethod","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/util/Vector;Ljava/util/Vector;)Lorg/pegasus/jmpi/CIMValue;"},        {"snia 2.0","invokeMethod","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/util/Vector;Ljava/util/Vector;)Lorg/pegasus/jmpi/CIMValue;"},
         {"pegasus 2.4","invokeMethod","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;[Lorg/pegasus/jmpi/CIMArgument;[Lorg/pegasus/jmpi/CIMArgument;)Lorg/pegasus/jmpi/CIMValue;"},
       // PropertyProvider       // PropertyProvider
       //   cimom-2003-11-24/org/snia/wbem/provider/PropertyProvider.java       //   cimom-2003-11-24/org/snia/wbem/provider/PropertyProvider.java
         //   src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/PropertyProvider.java
         {"snia 2.0","getPropertyValue","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;)Lorg/pegasus/jmpi/CIMValue;"},
         {"snia 2.0","setPropertyValue","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Lorg/pegasus/jmpi/CIMValue;)V"},
       // AssociatorProvider       // AssociatorProvider
       //   cimom-2003-11-24/org/snia/wbem/provider20/AssociatorProvider.java       //   cimom-2003-11-24/org/snia/wbem/provider20/AssociatorProvider.java
       //   src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/CIMAssociationProvider.java        //   src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/AssociatorProvider.java
         {"snia 2.0","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;"},
         {"pegasus 2.4","associators","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;"},
         {"snia 2.0","associatorNames","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector;"},
         {"pegasus 2.4","associatorNames","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector;"},
         {"snia 2.0","references","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;"},
         {"pegasus 2.4","references","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;"},
         {"snia 2.0","referenceNames","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)Ljava/util/Vector;"},
         {"pegasus 2.4","referenceNames","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)Ljava/util/Vector;"},
       // CIMProviderRouter       // CIMProviderRouter
       //   cimom-2003-11-24/org/snia/wbem/provider20/CIMProviderRouter.java       //   cimom-2003-11-24/org/snia/wbem/provider20/CIMProviderRouter.java
       // EventProvider       // EventProvider
       //   cimom-2003-11-24/org/snia/wbem/provider20/EventProvider.java       //   cimom-2003-11-24/org/snia/wbem/provider20/EventProvider.java
       //   src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/EventProvider.java       //   src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/EventProvider.java
       {"authorizeFilter","(Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)V"},        {"snia 2.0","activateFilter","(Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;Lorg/pegasus/jmpi/CIMObjectPath;Z)V"},
       {"mustPoll","(Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;Lorg/pegasus/jmpi/CIMObjectPath;)Z"},        {"snia 2.0","deActivateFilter","(Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;Lorg/pegasus/jmpi/CIMObjectPath;Z)V"},
       {"activateFilter","(Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;Lorg/pegasus/jmpi/CIMObjectPath;Z)V"},  
       {"deActivateFilter","(Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;Lorg/pegasus/jmpi/CIMObjectPath;Z)V"},  
       // IndicationHandler       // IndicationHandler
       //   cimom-2003-11-24/org/snia/wbem/provider20/IndicationHandler.java       //   cimom-2003-11-24/org/snia/wbem/provider20/IndicationHandler.java
       // ProviderAdapter       // ProviderAdapter
       //   cimom-2003-11-24/org/snia/wbem/provider20/ProviderAdapter.java       //   cimom-2003-11-24/org/snia/wbem/provider20/ProviderAdapter.java
       // JMPI_TestPropertyTypes       // JMPI_TestPropertyTypes
       {"findObjectPath","(Lorg/pegasus/jmpi/CIMObjectPath;)I"},        {"JMPI_TestPropertyTypes","findObjectPath","(Lorg/pegasus/jmpi/CIMObjectPath;)I"},
       {"testPropertyTypesValue","(Lorg/pegasus/jmpi/CIMInstance;)V"}        {"JMPI_TestPropertyTypes","testPropertyTypesValue","(Lorg/pegasus/jmpi/CIMInstance;)V"}
    };    };
  
    if (!env)    if (!env)
Line 129 
Line 156 
  
    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][0], methodNames[i][1]);        jmethodID id = env->GetMethodID(jc,methodNames[i][1], methodNames[i][2]);
       DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::debugPrintMethodPointers: "<<methodNames[i][0]<<", 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 214 
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 244 
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 382 
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()); \      type1##ResponseHandler handler(request, response, _responseChunkCallback);
     response->setHttpMethod(request->getHttpMethod()); \  
     type1##ResponseHandler handler(request, response);  
   
 #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 429 
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 453 
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_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 487 
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 498 
Line 623 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);          if (!env)
           {
               PEG_METHOD_EXIT();
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                                 "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
           }
  
         STAT_GETSTARTTIME;  ////////DDD(debugPrintMethodPointers (env, (jclass)pr.jProviderClass));
   
           JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
  
         // public abstract org.pegasus.jmpi.CIMInstance getInstance (org.pegasus.jmpi.CIMObjectPath cop,          if (interfaceType == "JMPI")
           {
              // public 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 514 
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 535 
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);
  
             CIMClass cls = pr._cimom_handle->getClass(context,              CIMClass cls;
   
               try
               {
                  DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->instanceName.getClassName()<<PEGASUS_STD(endl));
                  AutoMutex lock (pr._cimomMutex);
   
                  cls = pr._cimom_handle->getClass(context,
                                                       request->nameSpace,                                                       request->nameSpace,
                                                       request->instanceName.getClassName(),                                                       request->instanceName.getClassName(),
                                                       false,                                                       false,
                                                       true,                                                       true,
                                                       true,                                                       true,
                                                       CIMPropertyList());                                                       CIMPropertyList());
                  DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->instanceName.getClassName()<<PEGASUS_STD(endl));
               }
               catch (CIMException e)
               {
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstanceRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
                  throw;
               }
   
             CIMClass *pcls = new CIMClass (cls);             CIMClass *pcls = new CIMClass (cls);
  
             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,
                                                    request->localOnly,                                                     JMPI_LOCALONLY,
                                                    request->includeQualifiers,                                                     JMPI_INCLUDE_QUALIFIERS,
                                                    request->includeClassOrigin,                                                    request->includeClassOrigin,
                                                    jPropertyList,                                                    jPropertyList,
                                                    jcimClass);                                                    jcimClass);
  
             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 594 
Line 784 
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          /* Fix for 4238 */
           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);
  
             CIMClass cls = pr._cimom_handle->getClass(context,              CIMClass cls;
   
               try
               {
                  DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->instanceName.getClassName()<<PEGASUS_STD(endl));
                  AutoMutex lock (pr._cimomMutex);
   
                  cls = pr._cimom_handle->getClass(context,
                                                       request->nameSpace,                                                       request->nameSpace,
                                                       request->instanceName.getClassName(),                                                       request->instanceName.getClassName(),
                                                       false,                                                       false,
                                                       true,                                                       true,
                                                       true,                                                       true,
                                                       CIMPropertyList());                                                       CIMPropertyList());
                  DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->instanceName.getClassName()<<PEGASUS_STD(endl));
               }
               catch (CIMException e)
               {
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstanceRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
                  throw;
               }
   
             CIMClass *pcls = new CIMClass (cls);             CIMClass *pcls = new CIMClass (cls);
  
             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);
   
               StatProviderTimeMeasurement providerTime(response);
   
             jobject jciRet = env->CallObjectMethod((jobject)pr.jProvider,             jobject jciRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                    id,                                                    id,
                                                                  joc,
                                                    jop,                                                    jop,
                                                    jcimClass,                                                    jcimClass,
                                                    true);                                                                 JMPI_INCLUDE_QUALIFIERS,
                                                                  request->includeClassOrigin,
                                                                  jPropertyList);
   
               JMPIjvm::checkException(env);
   
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
   
               handler.processing();
   
               if (jciRet) {
                  jlong        jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                  CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
   
                  handler.deliver(*ciRet);
               }
               handler.complete();
               break;
           }
           /* Fix for 4238 */
   
           case METHOD_INSTANCEPROVIDER:
           {
               jlong   jopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath);
               jobject jop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jopRef);
   
               JMPIjvm::checkException(env);
   
               CIMClass cls;
   
               try
               {
                  DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->instanceName.getClassName()<<PEGASUS_STD(endl));
                  AutoMutex lock (pr._cimomMutex);
   
                  cls = pr._cimom_handle->getClass(context,
                                                   request->nameSpace,
                                                   request->instanceName.getClassName(),
                                                   false,
                                                   true,
                                                   true,
                                                   CIMPropertyList());
                  DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->instanceName.getClassName()<<PEGASUS_STD(endl));
               }
               catch (CIMException e)
               {
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstancesRequest: 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);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              StatProviderTimeMeasurement providerTime(response);
   
               // Modified for Bugzilla# 3679
               jobject jciRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                      id,
                                                      jop,
                                                      jcimClass,
                                                      JMPI_LOCALONLY);
   
               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 659 
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_SNIA_PROVIDER20,         METHOD_CIMINSTANCEPROVIDER2,
          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 688 
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 710 
Line 995 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);          if (!env)
           {
               PEG_METHOD_EXIT();
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                                 "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
           }
  
         STAT_GETSTARTTIME;          JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         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 727 
Line 1027 
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_INSTANCEPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_INSTANCEPROVIDER."<<PEGASUS_STD(endl));
         }         }
  
         if (id == NULL)         if (id == NULL)
         {         {
             env->ExceptionClear();             env->ExceptionClear();
  
             // public org.pegasus.jmpi.CIMInstance[] enumerateInstances (org.pegasus.jmpi.CIMObjectPath op,                 // public org.pegasus.jmpi.CIMInstance[] enumerateInstances (org.pegasus.jmpi.CIMObjectPath cop,
             //                                                           boolean                        localOnly,             //                                                           boolean                        localOnly,
             //                                                           boolean                        includeQualifiers,             //                                                           boolean                        includeQualifiers,
             //                                                           boolean                        includeClassOrigin,             //                                                           boolean                        includeClassOrigin,
             //                                                           java.lang.String[]             propertyList,             //                                                           java.lang.String[]             propertyList,
             //                                                           org.pegasus.jmpi.CIMClass      cc)                 //                                                           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,
                                   "enumerateInstances",                                   "enumerateInstances",
Line 748 
Line 1048 
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_PEGASUS_24;                     eMethodFound = METHOD_CIMINSTANCEPROVIDER;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_PEGASUS_24."<<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)
              {
                  env->ExceptionClear();
   
                  // public abstract org.pegasus.jmpi.CIMInstance[] 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;)[Lorg/pegasus/jmpi/CIMInstance;");
   
                  if (id != NULL)
                  {
                      eMethodFound = METHOD_CIMINSTANCEPROVIDER2;
                      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);
  
             CIMClass cls = pr._cimom_handle->getClass(context,              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->nameSpace,
                                                       request->className,                                                       request->className,
                                                       false,                                                       false,
                                                       true,                                                       true,
                                                       true,                                                       true,
                                                       CIMPropertyList());                                                       CIMPropertyList());
                  DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl));
               }
               catch (CIMException e)
               {
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
                  throw;
               }
   
             CIMClass *pcls = new CIMClass (cls);             CIMClass *pcls = new CIMClass (cls);
  
             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,
                                                                    request->localOnly,                                                                               JMPI_LOCALONLY,
                                                                    request->includeQualifiers,                                                                               JMPI_INCLUDE_QUALIFIERS,
                                                                    request->includeClassOrigin,                                                                    request->includeClassOrigin,
                                                                    jPropertyList,                                                                    jPropertyList,
                                                                    jcc);                                                                    jcc);
  
             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 804 
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 */
                       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);                     JMPIjvm::checkException(env);
  
Line 816 
Line 1212 
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          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);
  
             CIMClass cls = pr._cimom_handle->getClass(context,              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->nameSpace,
                                                       request->className,                                                       request->className,
                                                       false,                                                       false,
                                                       true,                                                       true,
                                                       true,                                                       true,
                                                       CIMPropertyList());                                                       CIMPropertyList());
             CIMClass *pcls = new CIMClass (cls);                 DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl));
               }
               catch (CIMException e)
               {
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
                  throw;
               }
   
               CIMClass *pcls = new CIMClass (cls);
   
             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);
  
             jobject jVec = env->CallObjectMethod((jobject)pr.jProvider,              jobjectArray jPropertyList = getList(jv,env,request->propertyList);
   
               StatProviderTimeMeasurement providerTime(response);
   
               jobjectArray jAr           = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                  id,                                                  id,
                                                                                joc,
                                                  jcop,                                                  jcop,
                                                                                jcc,
                                                                                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);
                       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);
   
                       handler.deliver(*ciRet);
                   }
               }
               handler.complete();
               break;
           }
   
           /* Fix for 4189 */
           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);
   
               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,                                                  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::handleEnumerateInstancesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
                  throw;
               }
   
               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);
   
               jobjectArray jPropertyList = getList(jv,env,request->propertyList);
   
               StatProviderTimeMeasurement providerTime(response);
   
               jobject      jVec          = env->CallObjectMethod((jobject)pr.jProvider,
                                                                  id,
                                                                  joc,
                                                                  jcop,
                                                  jcc,                                                  jcc,
                                                  true);                                                                 JMPI_INCLUDE_QUALIFIERS,
                                                                  request->includeClassOrigin,
                                                                  jPropertyList);
   
               JMPIjvm::checkException(env);
   
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  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;
           }
           /* Fix for 4189 */
   
           case METHOD_INSTANCEPROVIDER:
           {
               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::handleEnumerateInstancesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
                  throw;
               }
   
               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);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              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();             handler.processing();
             if (jVec) {             if (jVec) {
Line 859 
Line 1498 
  
                     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 */
                       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.deliver(*ciRet);
                 }                 }
Line 889 
Line 1561 
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "JMPIProviderManager::handleEnumerateInstanceNamesRequest");     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "JMPIProviderManager::handleEnumerateInstanceNamesRequest");
  
     HandlerIntro(EnumerateInstanceNames,message,request,response, handler,Array<CIMObjectPath>());      HandlerIntro(EnumerateInstanceNames,message,request,response, handler);
  
     typedef enum {     typedef enum {
        METHOD_UNKNOWN = 0,        METHOD_UNKNOWN = 0,
        METHOD_PEGASUS_24,         METHOD_CIMINSTANCEPROVIDER,
        METHOD_SNIA_PROVIDER20,         METHOD_CIMINSTANCEPROVIDER2,
          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 918 
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 932 
Line 1606 
  
         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.enumerateInstanceNames: " + pr.getName());         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.enumerateInstanceNames: " + pr.getName());
  
         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: Calling provider : enumerateInstanceNames"<<pr.getName()<<PEGASUS_STD(endl));          DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: Calling provider : enumerateInstanceNames: "<<pr.getName()<<PEGASUS_STD(endl));
  
         JvmVector *jv = 0;         JvmVector *jv = 0;
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);          if (!env)
           {
               PEG_METHOD_EXIT();
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                                 "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
           }
  
         STAT_GETSTARTTIME;          JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         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 954 
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)
Line 971 
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)
              {
                  env->ExceptionClear();
   
                  // public abstract org.pegasus.jmpi.CIMObjectPath[] 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;)[Lorg/pegasus/jmpi/CIMObjectPath;");
   
                  if (id != NULL)
                  {
                      eMethodFound = METHOD_CIMINSTANCEPROVIDER2;
                      DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: found METHOD_CIMINSTANCEPROVIDER2."<<PEGASUS_STD(endl));
                  }
              }
             }             }
   
           if (id == NULL)
           {
              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:
         {         {
             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);
  
             CIMClass cls = pr._cimom_handle->getClass(context,              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->nameSpace,
                                                       request->className,                                                       request->className,
                                                       false,                                                       false,
                                                       true,                                                       true,
                                                       true,                                                       true,
                                                       CIMPropertyList());                                                       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);             CIMClass *pcls = new CIMClass (cls);
  
             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,
                                                                    jcop,                                                                    jcop,
Line 1010 
Line 1763 
  
             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 1772 
  
                     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 1033 
Line 1784 
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          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);
  
             CIMClass cls = pr._cimom_handle->getClass(context,              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->nameSpace,
                                                       request->className,                                                       request->className,
                                                       false,                                                       false,
                                                       true,                                                       true,
                                                       true,                                                       true,
                                                       CIMPropertyList());                                                       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);             CIMClass *pcls = new CIMClass (cls);
  
             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);
  
             jobject jVec = env->CallObjectMethod((jobject)pr.jProvider,              StatProviderTimeMeasurement providerTime(response);
   
               jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                  id,                                                  id,
                                                                      joc,
                                                  jcop,                                                  jcop,
                                                                      jcimClass);
   
               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 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_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);
   
               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,
                                                   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);
   
               jobject jVec = env->CallObjectMethod((jobject)pr.jProvider,
                                                    id,
                                                    joc,
                                                    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();
               if (jVec) {
                   for (int i=0,m=env->CallIntMethod(jVec,JMPIjvm::jv.VectorSize); i<m; i++) {
                       JMPIjvm::checkException(env);
   
                       jobject jcopRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,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_INSTANCEPROVIDER:
           {
               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);
   
               jobject jVec = env->CallObjectMethod((jobject)pr.jProvider,
                                                    id,
                                                    jcop,
                                                    true,
                                                    jcimClass);
   
               JMPIjvm::checkException(env);
  
             handler.processing();             handler.processing();
             if (jVec) {             if (jVec) {
Line 1075 
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 1107 
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 1136 
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 1158 
Line 2076 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);          if (!env)
           {
               PEG_METHOD_EXIT();
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                                 "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
           }
  
         STAT_GETSTARTTIME;          JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
  
         // public abstract org.pegasus.jmpi.CIMObjectPath createInstance (org.pegasus.jmpi.CIMObjectPath cop,          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 1173 
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 1237 
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 1269 
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));
 ////////DDD(debugPrintMethodPointers (env, (jclass)pr.jProviderClass));  
  
         JvmVector *jv = 0;         JvmVector *jv = 0;
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);          if (!env)
           {
               PEG_METHOD_EXIT();
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                                 "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
           }
  
         STAT_GETSTARTTIME;          JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         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 1306 
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 1325 
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,
                                 jci,                                 jci,
                                   JMPI_INCLUDE_QUALIFIERS,
                                 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 1405 
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 1434 
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          // forward request
         OperationContext context;          JMPIProvider &pr = ph.GetProvider();
   
         context.insert(request->operationContext.get(IdentityContainer::NAME));  
         context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));  
         context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));  
   
         // forward request  
         JMPIProvider &pr = ph.GetProvider();  
  
         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.deleteInstance: " + pr.getName());         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.deleteInstance: " + pr.getName());
  
Line 1455 
Line 2533 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);          if (!env)
           {
               PEG_METHOD_EXIT();
  
         STAT_GETSTARTTIME;              throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                                 "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
           }
   
           JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         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 1469 
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);
  
             env->CallVoidMethod((jobject)pr.jProvider,id,jcop);              StatProviderTimeMeasurement providerTime(response);
   
               env->CallVoidMethod((jobject)pr.jProvider,
                                   id,
                                   joc,
                                   jcop);
   
               JMPIjvm::checkException(env);
   
               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);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;              StatProviderTimeMeasurement providerTime(response);
   
               env->CallVoidMethod((jobject)pr.jProvider,
                                   id,
                                   jcop);
   
               JMPIjvm::checkException(env);
             break;             break;
         }         }
  
Line 1512 
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_SNIA_PROVIDER20,         METHOD_CIMINSTANCEPROVIDER2,
          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 1541 
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 1562 
Line 2715 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);          if (!env)
           {
               PEG_METHOD_EXIT();
  
         STAT_GETSTARTTIME;              throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                                 "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
           }
   
           JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         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 1580 
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)
         {         {
             env->ExceptionClear();             env->ExceptionClear();
  
             // public abstract org.pegasus.jmpi.CIMInstance[] execQuery(org.pegasus.jmpi.CIMObjectPath op,                 // public abstract org.pegasus.jmpi.CIMInstance[] execQuery(org.pegasus.jmpi.CIMObjectPath cop,
             //                                                          java.lang.String               query,             //                                                          java.lang.String               query,
             //                                                          java.lang.String               ql,             //                                                          java.lang.String               ql,
             //                                                          org.pegasus.jmpi.CIMClass      cc)                 //                                                          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,
                                   "execQuery",                                   "execQuery",
Line 1599 
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)
              {
                  env->ExceptionClear();
   
                  // public abstract org.pegasus.jmpi.CIMInstance[] 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;)[Lorg/pegasus/jmpi/CIMInstance;");
   
                  if (id != NULL)
                  {
                      eMethodFound = METHOD_CIMINSTANCEPROVIDER2;
                      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:
           {
               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);
   
               JMPIjvm::checkException(env);
   
               jlong jcls = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls);
   
               jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcls);
   
               JMPIjvm::checkException(env);
   
               StatProviderTimeMeasurement providerTime(response);
   
               jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                      id,
                                                                      jcop,
                                                                      jquery,
                                                                      jqueryLanguage,
                                                                      jCc);
   
               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_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);
  
             jstring jqueryLanguage = env->NewStringUTF(request->queryLanguage.getCString());             jstring jqueryLanguage = env->NewStringUTF(request->queryLanguage.getCString());
             jstring jquery         = env->NewStringUTF(request->query.getCString());             jstring jquery         = env->NewStringUTF(request->query.getCString());
  
             CIMClass cls = pr._cimom_handle->getClass(context,              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->nameSpace,
                                                       request->className,                                                       request->className,
                                                       false,                                                       false,
                                                       true,                                                       true,
                                                       true,                                                       true,
                                                       CIMPropertyList());                                                       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);             CIMClass *pcls = new CIMClass (cls);
  
             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,
                                                                      joc,
                                                                    jcop,                                                                    jcop,
                                                                    jquery,                                                                    jquery,
                                                                    jqueryLanguage,                                                                    jqueryLanguage,
Line 1649 
Line 2958 
  
             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 1660 
Line 2974 
  
                     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 1672 
Line 2986 
             break;             break;
         }         }
  
         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);
  
             jstring jqueryLanguage = env->NewStringUTF(request->queryLanguage.getCString());             jstring jqueryLanguage = env->NewStringUTF(request->queryLanguage.getCString());
             jstring jquery         = env->NewStringUTF(request->query.getCString());             jstring jquery         = env->NewStringUTF(request->query.getCString());
  
             CIMClass cls = pr._cimom_handle->getClass(context,              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->nameSpace,
                                                       request->className,                                                       request->className,
                                                       false,                                                       false,
                                                       true,                                                       true,
                                                       true,                                                       true,
                                                       CIMPropertyList());                                                       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);             CIMClass *pcls = new CIMClass (cls);
  
               jlong jcls = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls);
   
               jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcls);
   
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint jcls = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);              StatProviderTimeMeasurement providerTime(response);
  
             jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcls);              jobject jVec = env->CallObjectMethod ((jobject)pr.jProvider,
                                                     id,
                                                     joc,
                                                     jcop,
                                                     jCc,
                                                     jquery,
                                                     jqueryLanguage);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint jql = 0; // @BUG - how to convert?              if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
  
             jobjectArray jVec = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,              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);
                       DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: jciRet = "<<jciRet<<PEGASUS_STD(endl));
   
                       JMPIjvm::checkException(env);
   
                       jlong        jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                       CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
   
                       JMPIjvm::checkException(env);
   
                       handler.deliver(*ciRet);
                   }
               }
               DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: done!"<<PEGASUS_STD(endl));
               handler.complete();
               break;
           }
   
           case METHOD_INSTANCEPROVIDER:
           {
               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);
   
               JMPIjvm::checkException(env);
   
               jlong jcls = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls);
   
               jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcls);
   
               JMPIjvm::checkException(env);
   
               jlong jql = 0; // @BUG - how to convert?
   
               StatProviderTimeMeasurement providerTime(response);
   
               jobject jVec = env->CallObjectMethod ((jobject)pr.jProvider,
                                                                     id,                                                                     id,
                                                                     jcop,                                                                     jcop,
                                                                     jquery,                                                                     jquery,
Line 1710 
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 1753 
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 1786 
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 1803 
Line 3222 
  
         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: Calling provider associators: "<<pr.getName()<<", role: "<<request->role<<", aCls: "<<request->assocClass<<PEGASUS_STD(endl));         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: Calling provider associators: "<<pr.getName()<<", role: "<<request->role<<", aCls: "<<request->assocClass<<PEGASUS_STD(endl));
  
         JvmVector *jv = 0;          JvmVector *jv = 0;
   
           env = JMPIjvm::attachThread(&jv);
   
           if (!env)
           {
               PEG_METHOD_EXIT();
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                                 "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
           }
   
           JMPIProvider::pm_service_op_lock op_lock(&pr);
   
           jmethodID id               = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
   
           if (interfaceType == "JMPI")
           {
              // public java.util.Vector associators (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/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_ASSOCIATORPROVIDER;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found METHOD_ASSOCIATORPROVIDER."<<PEGASUS_STD(endl));
              }
   
              if (id == NULL)
              {
                  env->ExceptionClear();
   
                  // public org.pegasus.jmpi.CIMInstance[] associators (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/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_CIMASSOCIATORPROVIDER;
                      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)
              {
                  eMethodFound = METHOD_ASSOCIATORPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found METHOD_ASSOCIATORPROVIDER2."<<PEGASUS_STD(endl));
              }
   
              if (id == NULL)
              {
                  env->ExceptionClear();
   
                  // public org.pegasus.jmpi.CIMInstance[] 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;)[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);
  
         env = JMPIjvm::attachThread(&jv);                      JMPIjvm::checkException(env);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);                      jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
  
         STAT_GETSTARTTIME;                      JMPIjvm::checkException(env);
  
         jmethodID id = NULL;                      CIMInstance         *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
                       CIMClass             cls;
  
         // public abstract java.util.Vector associators (org.pegasus.jmpi.CIMObjectPath assocName,                      try
         //                                               org.pegasus.jmpi.CIMObjectPath pathName,                      {
         //                                               java.lang.String               resultClass,                         DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl));
         //                                               java.lang.String               role,                         AutoMutex lock (pr._cimomMutex);
         //                                               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/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)                         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)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                         DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                         throw;
         }         }
  
         if (id == NULL)                      const CIMObjectPath& op    = ciRet->getPath();
         {                      CIMObjectPath        iop   = ciRet->buildPath(cls);
             env->ExceptionClear();  
  
             // public abstract java.util.Vector associators (org.pegasus.jmpi.CIMObjectPath assocName,                      JMPIjvm::checkException(env);
             //                                               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/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;)[Lorg/pegasus/jmpi/CIMInstance;"  
  
             if (id != NULL)                      iop.setNameSpace(op.getNameSpace());
             {                      ciRet->setPath(iop);
                 eMethodFound = METHOD_PEGASUS_24;  
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                      handler.deliver(*ciRet);
             }             }
         }         }
               handler.complete();
               break;
           }
  
         if (id == NULL)          case METHOD_ASSOCIATORPROVIDER2:
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found no method!"<<PEGASUS_STD(endl));              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);         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, assocPath);  
             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);  
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 1885 
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 1892 
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,
                                                                   false,                                                                    JMPI_INCLUDE_QUALIFIERS,
                                                                   false,                                                                    request->includeClassOrigin,
                                                                   jPropertyList);                                                                   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) {
                 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   = pr._cimom_handle->getClass(context,                      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,                                                                             request->nameSpace,
                                                                             ciRet->getClassName(),                                                                             ciRet->getClassName(),
                                                                             false,                                                                             false,
                                                                             true,                                                                             true,
                                                                             true,                                                                             true,
                                                                             CIMPropertyList());                                                                             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();                     const CIMObjectPath& op    = ciRet->getPath();
                     CIMObjectPath        iop   = ciRet->buildPath(cls);                     CIMObjectPath        iop   = ciRet->buildPath(cls);
  
Line 1942 
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 1972 
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 1979 
Line 3706 
                                                                  jResultClass,                                                                  jResultClass,
                                                                  jRole,                                                                  jRole,
                                                                  jResultRole,                                                                  jResultRole,
                                                                  false,                                                                    JMPI_INCLUDE_QUALIFIERS,
                                                                  false,                                                                    request->includeClassOrigin,
                                                                  jPropertyList);                                                                  jPropertyList);
  
             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 1996 
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       = pr._cimom_handle->getClass(context,                      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,                                                                                 request->nameSpace,
                                                                                 ciRet->getClassName(),                                                                                 ciRet->getClassName(),
                                                                                 false,                                                                                 false,
                                                                                 true,                                                                                 true,
                                                                                 true,                                                                                 true,
                                                                                 CIMPropertyList());                                                                                 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();                     const CIMObjectPath& op        = ciRet->getPath();
                     CIMObjectPath        iop       = ciRet->buildPath(cls);                     CIMObjectPath        iop       = ciRet->buildPath(cls);
  
Line 2040 
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 2073 
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 2094 
Line 3830 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);          if (!env)
           {
               PEG_METHOD_EXIT();
  
         STAT_GETSTARTTIME;              throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                                 "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
           }
   
           JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
  
         // public abstract java.util.Vector associatorNames (org.pegasus.jmpi.CIMObjectPath assocName,          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 2109 
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_ASSOCIATORPROVIDER;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found METHOD_ASSOCIATORPROVIDER."<<PEGASUS_STD(endl));
              }
   
              if (id == NULL)
              {
                  env->ExceptionClear();
   
                  // public org.pegasus.jmpi.CIMObjectPath[] associatorNames (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/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMObjectPath;");
   
                  if (id != NULL)
                  {
                      eMethodFound = METHOD_CIMASSOCIATORPROVIDER;
                      DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found METHOD_CIMASSOCIATORPROVIDER."<<PEGASUS_STD(endl));
                  }
              }
           }
           else if (interfaceType == "JMPIExperimental")
           {
              // public java.util.Vector 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;)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);
   
               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,
                                                                     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,
                                                                     joc,
                                                                     jAssociationName,
                                                                     jPathName,
                                                                     jResultClass,
                                                                     jRole,
                                                                     jResultRole);
   
               JMPIjvm::checkException(env);
   
               if (joc)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));  
                  JMPIjvm::checkException(env);
         }         }
  
         if (id == NULL)              handler.processing();
         {              if (jAr) {
             env->ExceptionClear();                  for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
                       JMPIjvm::checkException(env);
  
             // public abstract java.util.Vector associatorNames (org.pegasus.jmpi.CIMObjectPath assocName,                      jobject jcopRet = env->GetObjectArrayElement(jAr,i);
             //                                                   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/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;)[Lorg/pegasus/jmpi/CIMObjectPath;"  
  
             if (id != NULL)                      JMPIjvm::checkException(env);
             {  
                 eMethodFound = METHOD_PEGASUS_24;                      jlong          jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                      CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef);
   
                       JMPIjvm::checkException(env);
   
                       handler.deliver(*copRet);
                   }
             }             }
               handler.complete();
               break;
         }         }
  
         if (id == NULL)          case METHOD_ASSOCIATORPROVIDER:
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found no method!"<<PEGASUS_STD(endl));              jlong   jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, assocPath);
         }              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, assocPath);  
             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);  
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 2162 
Line 4091 
  
 #ifdef PEGASUS_DEBUG #ifdef PEGASUS_DEBUG
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: assocName   = "<<assocPath->toString ()<<PEGASUS_STD(endl));             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: resultClass = "<<request->resultClass<<PEGASUS_STD(endl));
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: role        = "<<request->role<<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));             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,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                     jPathName,
                                                                   jResultClass,                                                                   jResultClass,
                                                                   jRole,                                                                   jRole,
                                                                   jResultRole);                                                                   jResultRole);
  
             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 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 2199 
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 2225 
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 2235 
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 2246 
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 2278 
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 2311 
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 2332 
Line 4277 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);          if (!env)
           {
               PEG_METHOD_EXIT();
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                                 "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
           }
  
         STAT_GETSTARTTIME;          JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         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 2348 
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)
              {
                  env->ExceptionClear();
   
                  // public org.pegasus.jmpi.CIMInstance[] references (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/CIMObjectPath;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)         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.OperationContext oc,
                  //                                                   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 2368 
Line 4371 
             //        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/OperationContext;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)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_PEGASUS_24;                     eMethodFound = METHOD_CIMASSOCIATORPROVIDER2;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_CIMASSOCIATORPROVIDER2."<<PEGASUS_STD(endl));
                  }
             }             }
         }         }
  
         if (id == NULL)         if (id == NULL)
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found no method!"<<PEGASUS_STD(endl));             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);         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 2407 
Line 4421 
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<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,                                                                   id,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                     jPathName,
                                                                   jRole,                                                                   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,                                                                   false,
                                                                   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);                                                                   jPropertyList);
  
             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 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_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);
   
               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: pathName           = "<<objectPath->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 jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     jAssociationName,
                                                                     jPathName,
                                                                     jRole,
                                                                     JMPI_INCLUDE_QUALIFIERS,
                                                                     request->includeClassOrigin,
                                                                     jPropertyList);
   
               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);
                       CIMInstance         *ciRet     = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef);
                       CIMClass             cls;
  
                     JMPIjvm::checkException(env);                      try
                       {
                          DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl));
                          AutoMutex lock (pr._cimomMutex);
  
                     CIMInstance         *ciRet = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                         cls = pr._cimom_handle->getClass(context,
                     CIMClass             cls   = pr._cimom_handle->getClass(context,  
                                                                             request->nameSpace,                                                                             request->nameSpace,
                                                                             ciRet->getClassName(),                                                                             ciRet->getClassName(),
                                                                             false,                                                                             false,
                                                                             true,                                                                             true,
                                                                             true,                                                                             true,
                                                                             CIMPropertyList());                                                                             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();                     const CIMObjectPath& op    = ciRet->getPath();
                     CIMObjectPath        iop   = ciRet->buildPath(cls);                     CIMObjectPath        iop   = ciRet->buildPath(cls);
  
Line 2455 
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 2481 
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,
                                                                   false,                                                                    JMPI_INCLUDE_QUALIFIERS,
                                                                   false,                                                                    request->includeClassOrigin,
                                                                   jPropertyList);                                                                   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 2503 
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       = pr._cimom_handle->getClass(context,                      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,                                                                                 request->nameSpace,
                                                                                 ciRet->getClassName(),                                                                                 ciRet->getClassName(),
                                                                                 false,                                                                                 false,
                                                                                 true,                                                                                 true,
                                                                                 true,                                                                                 true,
                                                                                 CIMPropertyList());                                                                                 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();                     const CIMObjectPath& op        = ciRet->getPath();
                     CIMObjectPath        iop       = ciRet->buildPath(cls);                     CIMObjectPath        iop       = ciRet->buildPath(cls);
  
Line 2547 
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 2580 
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 2600 
Line 4839 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);          if (!env)
           {
               PEG_METHOD_EXIT();
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                                 "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
           }
  
         STAT_GETSTARTTIME;          JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         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 2665 
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 2696 
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 2718 
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 2737 
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 2770 
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 2799 
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 2820 
Line 5247 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);          if (!env)
           {
               PEG_METHOD_EXIT();
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                                 "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
           }
  
         STAT_GETSTARTTIME;          JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         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 2837 
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 2865 
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 2912 
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 2941 
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 2962 
Line 5473 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);          if (!env)
           {
               PEG_METHOD_EXIT();
  
         STAT_GETSTARTTIME;              throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                                 "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
           }
   
           JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         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 2980 
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 3012 
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 3028 
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 3052 
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 3082 
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 3102 
Line 5696 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);          if (!env)
           {
               PEG_METHOD_EXIT();
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                                 "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
           }
  
         STAT_GETSTARTTIME;          JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         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 3119 
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 3138 
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:
         {         {
             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 3164 
Line 5824 
  
             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,
                                                         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:
           {
               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 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,             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 3197 
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 3209 
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 3229 
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 3238 
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 3263 
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 3302 
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 3310 
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(SubscriptionLanguageListContainer::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());  
  
         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: Calling provider createSubscriptionRequest: "<<pr.getName()<<PEGASUS_STD(endl));             // Add an entry for every provider.
              kb.append (CIMKeyBinding ("Provider",
                                        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);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);          if (!env)
           {
               PEG_METHOD_EXIT();
  
         STAT_GETSTARTTIME;              throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                                 "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
           }
   
           JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (pidc,
                             interfaceType,
                             interfaceVersion);
  
         // public void authorizeFilter (org.pegasus.jmpi.SelectExp     filter,          if (interfaceType == "JMPI")
           {
              // 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 3448 
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);  
                 }  
             }  
  
             STAT_PMS_PROVIDEREND;                 JMPIjvm::checkException(env);
               }
             break;             break;
         }         }
  
Line 3511 
Line 6438 
             break;             break;
         }         }
         }         }
   
     }     }
     HandlerCatch(handler);     HandlerCatch(handler);
  
Line 3530 
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 3545 
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));  
         context.insert(request->operationContext.get(SubscriptionLanguageListContainer::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 3602 
Line 6565 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);          if (!env)
           {
               PEG_METHOD_EXIT();
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                                 "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
           }
  
         STAT_GETSTARTTIME;          JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         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 3619 
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);             JMPIjvm::checkException(env);
  
             jObj = DEBUG_ConvertCToJava (CIMObjectPath*, jint, &eSelx->classNames[0]);              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);
               break;
           }
   
           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 3644 
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 ())  
             {             {
                 //                 env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
                 //  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;  
                     if (prec->handler) delete prec->handler;  
                     prec->handler = NULL;  
                 }  
             }  
   
             STAT_PMS_PROVIDEREND;  
  
             delete eSelx;                 JMPIjvm::checkException(env);
             delete qContext;              }
             delete srec;  
             break;             break;
         }         }
  
Line 3685 
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();
Line 3734 
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 3768 
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 3796 
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 3823 
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 3862 
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);  
             }             }
         }         }
         catch (CIMException & e)         catch (CIMException & e)
Line 3902 
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 3954 
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.29  
changed lines
  Added in v.1.59.4.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2