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

version 1.29, 2005/06/07 18:11:17 version 1.41.2.3, 2006/05/17 20:57:39
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 67 
Line 69 
 #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 162 
  
    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)<<(int)id<<PEGASUS_STD(dec)<<PEGASUS_STD(endl));
       env->ExceptionClear();       env->ExceptionClear();
    }    }
  
Line 214 
Line 247 
    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)
 { {
Line 244 
Line 380 
  
     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 395 
Line 539 
     PEGASUS_ASSERT(response != 0); \     PEGASUS_ASSERT(response != 0); \
     response->setKey(request->getKey()); \     response->setKey(request->getKey()); \
     response->setHttpMethod(request->getHttpMethod()); \     response->setHttpMethod(request->getHttpMethod()); \
     type1##ResponseHandler handler(request, response);      type1##ResponseHandler handler(request, response, _responseChunkCallback);
  
 #define VOIDINTRO ); #define VOIDINTRO );
 #define NOVOIDINTRO(type) ,type); #define NOVOIDINTRO(type) ,type);
Line 457 
Line 601 
  
     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 632 
                                    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 647 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
           if (!env)
           {
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
                                              MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
                                                                 "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
           }
   
   ////////DDD(debugPrintMethodPointers (env, (jclass)pr.jProviderClass));
   
         JMPIProvider::pm_service_op_lock op_lock(&pr);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;         STAT_GETSTARTTIME;
  
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
  
         // public abstract org.pegasus.jmpi.CIMInstance getInstance (org.pegasus.jmpi.CIMObjectPath cop,          getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
   
           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 684 
  
         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 705 
  
             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();
   
              STAT_COPYDISPATCHER
   
              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);             jint    jopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
             jobject jop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jopRef);             jobject jop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,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);
Line 572 
Line 792 
             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);
Line 594 
Line 814 
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          /* Fix for 4238 */
           case METHOD_INSTANCEPROVIDER2:
           {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
               jint    jopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,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::handleGetInstanceRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
                  throw;
               }
   
               CIMClass *pcls = new CIMClass (cls);
   
               JMPIjvm::checkException(env);
   
               jint    jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);
               jobject jcimClass    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcimClassRef);
   
               JMPIjvm::checkException(env);
   
               jobjectArray jPropertyList = getList(jv,env,request->propertyList);
               jobject      jciRet        = env->CallObjectMethod((jobject)pr.jProvider,
                                                                  id,
                                                                  joc,
                                                                  jop,
                                                                  jcimClass,
                                                                  JMPI_INCLUDE_QUALIFIERS,
                                                                  request->includeClassOrigin,
                                                                  jPropertyList);
   
               JMPIjvm::checkException(env);
   
               STAT_PMS_PROVIDEREND;
   
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
   
               handler.processing();
   
               if (jciRet) {
                  jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                  CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);
   
                  handler.deliver(*ciRet);
               }
               handler.complete();
               break;
           }
           /* Fix for 4238 */
   
           case METHOD_INSTANCEPROVIDER:
         {         {
             jint    jopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);             jint    jopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
             jobject jop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jopRef);             jobject jop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,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::handleGetInstancesRequest: 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);
Line 617 
Line 928 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               // Modified for Bugzilla# 3679
             jobject jciRet = env->CallObjectMethod((jobject)pr.jProvider,             jobject jciRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                    id,                                                    id,
                                                    jop,                                                    jop,
                                                    jcimClass,                                                    jcimClass,
                                                    true);                                                     JMPI_LOCALONLY);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 652 
Line 964 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
       STAT_COPYDISPATCHER
   
     return(response);     return(response);
 } }
  
Line 663 
Line 977 
  
     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 1004 
             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 1026 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
           if (!env)
           {
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               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);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;         STAT_GETSTARTTIME;
  
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
  
           if (interfaceType == "JMPI")
           {
         // public abstract java.util.Vector enumInstances (org.pegasus.jmpi.CIMObjectPath cop,         // public abstract java.util.Vector enumInstances (org.pegasus.jmpi.CIMObjectPath cop,
         //                                                 boolean                        deep,         //                                                 boolean                        deep,
         //                                                 org.pegasus.jmpi.CIMClass      cimClass,         //                                                 org.pegasus.jmpi.CIMClass      cimClass,
Line 727 
Line 1062 
  
         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 1083 
  
             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();
   
              STAT_COPYDISPATCHER
   
              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);             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,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);
Line 781 
Line 1188 
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jobjectArray jPropertyList = getList(jv,env,request->propertyList);             jobjectArray jPropertyList = getList(jv,env,request->propertyList);
   
             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);
Line 807 
Line 1213 
                     jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);                     jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                     CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                     CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, 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);
  
                     handler.deliver(*ciRet);                     handler.deliver(*ciRet);
Line 816 
Line 1248 
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          case METHOD_CIMINSTANCEPROVIDER2:
         {         {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,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);
Line 839 
Line 1289 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jobject jVec = env->CallObjectMethod((jobject)pr.jProvider,              jobjectArray jPropertyList = getList(jv,env,request->propertyList);
               jobjectArray jAr           = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                                id,
                                                                                joc,
                                                                                jcop,
                                                                                jcc,
                                                                                JMPI_INCLUDE_QUALIFIERS,
                                                                                request->includeClassOrigin,
                                                                                jPropertyList);
   
               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);
   
                       jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                       CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, 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:
           {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
               jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,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);
   
               jint    jccRef = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);
               jobject jcc    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jccRef);
   
               JMPIjvm::checkException(env);
   
               jobjectArray jPropertyList = getList(jv,env,request->propertyList);
               jobject      jVec          = env->CallObjectMethod((jobject)pr.jProvider,
                                                  id,                                                  id,
                                                                  joc,
                                                  jcop,                                                  jcop,
                                                                  jcc,
                                                                  JMPI_INCLUDE_QUALIFIERS,
                                                                  request->includeClassOrigin,
                                                                  jPropertyList);
   
               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 jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i);
   
                       JMPIjvm::checkException(env);
   
                       jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                       CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, 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:
           {
               jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,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);
   
               jint    jccRef = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);
               jobject jcc    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jccRef);
   
               JMPIjvm::checkException(env);
   
               // Modified for Bugzilla# 3679
               jobject jVec = env->CallObjectMethod((jobject)pr.jProvider,
                                                    id,
                                                    jcop,
                                                    request->deepInheritance,
                                                  jcc,                                                  jcc,
                                                  true);                                                   JMPI_LOCALONLY);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 862 
Line 1535 
                     jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);                     jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                     CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                     CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, 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 882 
Line 1588 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
       STAT_COPYDISPATCHER
   
     return(response);     return(response);
 } }
  
Line 893 
Line 1601 
  
     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 1628 
             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 1642 
  
         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);
  
           if (!env)
           {
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               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);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;         STAT_GETSTARTTIME;
  
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
  
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
   
           if (interfaceType == "JMPI")
           {
         // public abstract java.util.Vector enumInstances (org.pegasus.jmpi.CIMObjectPath cop,         // public abstract java.util.Vector enumInstances (org.pegasus.jmpi.CIMObjectPath cop,
         //                                                 boolean                        deep,         //                                                 boolean                        deep,
         //                                                 org.pegasus.jmpi.CIMClass      cimClass)         //                                                 org.pegasus.jmpi.CIMClass      cimClass)
Line 954 
Line 1683 
  
         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 1700 
  
             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();
   
              STAT_COPYDISPATCHER
   
              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);             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,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);
Line 1033 
Line 1826 
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          case METHOD_CIMINSTANCEPROVIDER2:
         {         {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,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::handleEnumerateInstanceNamesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
                  throw;
               }
   
               CIMClass *pcls = new CIMClass (cls);
   
               JMPIjvm::checkException(env);
   
               jint    jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);
               jobject jcimClass    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcimClassRef);
   
               JMPIjvm::checkException(env);
   
               jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                      id,
                                                                      joc,
                                                                      jcop,
                                                                      jcimClass);
   
               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);
   
                       jint           jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
                       CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRetRef);
   
                       JMPIjvm::checkException(env);
   
                       handler.deliver(*copRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_INSTANCEPROVIDER2:
           {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
               jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,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);
   
               jint    jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);
               jobject jcimClass    = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcimClassRef);
   
               JMPIjvm::checkException(env);
   
               jobject jVec = env->CallObjectMethod((jobject)pr.jProvider,
                                                    id,
                                                    joc,
                                                    jcop,
                                                    jcimClass);
   
               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);
   
                       jint           jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
                       CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRetRef);
   
                       JMPIjvm::checkException(env);
   
                       handler.deliver(*copRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_INSTANCEPROVIDER:
           {
               jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,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);             JMPIjvm::checkException(env);
  
             jint    jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);             jint    jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);
Line 1100 
Line 2066 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
       STAT_COPYDISPATCHER
   
     return(response);     return(response);
 } }
  
Line 1111 
Line 2079 
  
     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 2105 
             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 2120 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
           if (!env)
           {
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               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);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;         STAT_GETSTARTTIME;
  
         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 2154 
  
         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();
   
              STAT_COPYDISPATCHER
   
              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:
           {
               jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);
   
               JMPIjvm::checkException(env);
   
               CIMInstance *ci     = new CIMInstance (request->newInstance);
               jint         jciRef = DEBUG_ConvertCToJava (CIMInstance*, jint, ci);
               jobject      jci    = env->NewObject(jv->CIMInstanceClassRef,jv->CIMInstanceNewI,jciRef);
   
               JMPIjvm::checkException(env);
   
               DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateInstanceRequest: id = "<<id<<", jcop = "<<jcop<<", jci = "<<jci<<PEGASUS_STD(endl));
   
               jobject jcopRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                       id,
                                                       jcop,
                                                       jci);
   
               JMPIjvm::checkException(env);
   
               STAT_PMS_PROVIDEREND;
   
               handler.processing();
   
               if (jcopRet) {
                   jint           jCopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
                   CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jCopRetRef);
   
                   handler.deliver(*copRet);
               }
               handler.complete();
               break;
           }
   
           case METHOD_INSTANCEPROVIDER2:
         {         {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);
  
Line 1198 
Line 2248 
  
             jobject jcopRet = env->CallObjectMethod((jobject)pr.jProvider,             jobject jcopRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                     id,                                                     id,
                                                       joc,
                                                     jcop,                                                     jcop,
                                                     jci);                                                     jci);
  
Line 1205 
Line 2256 
  
             STAT_PMS_PROVIDEREND;             STAT_PMS_PROVIDEREND;
  
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
   
             handler.processing();             handler.processing();
  
             if (jcopRet) {             if (jcopRet) {
Line 1230 
Line 2288 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
       STAT_COPYDISPATCHER
   
     return(response);     return(response);
 } }
  
Line 1241 
Line 2301 
  
     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 2330 
         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();
Line 1285 
Line 2340 
         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)<<(int)&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);
  
           if (!env)
           {
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               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);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;         STAT_GETSTARTTIME;
  
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
  
           if (interfaceType == "JMPI")
           {
         // public abstract void setInstance (org.pegasus.jmpi.CIMObjectPath cop,         // public abstract void setInstance (org.pegasus.jmpi.CIMObjectPath cop,
         //                                   org.pegasus.jmpi.CIMInstance   cimInstance)         //                                   org.pegasus.jmpi.CIMInstance   cimInstance)
         //        org.pegasus.jmpi.throws CIMException         //        org.pegasus.jmpi.throws CIMException
Line 1306 
Line 2379 
  
         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 2398 
  
             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();
   
              STAT_COPYDISPATCHER
   
              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:
         {         {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);
  
Line 1351 
Line 2457 
  
             env->CallVoidMethod((jobject)pr.jProvider,             env->CallVoidMethod((jobject)pr.jProvider,
                                 id,                                 id,
                                   joc,
                                 jcop,                                 jcop,
                                 jci,                                  jci);
                                 jPropertyList);  
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;             STAT_PMS_PROVIDEREND;
             break;  
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
               break;
           }
   
           case METHOD_CIMINSTANCEPROVIDER:
           {
               jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);
   
               JMPIjvm::checkException(env);
   
               CIMInstance *ci     = new CIMInstance (request->modifiedInstance);
               jint         jciRef = DEBUG_ConvertCToJava (CIMInstance*, jint, ci);
               jobject      jci    = env->NewObject(jv->CIMInstanceClassRef,jv->CIMInstanceNewI,jciRef);
   
               JMPIjvm::checkException(env);
   
               jobjectArray jPropertyList = getList(jv,env,request->propertyList);
   
               env->CallVoidMethod((jobject)pr.jProvider,
                                   id,
                                   jcop,
                                   jci,
                                   JMPI_INCLUDE_QUALIFIERS,
                                   jPropertyList);
   
               JMPIjvm::checkException(env);
   
               STAT_PMS_PROVIDEREND;
               break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          case METHOD_INSTANCEPROVIDER:
         {         {
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);
Line 1398 
Line 2539 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
       STAT_COPYDISPATCHER
   
     return(response);     return(response);
 } }
  
Line 1409 
Line 2552 
  
     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 2578 
             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 1455 
Line 2593 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
           if (!env)
           {
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               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);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;         STAT_GETSTARTTIME;
  
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
  
           if (interfaceType == "JMPI")
           {
         // public abstract void deleteInstance (org.pegasus.jmpi.CIMObjectPath cop)         // public abstract void deleteInstance (org.pegasus.jmpi.CIMObjectPath cop)
         //        throws org.pegasus.jmpi.CIMException         //        throws org.pegasus.jmpi.CIMException
         id = env->GetMethodID((jclass)pr.jProviderClass,         id = env->GetMethodID((jclass)pr.jProviderClass,
Line 1469 
Line 2626 
  
         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();
   
              STAT_COPYDISPATCHER
   
              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    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
               jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);
   
               JMPIjvm::checkException(env);
   
               env->CallVoidMethod((jobject)pr.jProvider,
                                   id,
                                   joc,
                                   jcop);
   
               JMPIjvm::checkException(env);
   
               STAT_PMS_PROVIDEREND;
   
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
               break;
           }
   
           case METHOD_INSTANCEPROVIDER:
         {         {
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             env->CallVoidMethod((jobject)pr.jProvider,id,jcop);              env->CallVoidMethod((jobject)pr.jProvider,
                                   id,
                                   jcop);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 1505 
Line 2721 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
       STAT_COPYDISPATCHER
   
     return(response);     return(response);
 } }
  
Line 1516 
Line 2734 
  
     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 2761 
             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 2783 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
           if (!env)
           {
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               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);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;         STAT_GETSTARTTIME;
  
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
  
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
   
           if (interfaceType == "JMPI")
           {
         // public abstract java.util.Vector execQuery (org.pegasus.jmpi.CIMObjectPath cop,         // public abstract java.util.Vector execQuery (org.pegasus.jmpi.CIMObjectPath cop,
         //                                             java.lang.String               queryStatement,         //                                             java.lang.String               queryStatement,
         //                                             int                            ql,         //                                             int                            ql,
Line 1580 
Line 2820 
  
         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 2839 
  
             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();
   
               STAT_COPYDISPATCHER
   
               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);             jint    jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewI, jcopref);             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewI, jcopref);
Line 1623 
Line 2911 
             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);
Line 1672 
Line 2975 
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          case METHOD_CIMINSTANCEPROVIDER2:
         {         {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
             jint    jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);             jint    jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewI, jcopref);             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewI, jcopref);
  
Line 1682 
Line 2988 
             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);
Line 1699 
Line 3020 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint jql = 0; // @BUG - how to convert?              jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
   
             jobjectArray jVec = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,  
                                                                     id,                                                                     id,
                                                                      joc,
                                                                     jcop,                                                                     jcop,
                                                                     jquery,                                                                     jquery,
                                                                     jql,                                                                     jqueryLanguage,
                                                                     jCc);                                                                     jCc);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;             STAT_PMS_PROVIDEREND;
  
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
   
             handler.processing();             handler.processing();
             if (jVec) {              if (jAr) {
                 for (int i=0,m=env->GetArrayLength(jVec); i<m; i++) {                  for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jobject jciRet = env->GetObjectArrayElement(jVec,i);                      jobject jciRet = env->GetObjectArrayElement(jAr,i);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
Line 1733 
Line 3060 
             break;             break;
         }         }
  
         case METHOD_UNKNOWN:          case METHOD_INSTANCEPROVIDER2:
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: should not be here!"<<PEGASUS_STD(endl));              jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
             break;              jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
         }  
         }  
     }  
     HandlerCatch(handler);  
  
     if (env) JMPIjvm::detachThread();              jint    jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewI, jcopref);
  
     PEG_METHOD_EXIT();              JMPIjvm::checkException(env);
  
     return(response);              jstring jqueryLanguage = env->NewStringUTF(request->queryLanguage.getCString());
 }              jstring jquery         = env->NewStringUTF(request->query.getCString());
  
 Message * JMPIProviderManager::handleAssociatorsRequest(const Message * message) throw()              CIMClass cls;
   
               try
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleAssociatorsRequest");                 DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl));
                  AutoMutex lock (pr._cimomMutex);
  
     HandlerIntro(Associators,message,request,response,handler,Array<CIMObject>());                 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;
               }
  
     typedef enum {              CIMClass *pcls = new CIMClass (cls);
        METHOD_UNKNOWN = 0,  
        METHOD_PEGASUS_24,  
        METHOD_SNIA_PROVIDER20,  
     } METHOD_VERSION;  
     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;  
     JNIEnv          *env           = NULL;  
  
     try {              JMPIjvm::checkException(env);
         Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,  
             "JMPIProviderManager::handleAssociatorsRequest - Host name: $0  Name space: $1  Class name: $2",  
             System::getHostName(),  
             request->nameSpace.getString(),  
             request->objectName.getClassName().getString());  
  
         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", classname = "<<request->objectName.getClassName().getString()<<PEGASUS_STD(endl));              jint jcls = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);
  
         // make target object path              jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcls);
         CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(),  
                                                        request->nameSpace,  
                                                        request->objectName.getClassName(),  
                                                        request->objectName.getKeyBindings());  
         CIMObjectPath *assocPath  = new CIMObjectPath (System::getHostName(),  
                                                        request->nameSpace,  
                                                        request->assocClass.getString());  
  
         // resolve provider name              JMPIjvm::checkException(env);
         ProviderName name = _resolveProviderName(  
             request->operationContext.get(ProviderIdContainer::NAME));  
  
         // get cached or load new provider module              jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
         JMPIProvider::OpProviderHolder ph =                                                                     id,
             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);                                                                     joc,
                                                                      jcop,
                                                                      jCc,
                                                                      jquery,
                                                                      jqueryLanguage);
  
         // convert arguments              JMPIjvm::checkException(env);
         OperationContext context;  
  
         context.insert(request->operationContext.get(IdentityContainer::NAME));              STAT_PMS_PROVIDEREND;
         context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));  
         context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));  
  
         // forward request              if (joc)
         JMPIProvider &pr = ph.GetProvider();              {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
  
         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,"Calling provider.associators: " + pr.getName());                 JMPIjvm::checkException(env);
               }
  
         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: Calling provider associators: "<<pr.getName()<<", role: "<<request->role<<", aCls: "<<request->assocClass<<PEGASUS_STD(endl));              handler.processing();
               if (jAr) {
                   for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
                       JMPIjvm::checkException(env);
  
         JvmVector *jv = 0;                      jobject jciRet = env->GetObjectArrayElement(jAr,i);
  
         env = JMPIjvm::attachThread(&jv);                      JMPIjvm::checkException(env);
   
                       jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                       CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);
   
                       JMPIjvm::checkException(env);
   
                       handler.deliver(*ciRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_INSTANCEPROVIDER:
           {
               jint    jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewI, 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);
   
               jint jcls = DEBUG_ConvertCToJava (CIMClass*, jint, pcls);
   
               jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcls);
   
               JMPIjvm::checkException(env);
   
               jint jql = 0; // @BUG - how to convert?
   
               jobjectArray jVec = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                       id,
                                                                       jcop,
                                                                       jquery,
                                                                       jql,
                                                                       jCc);
   
               JMPIjvm::checkException(env);
   
               STAT_PMS_PROVIDEREND;
   
               handler.processing();
               if (jVec) {
                   for (int i=0,m=env->GetArrayLength(jVec); i<m; i++) {
                       JMPIjvm::checkException(env);
   
                       jobject jciRet = env->GetObjectArrayElement(jVec,i);
   
                       JMPIjvm::checkException(env);
   
                       jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                       CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);
   
                       JMPIjvm::checkException(env);
   
                       handler.deliver(*ciRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_UNKNOWN:
           {
               DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: should not be here!"<<PEGASUS_STD(endl));
               break;
           }
           }
       }
       HandlerCatch(handler);
   
       if (env) JMPIjvm::detachThread();
   
       PEG_METHOD_EXIT();
   
       STAT_COPYDISPATCHER
   
       return(response);
   }
   
   Message * JMPIProviderManager::handleAssociatorsRequest(const Message * message) throw()
   {
       PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleAssociatorsRequest");
   
       HandlerIntro(Associators,message,request,response,handler,Array<CIMObject>());
   
       typedef enum {
          METHOD_UNKNOWN = 0,
          METHOD_CIMASSOCIATORPROVIDER,
          METHOD_CIMASSOCIATORPROVIDER2,
          METHOD_ASSOCIATORPROVIDER,
          METHOD_ASSOCIATORPROVIDER2,
       } METHOD_VERSION;
       METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;
       JNIEnv          *env           = NULL;
   
       try {
           Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
               "JMPIProviderManager::handleAssociatorsRequest - Host name: $0  Name space: $1  Class name: $2",
               System::getHostName(),
               request->nameSpace.getString(),
               request->objectName.getClassName().getString());
   
           DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", classname = "<<request->objectName.getClassName().getString()<<PEGASUS_STD(endl));
   
           // make target object path
           CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(),
                                                          request->nameSpace,
                                                          request->objectName.getClassName(),
                                                          request->objectName.getKeyBindings());
           CIMObjectPath *assocPath  = new CIMObjectPath (System::getHostName(),
                                                          request->nameSpace,
                                                          request->assocClass.getString());
   
           // resolve provider name
           ProviderName name = _resolveProviderName(
               request->operationContext.get(ProviderIdContainer::NAME));
   
           // get cached or load new provider module
           JMPIProvider::OpProviderHolder ph = providerManager.getProvider (name.getPhysicalName(),
                                                                            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
           JMPIProvider &pr = ph.GetProvider();
   
           PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,"Calling provider.associators: " + pr.getName());
   
           DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: Calling provider associators: "<<pr.getName()<<", role: "<<request->role<<", aCls: "<<request->assocClass<<PEGASUS_STD(endl));
   
           JvmVector *jv = 0;
   
           env = JMPIjvm::attachThread(&jv);
   
           if (!env)
           {
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               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);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;         STAT_GETSTARTTIME;
  
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
  
         // public abstract java.util.Vector associators (org.pegasus.jmpi.CIMObjectPath assocName,          if (interfaceType == "JMPI")
           {
              // public java.util.Vector associators (org.pegasus.jmpi.CIMObjectPath assocName,
         //                                               org.pegasus.jmpi.CIMObjectPath pathName,         //                                               org.pegasus.jmpi.CIMObjectPath pathName,
         //                                               java.lang.String               resultClass,         //                                               java.lang.String               resultClass,
         //                                               java.lang.String               role,         //                                               java.lang.String               role,
Line 1826 
Line 3338 
         id = env->GetMethodID((jclass)pr.jProviderClass,         id = env->GetMethodID((jclass)pr.jProviderClass,
                               "associators",                               "associators",
                               "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;");                               "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;");
 //@BUG was:                   "(Lorg/pegasus/jmpi/CIMObjectPath;                                Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;"  
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_ASSOCIATORPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found METHOD_ASSOCIATORPROVIDER."<<PEGASUS_STD(endl));
              }
   
              if (id == NULL)
              {
                  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)         if (id == NULL)
         {         {
             env->ExceptionClear();             env->ExceptionClear();
  
             // public abstract java.util.Vector associators (org.pegasus.jmpi.CIMObjectPath assocName,                 // public org.pegasus.jmpi.CIMInstance[] associators (org.pegasus.jmpi.OperationContext oc,
                  //                                                    org.pegasus.jmpi.CIMObjectPath assocName,
                  //                                                    org.pegasus.jmpi.CIMObjectPath pathName,
             //                                               java.lang.String               resultClass,             //                                               java.lang.String               resultClass,
             //                                               java.lang.String               role,             //                                               java.lang.String               role,
             //                                               java.lang.String               resultRole,             //                                               java.lang.String               resultRole,
Line 1849 
Line 3410 
             //             //
             id = env->GetMethodID((jclass)pr.jProviderClass,             id = env->GetMethodID((jclass)pr.jProviderClass,
                                   "associators",                                   "associators",
                                   "(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;");                                       "(Lorg/pegasus/jmpi/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;");
 //@BUG was:                       "(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ[Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMInstance;"  
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_PEGASUS_24;                     eMethodFound = METHOD_CIMASSOCIATORPROVIDER2;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found METHOD_CIMASSOCIATORPROVIDER2."<<PEGASUS_STD(endl));
                  }
             }             }
         }         }
  
         if (id == NULL)         if (id == NULL)
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found no method!"<<PEGASUS_STD(endl));             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found no method!"<<PEGASUS_STD(endl));
   
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               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, assocPath);             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, assocPath);
             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               jint    jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jPathNameRef);
   
               JMPIjvm::checkException(env);
   
             jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString());             jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString());
             jstring jRole        = env->NewStringUTF(request->role.getCString());             jstring jRole        = env->NewStringUTF(request->role.getCString());
             jstring jResultRole  = env->NewStringUTF(request->resultRole.getCString());             jstring jResultRole  = env->NewStringUTF(request->resultRole.getCString());
Line 1885 
Line 3459 
  
 #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 3467 
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));
 #endif #endif
  
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,              jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                   id,                                                                   id,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                     jPathName,
                                                                   jResultClass,                                                                   jResultClass,
                                                                   jRole,                                                                   jRole,
                                                                   jResultRole,                                                                   jResultRole,
                                                                   false,                                                                    JMPI_INCLUDE_QUALIFIERS,
                                                                   false,                                                                    request->includeClassOrigin,
                                                                   jPropertyList);                                                                   jPropertyList);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
Line 1907 
Line 3483 
             STAT_PMS_PROVIDEREND;             STAT_PMS_PROVIDEREND;
  
             handler.processing();             handler.processing();
             if (jVec) {              if (jAr) {
                 for (int i=0,m=env->GetArrayLength(jVec); i<m; i++) {                  for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jobject jciRet = env->GetObjectArrayElement(jVec,i);                      jobject jciRet = env->GetObjectArrayElement(jAr,i);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
Line 1920 
Line 3496 
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     CIMInstance         *ciRet = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                     CIMInstance         *ciRet = DEBUG_ConvertJavaToC (jint, 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 3533 
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          case METHOD_CIMASSOCIATORPROVIDER2:
         {         {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, assocPath);             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, assocPath);
             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);
  
Line 1972 
Line 3566 
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));
 #endif #endif
  
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,              jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                  id,                                                                  id,
                                                                     joc,
                                                                  jAssociationName,                                                                  jAssociationName,
                                                                  jPathName,                                                                  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;             STAT_PMS_PROVIDEREND;
  
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
   
             handler.processing();             handler.processing();
             if (jVec) {              if (jAr) {
                 for (int i=0,m=env->CallIntMethod(jVec,JMPIjvm::jv.VectorSize); i<m; i++) {                  for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i);                      jobject jciRet = env->GetObjectArrayElement(jAr,i);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jint                 jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);                     jint                 jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
   
                       JMPIjvm::checkException(env);
   
                     CIMInstance         *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                     CIMInstance         *ciRet     = DEBUG_ConvertJavaToC (jint, 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());
                     const CIMObjectPath& op        = ciRet->getPath();                         DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl));
                       }
                       catch (CIMException e)
                       {
                          DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
                          throw;
                       }
   
                       const CIMObjectPath& op    = ciRet->getPath();
                       CIMObjectPath        iop   = ciRet->buildPath(cls);
   
                       JMPIjvm::checkException(env);
   
                       iop.setNameSpace(op.getNameSpace());
                       ciRet->setPath(iop);
   
                       handler.deliver(*ciRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_ASSOCIATORPROVIDER2:
           {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
               jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, assocPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);
   
               JMPIjvm::checkException(env);
   
               jint    jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,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
   
               jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     joc,
                                                                     jAssociationName,
                                                                     jPathName,
                                                                     jResultClass,
                                                                     jRole,
                                                                     jResultRole,
                                                                     JMPI_INCLUDE_QUALIFIERS,
                                                                     request->includeClassOrigin,
                                                                     jPropertyList);
   
               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 jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i);
   
                       JMPIjvm::checkException(env);
   
                       jint jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
   
                       JMPIjvm::checkException(env);
   
                       CIMInstance         *ciRet = DEBUG_ConvertJavaToC (jint, 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_ASSOCIATORPROVIDER:
           {
               jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, assocPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);
   
               JMPIjvm::checkException(env);
   
               jint    jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,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
   
               jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     jAssociationName,
                                                                     jPathName,
                                                                     jResultClass,
                                                                     jRole,
                                                                     jResultRole,
                                                                     JMPI_INCLUDE_QUALIFIERS,
                                                                     request->includeClassOrigin,
                                                                     jPropertyList);
   
               JMPIjvm::checkException(env);
   
               STAT_PMS_PROVIDEREND;
   
               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);
   
                       jint                 jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                       CIMInstance         *ciRet     = DEBUG_ConvertJavaToC (jint, 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);                     CIMObjectPath        iop       = ciRet->buildPath(cls);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
Line 2033 
Line 3853 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
       STAT_COPYDISPATCHER
   
     return(response);     return(response);
 } }
  
Line 2044 
Line 3866 
  
     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 3897 
             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 3912 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
           if (!env)
           {
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               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);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;         STAT_GETSTARTTIME;
  
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
  
         // public abstract java.util.Vector 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 3946 
         id = env->GetMethodID((jclass)pr.jProviderClass,         id = env->GetMethodID((jclass)pr.jProviderClass,
                               "associatorNames",                               "associatorNames",
                               "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector;");                               "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector;");
 //@BUG was:                   "(Lorg/pegasus/jmpi/CIMObjectPath;                                Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector;"  
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_ASSOCIATORPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found METHOD_ASSOCIATORPROVIDER."<<PEGASUS_STD(endl));
              }
   
              if (id == NULL)
              {
                  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)         if (id == NULL)
         {         {
             env->ExceptionClear();             env->ExceptionClear();
  
             // public abstract java.util.Vector associatorNames (org.pegasus.jmpi.CIMObjectPath assocName,                 // public org.pegasus.jmpi.CIMObjectPath[] associatorNames (org.pegasus.jmpi.OperationContext oc,
                  //                                                          org.pegasus.jmpi.CIMObjectPath    assocName,
                  //                                                          org.pegasus.jmpi.CIMObjectPath    pathName,
             //                                                   java.lang.String               resultClass,             //                                                   java.lang.String               resultClass,
             //                                                   java.lang.String               role,             //                                                   java.lang.String               role,
             //                                                   java.lang.String               resultRole)             //                                                   java.lang.String               resultRole)
             //        throws org.pegasus.jmpi.CIMException             //        throws org.pegasus.jmpi.CIMException
             id = env->GetMethodID((jclass)pr.jProviderClass,             id = env->GetMethodID((jclass)pr.jProviderClass,
                                   "associatorNames",                                   "associatorNames",
                                   "(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector;");                                       "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMObjectPath;");
 //@BUG was:                       "(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMObjectPath;"  
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_PEGASUS_24;                     eMethodFound = METHOD_CIMASSOCIATORPROVIDER2;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found METHOD_CIMASSOCIATORPROVIDER2."<<PEGASUS_STD(endl));
                  }
             }             }
         }         }
  
         if (id == NULL)         if (id == NULL)
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found no method!"<<PEGASUS_STD(endl));             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found no method!"<<PEGASUS_STD(endl));
   
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               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, assocPath);             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, assocPath);
             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               jint    jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jPathNameRef);
   
               JMPIjvm::checkException(env);
   
             jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString());             jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString());
             jstring jRole        = env->NewStringUTF(request->role.getCString());             jstring jRole        = env->NewStringUTF(request->role.getCString());
             jstring jResultRole  = env->NewStringUTF(request->resultRole.getCString());             jstring jResultRole  = env->NewStringUTF(request->resultRole.getCString());
Line 2167 
Line 4058 
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultRole  = "<<request->resultRole<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultRole  = "<<request->resultRole<<PEGASUS_STD(endl));
 #endif #endif
  
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,              jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                   id,                                                                   id,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                     jPathName,
                                                                   jResultClass,                                                                   jResultClass,
                                                                   jRole,                                                                   jRole,
                                                                   jResultRole);                                                                   jResultRole);
Line 2179 
Line 4071 
             STAT_PMS_PROVIDEREND;             STAT_PMS_PROVIDEREND;
  
             handler.processing();             handler.processing();
             if (jVec) {              if (jAr) {
                 for (int i=0,m=env->GetArrayLength(jVec); i<m; i++) {                  for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jobject jcopRet = env->GetObjectArrayElement(jVec,i);                      jobject jcopRet = env->GetObjectArrayElement(jAr,i);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jint           jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);                     jint           jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
                     CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRet);                      CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRetRef);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
Line 2199 
Line 4091 
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          case METHOD_CIMASSOCIATORPROVIDER2:
         {         {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, assocPath);             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, assocPath);
             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);
  
Line 2219 
Line 4113 
  
 #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
  
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,              jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                   id,                                                                   id,
                                                                     joc,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                   jPathName,                                                                   jPathName,
                                                                   jResultClass,                                                                   jResultClass,
Line 2237 
Line 4131 
  
             STAT_PMS_PROVIDEREND;             STAT_PMS_PROVIDEREND;
  
             handler.processing();              if (joc)
             if (jVec) {              {
                 for (int i=0,m=env->CallIntMethod(jVec,JMPIjvm::jv.VectorSize); i<m; i++) {                 env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
                     JMPIjvm::checkException(env);  
                  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);
   
                       jint           jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
                       CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRetRef);
   
                       JMPIjvm::checkException(env);
   
                       handler.deliver(*copRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_ASSOCIATORPROVIDER:
           {
               jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, assocPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);
   
               JMPIjvm::checkException(env);
   
               jint    jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jPathNameRef);
   
               JMPIjvm::checkException(env);
   
               jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString());
               jstring jRole        = env->NewStringUTF(request->role.getCString());
               jstring jResultRole  = env->NewStringUTF(request->resultRole.getCString());
   
               JMPIjvm::checkException(env);
   
   #ifdef PEGASUS_DEBUG
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: assocName   = "<<assocPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: pathName    = "<<objectPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultClass = "<<request->resultClass<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: role        = "<<request->role<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultRole  = "<<request->resultRole<<PEGASUS_STD(endl));
   #endif
   
               jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     jAssociationName,
                                                                     jPathName,
                                                                     jResultClass,
                                                                     jRole,
                                                                     jResultRole);
   
               JMPIjvm::checkException(env);
   
               STAT_PMS_PROVIDEREND;
   
               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);
   
                       jint           jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
                       CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRetRef);
   
                       JMPIjvm::checkException(env);
   
                       handler.deliver(*copRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_ASSOCIATORPROVIDER2:
           {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
               jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, assocPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);
   
               JMPIjvm::checkException(env);
   
               jint    jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jPathNameRef);
   
               JMPIjvm::checkException(env);
   
               jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString());
               jstring jRole        = env->NewStringUTF(request->role.getCString());
               jstring jResultRole  = env->NewStringUTF(request->resultRole.getCString());
   
               JMPIjvm::checkException(env);
   
   #ifdef PEGASUS_DEBUG
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: assocName   = "<<assocPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: pathName    = "<<objectPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultClass = "<<request->resultClass<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: role        = "<<request->role<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultRole  = "<<request->resultRole<<PEGASUS_STD(endl));
   #endif
   
               jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     joc,
                                                                     jAssociationName,
                                                                     jPathName,
                                                                     jResultClass,
                                                                     jRole,
                                                                     jResultRole);
   
               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);                     jobject jcopRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i);
  
Line 2271 
Line 4301 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
       STAT_COPYDISPATCHER
   
     return(response);     return(response);
 } }
  
Line 2282 
Line 4314 
  
     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 4345 
             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
           JMPIProvider &pr = ph.GetProvider();
   
           PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,"Calling provider.references: " + pr.getName());
   
           DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: Calling provider references: "<<pr.getName()<<", role: "<<request->role<<" aCls: "<<request->resultClass<<PEGASUS_STD(endl));
   
           JvmVector *jv = 0;
   
           env = JMPIjvm::attachThread(&jv);
   
           if (!env)
           {
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               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);
   
           STAT_GETSTARTTIME;
   
           jmethodID id               = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
   
           if (interfaceType == "JMPI")
           {
              // public java.util.Vector 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;)Ljava/util/Vector;");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_ASSOCIATORPROVIDER;
                  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)
              {
                  env->ExceptionClear();
   
                  // public org.pegasus.jmpi.CIMInstance[] references (org.pegasus.jmpi.OperationContext oc,
                  //                                                   org.pegasus.jmpi.CIMObjectPath    assocName,
                  //                                                   org.pegasus.jmpi.CIMObjectPath    pathName,
                  //                                                   java.lang.String                  role,
                  //                                                   boolean                           includeQualifiers,
                  //                                                   boolean                           includeClassOrigin,
                  //                                                   java.lang.String[]                propertyList)
                  //        throws org.pegasus.jmpi.CIMException
                  id = env->GetMethodID((jclass)pr.jProviderClass,
                                        "references",
                                        "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMInstance;");
   
                  if (id != NULL)
                  {
                      eMethodFound = METHOD_CIMASSOCIATORPROVIDER2;
                      DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_CIMASSOCIATORPROVIDER2."<<PEGASUS_STD(endl));
                  }
              }
           }
   
           if (id == NULL)
           {
               DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found no method!"<<PEGASUS_STD(endl));
   
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               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:
           {
               jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, resultPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);
   
               JMPIjvm::checkException(env);
   
               jint    jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,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
   
               jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     jAssociationName,
                                                                     jPathName,
                                                                     jRole,
                                                                     JMPI_INCLUDE_QUALIFIERS,
                                                                     request->includeClassOrigin,
                                                                     jPropertyList);
   
               JMPIjvm::checkException(env);
   
               STAT_PMS_PROVIDEREND;
   
               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);
   
                       jint jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
   
                       JMPIjvm::checkException(env);
   
                       CIMInstance         *ciRet = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);
                       CIMClass             cls;
   
                       try
                       {
                          DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl));
                          AutoMutex lock (pr._cimomMutex);
   
                          cls = pr._cimom_handle->getClass(context,
                                                           request->nameSpace,
                                                           ciRet->getClassName(),
                                                           false,
                                                           true,
                                                           true,
                                                           CIMPropertyList());
                          DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl));
                       }
                       catch (CIMException e)
                       {
                          DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
                          throw;
                       }
   
                       const CIMObjectPath& op    = ciRet->getPath();
                       CIMObjectPath        iop   = ciRet->buildPath(cls);
   
                       JMPIjvm::checkException(env);
   
                       iop.setNameSpace(op.getNameSpace());
                       ciRet->setPath(iop);
   
                       handler.deliver(*ciRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_CIMASSOCIATORPROVIDER2:
           {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
               jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, resultPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);
   
               JMPIjvm::checkException(env);
   
               jint    jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,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
   
               jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     joc,
                                                                     jAssociationName,
                                                                     jPathName,
                                                                     jRole,
                                                                     JMPI_INCLUDE_QUALIFIERS,
                                                                     request->includeClassOrigin,
                                                                     jPropertyList);
  
         // convert arguments              JMPIjvm::checkException(env);
         OperationContext context;  
  
         context.insert(request->operationContext.get(IdentityContainer::NAME));              STAT_PMS_PROVIDEREND;
         context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));  
         context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));  
  
         // forward request              if (joc)
         JMPIProvider &pr = ph.GetProvider();              {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
  
         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,"Calling provider.references: " + pr.getName());                 JMPIjvm::checkException(env);
               }
  
         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: Calling provider references: "<<pr.getName()<<", role: "<<request->role<<" aCls: "<<request->resultClass<<PEGASUS_STD(endl));              handler.processing();
               if (jAr) {
                   for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) {
                       JMPIjvm::checkException(env);
  
         JvmVector *jv = 0;                      jobject jciRet = env->GetObjectArrayElement(jAr,i);
  
         env = JMPIjvm::attachThread(&jv);                      JMPIjvm::checkException(env);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);                      jint jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
  
         STAT_GETSTARTTIME;                      JMPIjvm::checkException(env);
  
         jmethodID id = NULL;                      CIMInstance         *ciRet = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);
                       CIMClass             cls;
  
         // public abstract java.util.Vector references (org.pegasus.jmpi.CIMObjectPath assocName,                      try
         //                                              org.pegasus.jmpi.CIMObjectPath pathName,                      {
         //                                              java.lang.String               role,                         DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl));
         //                                              boolean                        includeQualifiers,                         AutoMutex lock (pr._cimomMutex);
         //                                              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;)Ljava/util/Vector;");  
 //@BUG was:                   "(Lorg/pegasus/jmpi/CIMObjectPath;                                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::handleReferencesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl));
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: 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 references (org.pegasus.jmpi.CIMObjectPath assocName,                      JMPIjvm::checkException(env);
             //                                              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;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;");  
 //@BUG was:                       "(Lorg/pegasus/jmpi/CIMObjectPath;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::handleReferencesRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                      handler.deliver(*ciRet);
             }             }
         }         }
               handler.complete();
         if (id == NULL)              break;
         {  
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found no method!"<<PEGASUS_STD(endl));  
         }         }
  
         JMPIjvm::checkException(env);          case METHOD_ASSOCIATORPROVIDER:
   
         switch (eMethodFound)  
         {  
         case METHOD_PEGASUS_24:  
         {         {
             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, resultPath);             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, resultPath);
             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               jint    jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jPathNameRef);
   
               JMPIjvm::checkException(env);
   
             jstring jRole = env->NewStringUTF(request->role.getCString());             jstring jRole = env->NewStringUTF(request->role.getCString());
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
Line 2402 
Line 4701 
  
 #ifdef PEGASUS_DEBUG #ifdef PEGASUS_DEBUG
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: assocName          = "<<resultPath->toString ()<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: assocName          = "<<resultPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: pathName           = "<<objectPath->toString ()<<PEGASUS_STD(endl));
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: role               = "<<request->role<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: role               = "<<request->role<<PEGASUS_STD(endl));
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeQualifiers  = "<<false<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeQualifiers  = "<<false<<PEGASUS_STD(endl));
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));
Line 2410 
Line 4710 
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                   id,                                                                   id,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                     jPathName,
                                                                   jRole,                                                                   jRole,
                                                                   false,                                                                    JMPI_INCLUDE_QUALIFIERS,
                                                                   false,                                                                    request->includeClassOrigin,
                                                                   jPropertyList);                                                                   jPropertyList);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
Line 2421 
Line 4722 
  
             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);                     jint jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                       CIMInstance         *ciRet     = DEBUG_ConvertJavaToC (jint, 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 4768 
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          case METHOD_ASSOCIATORPROVIDER2:
         {         {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, resultPath);             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, resultPath);
             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);
  
Line 2483 
Line 4799 
  
             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;             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->CallIntMethod(jVec,JMPIjvm::jv.VectorSize); i<m; i++) {                 for (int i=0,m=env->CallIntMethod(jVec,JMPIjvm::jv.VectorSize); i<m; i++) {
Line 2505 
Line 4829 
  
                     jint                 jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);                     jint                 jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                     CIMInstance         *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                     CIMInstance         *ciRet     = DEBUG_ConvertJavaToC (jint, 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 2540 
Line 4879 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
       STAT_COPYDISPATCHER
   
     return(response);     return(response);
 } }
  
Line 2551 
Line 4892 
  
     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 2579 
Line 4922 
         ProviderName name = _resolveProviderName(         ProviderName name = _resolveProviderName(
             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);
   
           JMPIProvider &pr = ph.GetProvider();
   
           PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.referenceNames: " + pr.getName());
   
           DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: Calling provider referenceNames: "<<pr.getName()<<", role: "<<request->role<<", aCls: "<<request->resultClass<<PEGASUS_STD(endl));
   
           JvmVector *jv = 0;
   
           env = JMPIjvm::attachThread(&jv);
   
           if (!env)
           {
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               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);
   
           STAT_GETSTARTTIME;
   
           jmethodID id               = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           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,
              //                                         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;)Ljava/util/Vector;");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_ASSOCIATORPROVIDER;
                  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)
              {
                  env->ExceptionClear();
   
                  // 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)
                  //        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;)[Lorg/pegasus/jmpi/CIMObjectPath;");
   
                  if (id != NULL)
                  {
                      eMethodFound = METHOD_CIMASSOCIATORPROVIDER2;
                      DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found METHOD_CIMASSOCIATORPROVIDER2."<<PEGASUS_STD(endl));
                  }
              }
           }
   
           if (id == NULL)
           {
               DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found no method!"<<PEGASUS_STD(endl));
   
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               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:
           {
               jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, resultPath);
               jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);
   
               JMPIjvm::checkException(env);
   
               jint    jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,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
   
               jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     jPathName,
                                                                     jAssociationName,
                                                                     jRole);
   
               JMPIjvm::checkException(env);
   
               STAT_PMS_PROVIDEREND;
   
               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);
   
                       jint jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
   
                       JMPIjvm::checkException(env);
   
                       CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRetRef);
   
                       handler.deliver(*copRet);
                   }
               }
               handler.complete();
               break;
           }
  
         // convert arguments          case METHOD_CIMASSOCIATORPROVIDER2:
         OperationContext context;          {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
  
         context.insert(request->operationContext.get(IdentityContainer::NAME));              jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, resultPath);
         context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));              jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);
         context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));  
  
         JMPIProvider &pr = ph.GetProvider();              JMPIjvm::checkException(env);
  
         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.referenceNames: " + pr.getName());              jint    jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jPathNameRef);
  
         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: Calling provider referenceNames: "<<pr.getName()<<", role: "<<request->role<<", aCls: "<<request->resultClass<<PEGASUS_STD(endl));              JMPIjvm::checkException(env);
  
         JvmVector *jv = 0;              jstring jRole = env->NewStringUTF(request->role.getCString());
  
         env = JMPIjvm::attachThread(&jv);              JMPIjvm::checkException(env);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);  #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
  
         STAT_GETSTARTTIME;              jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     joc,
                                                                     jPathName,
                                                                     jAssociationName,
                                                                     jRole);
  
         jmethodID id = NULL;              JMPIjvm::checkException(env);
  
         // public abstract java.util.Vector referenceNames (org.pegasus.jmpi.CIMObjectPath assocName,              STAT_PMS_PROVIDEREND;
         //                                                  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;)Ljava/util/Vector;");  
 //@BUG was:                   "(Lorg/pegasus/jmpi/CIMObjectPath;                                Ljava/lang/String;)Ljava/util/Vector;"  
  
         if (id != NULL)              if (joc)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: 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 referenceNames (org.pegasus.jmpi.CIMObjectPath assocName,                      jobject jcopRet = env->GetObjectArrayElement(jAr,i);
             //                                                  java.lang.String               role)  
             //        throws org.pegasus.jmpi.CIMException  
             id = env->GetMethodID((jclass)pr.jProviderClass,  
                                   "referenceNames",  
                                   "(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)Ljava/util/Vector;");  
 //@BUG was:                       "(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMObjectPath;"  
  
             if (id != NULL)                      JMPIjvm::checkException(env);
             {  
                 eMethodFound = METHOD_PEGASUS_24;  
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));  
             }  
         }  
  
         if (id == NULL)                      jint jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
         {  
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found no method!"<<PEGASUS_STD(endl));  
         }  
  
         JMPIjvm::checkException(env);         JMPIjvm::checkException(env);
  
         switch (eMethodFound)                      CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRetRef);
         {  
         case METHOD_PEGASUS_24:                      handler.deliver(*copRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_ASSOCIATORPROVIDER:
         {         {
             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, resultPath);             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, resultPath);
             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               jint    jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jPathNameRef);
   
               JMPIjvm::checkException(env);
   
             jstring jRole = env->NewStringUTF(request->role.getCString());             jstring jRole = env->NewStringUTF(request->role.getCString());
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
 #ifdef PEGASUS_DEBUG #ifdef PEGASUS_DEBUG
             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: assocName          = "<<objectPath->toString ()<<PEGASUS_STD(endl));             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));             DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: role               = "<<request->role<<PEGASUS_STD(endl));
 #endif #endif
  
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                   id,                                                                   id,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                     jPathName,
                                                                   jRole);                                                                   jRole);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
Line 2676 
Line 5201 
  
             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);
  
Line 2696 
Line 5221 
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          case METHOD_ASSOCIATORPROVIDER2:
         {         {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, resultPath);             jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, resultPath);
             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);             jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);
  
Line 2720 
Line 5248 
  
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                   id,                                                                   id,
                                                                     joc,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                   jPathName,                                                                   jPathName,
                                                                   jRole);                                                                   jRole);
Line 2728 
Line 5257 
  
             STAT_PMS_PROVIDEREND;             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->CallIntMethod(jVec,JMPIjvm::jv.VectorSize); i<m; i++) {                 for (int i=0,m=env->CallIntMethod(jVec,JMPIjvm::jv.VectorSize); i<m; i++) {
Line 2763 
Line 5299 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
       STAT_COPYDISPATCHER
   
     return(response);     return(response);
 } }
  
Line 2774 
Line 5312 
  
     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 5338 
             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 5353 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
           if (!env)
           {
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               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);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;         STAT_GETSTARTTIME;
  
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
  
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
   
           if (interfaceType == "JMPI")
           {
         // public abstract org.pegasus.jmpi.CIMValue getPropertyValue (org.pegasus.jmpi.CIMObjectPath cop,         // public abstract org.pegasus.jmpi.CIMValue getPropertyValue (org.pegasus.jmpi.CIMObjectPath cop,
         //                                                             java.lang.String               oclass,         //                                                             java.lang.String               oclass,
         //                                                             java.lang.String               pName)         //                                                             java.lang.String               pName)
Line 2837 
Line 5389 
  
         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();
   
               STAT_COPYDISPATCHER
   
               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:
           {
               jint    jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewI, 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);
   
               STAT_GETSTARTTIME;
   
               jobject jvalRet = env->CallObjectMethod ((jobject)pr.jProvider,
                                                        id,
                                                        jcop,
                                                        joclass,
                                                        jpName);
   
               JMPIjvm::checkException(env);
   
               STAT_PMS_PROVIDEREND;
   
               handler.processing();
   
               if (jvalRet)
               {
                  jint      jvalRetRef = env->CallIntMethod(jvalRet,JMPIjvm::jv.CIMValueCInst);
                  CIMValue *valRet     = DEBUG_ConvertJavaToC (jint, CIMValue*, jvalRetRef);
   
                  JMPIjvm::checkException(env);
   
                  handler.deliver(*valRet);
               }
               handler.complete();
               break;
           }
   
           case METHOD_PROPERTYPROVIDER2:
         {         {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
             jint    jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);             jint    jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewI, jcopref);             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewI, jcopref);
  
Line 2869 
Line 5493 
  
             jobject jvalRet = env->CallObjectMethod ((jobject)pr.jProvider,             jobject jvalRet = env->CallObjectMethod ((jobject)pr.jProvider,
                                                      id,                                                      id,
                                                        joc,
                                                      jcop,                                                      jcop,
                                                      joclass,                                                      joclass,
                                                      jpName);                                                      jpName);
Line 2877 
Line 5502 
  
             STAT_PMS_PROVIDEREND;             STAT_PMS_PROVIDEREND;
  
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
   
             handler.processing();             handler.processing();
  
             if (jvalRet)             if (jvalRet)
Line 2905 
Line 5537 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
       STAT_COPYDISPATCHER
   
     return(response);     return(response);
 } }
  
Line 2916 
Line 5550 
  
     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 5576 
             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 5591 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
           if (!env)
           {
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               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);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;         STAT_GETSTARTTIME;
  
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
  
           if (interfaceType == "JMPI")
           {
         // public abstract void setPropertyValue (org.pegasus.jmpi.CIMObjectPath cop,         // public abstract void setPropertyValue (org.pegasus.jmpi.CIMObjectPath cop,
         //                                        java.lang.String               oclass,         //                                        java.lang.String               oclass,
         //                                        java.lang.String               pName,         //                                        java.lang.String               pName,
Line 2980 
Line 5628 
  
         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();
   
               STAT_COPYDISPATCHER
   
               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:
           {
               jint    jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewI, 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);
   
               jint    jvalref = DEBUG_ConvertCToJava (CIMValue*, jint, val);
               jobject jval    = env->NewObject(jv->CIMValueClassRef, jv->CIMValueNewI, jvalref);
   
               JMPIjvm::checkException(env);
   
               STAT_GETSTARTTIME;
   
               env->CallVoidMethod ((jobject)pr.jProvider,
                                    id,
                                    jcop,
                                    joclass,
                                    jpName,
                                    jval);
   
               JMPIjvm::checkException(env);
   
               STAT_PMS_PROVIDEREND;
               break;
           }
   
           case METHOD_PROPERTYPROVIDER2:
         {         {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
             jint    jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);             jint    jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewI, jcopref);             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewI, jcopref);
  
Line 3021 
Line 5739 
  
             env->CallVoidMethod ((jobject)pr.jProvider,             env->CallVoidMethod ((jobject)pr.jProvider,
                                  id,                                  id,
                                    joc,
                                  jcop,                                  jcop,
                                  joclass,                                  joclass,
                                  jpName,                                  jpName,
Line 3028 
Line 5747 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
   
             STAT_PMS_PROVIDEREND;             STAT_PMS_PROVIDEREND;
             break;             break;
         }         }
Line 3045 
Line 5771 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
       STAT_COPYDISPATCHER
   
     return(response);     return(response);
 } }
  
Line 3056 
Line 5784 
  
     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 5812 
             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 5826 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
           if (!env)
           {
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               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);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;         STAT_GETSTARTTIME;
  
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
  
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
   
           if (interfaceType == "JMPI")
           {
         // public abstract org.pegasus.jmpi.CIMValue invokeMethod (org.pegasus.jmpi.CIMObjectPath cop,         // public abstract org.pegasus.jmpi.CIMValue invokeMethod (org.pegasus.jmpi.CIMObjectPath cop,
         //                                                         java.lang.String               name,         //                                                         java.lang.String               name,
         //                                                         java.util.Vector               in,         //                                                         java.util.Vector               in,
Line 3119 
Line 5862 
  
         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 5881 
  
             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();
   
              STAT_COPYDISPATCHER
   
              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);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,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]);
                 jint           jArgRef = DEBUG_ConvertCToJava (CIMParamValue*, jint, parm);
                 jobject        jArg    = env->NewObject(jv->CIMArgumentClassRef,jv->CIMArgumentNewI,jArgRef);
   
                 env->SetObjectArrayElement(jArIn,i,jArg);
               }
   
               jobjectArray jArOut=(jobjectArray)env->NewObjectArray(24,jv->CIMArgumentClassRef,NULL);
   
               jobject jValueRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                         id,
                                                         jcop,
                                                         jMethod,
                                                         jArIn,
                                                         jArOut);
               JMPIjvm::checkException(env);
   
               STAT_PMS_PROVIDEREND;
   
               handler.processing();
   
               jint      jValueRetRef = env->CallIntMethod(jValueRet,JMPIjvm::jv.CIMValueCInst);
               CIMValue *valueRet     = DEBUG_ConvertJavaToC (jint, 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;
   
                   jint           jpRef = env->CallIntMethod(jArg,JMPIjvm::jv.CIMArgumentCInst);
                   CIMParamValue *p     = DEBUG_ConvertJavaToC (jint, CIMParamValue*, jpRef);
   
                   JMPIjvm::checkException(env);
   
                   handler.deliverParamValue(*p);
               }
   
               handler.complete();
               break;
           }
   
           case METHOD_CIMMETHODPROVIDER2:
         {         {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);
  
Line 3174 
Line 6035 
  
             jobject jValueRet = env->CallObjectMethod((jobject)pr.jProvider,             jobject jValueRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                       id,                                                       id,
                                                         joc,
                                                       jcop,                                                       jcop,
                                                       jMethod,                                                       jMethod,
                                                       jArIn,                                                       jArIn,
Line 3182 
Line 6044 
  
             STAT_PMS_PROVIDEREND;             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);             jint      jValueRetRef = env->CallIntMethod(jValueRet,JMPIjvm::jv.CIMValueCInst);
Line 3209 
Line 6078 
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          case METHOD_METHODPROVIDER:
           {
               jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,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());
                   jint                 jpRef = DEBUG_ConvertCToJava (CIMProperty*, jint, p);
                   jobject              jp    = env->NewObject(jv->CIMPropertyClassRef,jv->CIMPropertyNewI,jpRef);
   
                   env->CallVoidMethod(jVecIn,jv->VectorAddElement,jp);
                }
   
               jobject jVecOut=env->NewObject(jv->VectorClassRef,jv->VectorNew);
               JMPIjvm::checkException(env);
   
               jobject jValueRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                         id,
                                                         jcop,
                                                         jMethod,
                                                         jVecIn,
                                                         jVecOut);
               JMPIjvm::checkException(env);
   
               STAT_PMS_PROVIDEREND;
   
               handler.processing();
   
               jint      jValueRetRef = env->CallIntMethod(jValueRet,JMPIjvm::jv.CIMValueCInst);
               CIMValue *valueRet     = DEBUG_ConvertJavaToC (jint, 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);
   
                   jint         jpRef = env->CallIntMethod(jProp,JMPIjvm::jv.CIMPropertyCInst);
                   CIMProperty *p     = DEBUG_ConvertJavaToC (jint, CIMProperty*, jpRef);
   
                   JMPIjvm::checkException(env);
   
                   handler.deliverParamValue(CIMParamValue(p->getName().getString(),p->getValue()));
               }
   
               handler.complete();
               break;
           }
   
           case METHOD_METHODPROVIDER2:
         {         {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);
  
Line 3240 
Line 6178 
  
             jobject jValueRet = env->CallObjectMethod((jobject)pr.jProvider,             jobject jValueRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                       id,                                                       id,
                                                         joc,
                                                       jcop,                                                       jcop,
                                                       jMethod,                                                       jMethod,
                                                       jVecIn,                                                       jVecIn,
Line 3248 
Line 6187 
  
             STAT_PMS_PROVIDEREND;             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);             jint      jValueRetRef = env->CallIntMethod(jValueRet,JMPIjvm::jv.CIMValueCInst);
Line 3288 
Line 6234 
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
       STAT_COPYDISPATCHER
   
     return(response);     return(response);
 } }
  
Line 3302 
Line 6250 
     return 0;     return 0;
 } }
  
   CMPI_SelectExp *
   newSelectExp (CIMOMHandleQueryContext *qContext,
                 OperationContext        *ctx,
                 String&                  query,
                 String&                  queryLanguage,
                 CIMNamespaceName&        nameSpace,
                 Array<CIMName>&          classNames,
                 CIMPropertyList&         propertyList)
   {
      CMPI_SelectExp *eSelx = NULL;
   
      eSelx = new CMPI_SelectExp (*ctx,
                                  qContext,
                                  query,
                                  queryLanguage);
   
      if (!eSelx)
      {
         return eSelx;
      }
   
      for (Uint32 i = 0, n = classNames.size (); i < n; i++)
      {
          CIMObjectPath className (System::getHostName(),
                                   nameSpace,
                                   classNames[i]);
   
          eSelx->classNames.append (className);
      }
   
      if (!propertyList.isNull ())
      {
         Array<CIMName> p      = propertyList.getPropertyNameArray ();
         int            pCount = p.size ();
   
         eSelx->props = (const char**)malloc ((1 + pCount) * sizeof (char*));
   
         for (int i = 0; i < pCount; i++)
         {
            eSelx->props[i] = strdup (p[i].getString ().getCString ());
         }
   
         eSelx->props[pCount] = NULL;
      }
   
      return eSelx;
   }
   
 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 6306 
  
     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()
                                <<", namespace = "
                                <<request->nameSpace.getString()
                                <<", providername = "
                                <<providerName
                                <<", fileName = "
                                <<fileName
                                <<PEGASUS_STD(endl));
   
           // get cached or load new provider module
           JMPIProvider::OpProviderHolder ph = providerManager.getProvider (fileName,
                                                                            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;
           bool                                  fNewPrec = false;
   
           {
              AutoMutex lock (mutexProvTab);
   
              provTab.lookup (providerName, prec);
   
              if (!prec)
              {
                  fNewPrec = true;
   
                  prec = new indProvRecord ();
  
         String fileName = resolveFileName(providerLocation);                 // convert arguments
                  prec->ctx = new OperationContext ();
  
         // get cached or load new provider module                 prec->ctx->insert (request->operationContext.get (IdentityContainer::NAME));
         JMPIProvider::OpProviderHolder ph =                 prec->ctx->insert (request->operationContext.get (AcceptLanguageListContainer::NAME));
             providerManager.getProvider(fileName, providerName, String::EMPTY);                 prec->ctx->insert (request->operationContext.get (ContentLanguageListContainer::NAME));
                  prec->ctx->insert (request->operationContext.get (SubscriptionInstanceContainer::NAME));
                  prec->ctx->insert (request->operationContext.get (SubscriptionFilterConditionContainer::NAME));
  
         indProvRecord *prec = NULL;                 prec->enabled = true;
  
         provTab.lookup(providerName,prec);                 prec->handler = new EnableIndicationsResponseHandler (0,
                                                                        0,
                                                                        req_provider,
                                                                        _indicationCallback,
                                                                        _responseChunkCallback);
   
                  DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: Adding to provTab "<<providerName<<PEGASUS_STD(endl));
  
         if (prec)  
         {  
             prec->count++;  
         }  
         else  
         {  
             prec=new indProvRecord();  
             provTab.insert(providerName,prec);             provTab.insert(providerName,prec);
         }         }
           }
  
         //          {
         //  Save the provider instance from the request             AutoMutex lock (prec->mutex);
         //  
         ph.GetProvider ().setProviderInstance (req_provider);  
   
         indSelectRecord     *srec  = new indSelectRecord();  
         const CIMObjectPath &sPath = request->subscriptionInstance.getPath();  
  
         selxTab.insert(sPath.toString(),srec);             prec->count++;
           }
  
         // convert arguments          // Add a selection record for JNI CIMOMHandle deliverEvent calls
         OperationContext *context=new OperationContext();          indSelectRecord *srec = new indSelectRecord ();
  
         if (prec->ctx==NULL)  
         {         {
             prec->ctx=context;             srec->query         = request->query;
         }             srec->queryLanguage = sub_cntr.getQueryLanguage ();
              srec->propertyList  = request->propertyList;
  
         context->insert(request->operationContext.get(IdentityContainer::NAME));             CIMOMHandleQueryContext *qContext = new CIMOMHandleQueryContext (CIMNamespaceName (request->nameSpace.getString ()),
         context->insert(request->operationContext.get(AcceptLanguageListContainer::NAME));                                                                              *pr._cimom_handle);
         context->insert(request->operationContext.get(ContentLanguageListContainer::NAME));             CMPI_SelectExp          *eSelx    = newSelectExp (qContext,
         context->insert(request->operationContext.get(SubscriptionInstanceContainer::NAME));                                                               prec->ctx,
         context->insert(request->operationContext.get(SubscriptionLanguageListContainer::NAME));                                                               srec->query,
         context->insert(request->operationContext.get(SubscriptionFilterConditionContainer::NAME));                                                               srec->queryLanguage,
                                                                request->nameSpace,
                                                                request->classNames,
                                                                srec->propertyList);
  
         CIMObjectPath subscriptionName = request->subscriptionInstance.getPath();             srec->eSelx    = eSelx;
              srec->qContext = qContext;
  
         SubscriptionFilterConditionContainer sub_cntr =  request->operationContext.get             CIMObjectPath sPath (request->subscriptionInstance.getPath ().getClassName ().getString ());
                 (SubscriptionFilterConditionContainer::NAME);  
  
         JMPIProvider &pr = ph.GetProvider();             sPath.setNameSpace (request->subscriptionInstance.getPath ().getNameSpace ());
  
         CIMOMHandleQueryContext *qcontext=new CIMOMHandleQueryContext(CIMNamespaceName(request->nameSpace.getString()),             AutoMutex lock (mutexSelxTab);
                                                                       *pr._cimom_handle);  
  
         CMPI_SelectExp *eSelx = new CMPI_SelectExp(*context,             DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: Adding to selxTab "<<sPath.toString ()<<PEGASUS_STD(endl));
                                                    qcontext,  
                                                    request->query,  
                                                    sub_cntr.getQueryLanguage());  
  
         srec->eSelx=eSelx;             selxTab.insert (sPath.toString (), srec);
         srec->qContext=qcontext;  
              DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: For selxTab "<<sPath.toString ()<<", srec = "<<PEGASUS_STD(hex)<<(int)srec<<PEGASUS_STD(dec)<<", eSelx = "<<PEGASUS_STD(hex)<<(int)eSelx<<PEGASUS_STD(dec)<<", qContext = "<<PEGASUS_STD(hex)<<(int)qContext<<PEGASUS_STD(dec)<<PEGASUS_STD(endl));
           }
  
         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.createSubscriptionRequest: " + pr.getName());         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));         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: Calling provider createSubscriptionRequest: "<<pr.getName()<<PEGASUS_STD(endl));
  
         for(Uint32 i = 0, n = request->classNames.size(); i < n; i++) {          JvmVector *jv = 0;
             CIMObjectPath className(  
                 System::getHostName(),  
                 request->nameSpace,  
                 request->classNames[i]);  
             eSelx->classNames.append(className);  
         }  
  
         CIMPropertyList propertyList = request->propertyList;          env = JMPIjvm::attachThread(&jv);
  
         if (!propertyList.isNull())          if (!env)
         {         {
            Array<CIMName> p      = propertyList.getPropertyNameArray();              PEG_METHOD_EXIT();
            int            pCount = p.size();  
  
            eSelx->props=(const char**)malloc((1+pCount)*sizeof(char*));              STAT_COPYDISPATCHER
  
            for (int i=0; i<pCount; i++)              throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
            {                                             MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED",
               eSelx->props[i]=strdup(p[i].getString().getCString());                                                                "Could not initialize the JVM (Java Virtual Machine) runtime environment."));
            }  
            eSelx->props[pCount]=NULL;  
         }         }
  
         JvmVector *jv = 0;  
   
         env = JMPIjvm::attachThread(&jv);  
   
         JMPIProvider::pm_service_op_lock op_lock(&pr);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;         STAT_GETSTARTTIME;
  
         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 6487 
  
         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();
   
              STAT_COPYDISPATCHER
   
              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);              CMPI_SelectExp *eSelx     = newSelectExp (srec->qContext,
             jobject jSel    = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jSelRef);                                                        prec->ctx,
                                                         srec->query,
                                                         srec->queryLanguage,
                                                         request->nameSpace,
                                                         request->classNames,
                                                         srec->propertyList);
               jint            jEselxRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx);
               jobject         jEselx    = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jEselxRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, &eSelx->classNames[0]);              jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString());
   
               JMPIjvm::checkException(env);
   
               CIMObjectPath *cop     = new CIMObjectPath (System::getHostName(),
                                                           request->nameSpace,
                                                           request->classNames[0]);
               jint           jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, cop);
             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);             jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               env->CallVoidMethod ((jobject)pr.jProvider,
                                    id,
                                    jEselx,
                                    jType,
                                    jcop,
                                    (jboolean)fNewPrec);
   
               JMPIjvm::checkException(env);
   
               STAT_PMS_PROVIDEREND;
               break;
           }
   
           case METHOD_EVENTPROVIDER2:
           {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
               CMPI_SelectExp *eSelx     = newSelectExp (srec->qContext,
                                                         prec->ctx,
                                                         srec->query,
                                                         srec->queryLanguage,
                                                         request->nameSpace,
                                                         request->classNames,
                                                         srec->propertyList);
               jint            jEselxRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx);
               jobject         jEselx    = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jEselxRef);
   
               JMPIjvm::checkException(env);
   
             jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString());             jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString());
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               CIMObjectPath *cop     = new CIMObjectPath (System::getHostName(),
                                                           request->nameSpace,
                                                           request->classNames[0]);
               jint           jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, cop);
               jobject        jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);
   
               JMPIjvm::checkException(env);
   
             env->CallVoidMethod((jobject)pr.jProvider,             env->CallVoidMethod((jobject)pr.jProvider,
                                 id,                                 id,
                                 jSel,                                   joc,
                                    jEselx,
                                 jType,                                 jType,
                                 jcop,                                 jcop,
                                 (jboolean)0);                                   (jboolean)fNewPrec);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             //              if (joc)
             //  Increment count of current subscriptions for this provider  
             //  
             if (ph.GetProvider ().testIfZeroAndIncrementSubscriptions ())  
             {  
                 //  
                 //  If there were no current subscriptions before the increment,  
                 //  the first subscription has been created  
                 //  Call the provider's enableIndications method  
                 //  
                 if (_subscriptionInitComplete)  
                 {                 {
                     prec->enabled = true;                 env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
                     CIMRequestMessage * request = 0;  
                     CIMResponseMessage * response = 0;                 JMPIjvm::checkException(env);
                     prec->handler = new EnableIndicationsResponseHandler  
                         (request, response, req_provider, _indicationCallback);  
                 }  
             }             }
  
             STAT_PMS_PROVIDEREND;             STAT_PMS_PROVIDEREND;
Line 3511 
Line 6622 
             break;             break;
         }         }
         }         }
   
     }     }
     HandlerCatch(handler);     HandlerCatch(handler);
  
Line 3530 
Line 6640 
  
     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 6660 
         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 ().getClassName ().getString ());
         String               sPathString = sPath.toString();  
  
         selxTab.lookup(sPathString,srec);             sPath.setNameSpace (request->subscriptionInstance.getPath ().getNameSpace ());
  
         CMPI_SelectExp          *eSelx    = srec->eSelx;             String sPathString = sPath.toString ();
         CIMOMHandleQueryContext *qContext = srec->qContext;  
  
         selxTab.remove(sPathString);             AutoMutex lock (mutexSelxTab);
  
         // convert arguments             DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: Removing selxTab "<<sPathString<<PEGASUS_STD(endl));
         OperationContext context;  
  
         context.insert(request->operationContext.get(IdentityContainer::NAME));             selxTab.lookup (sPathString, srec);
         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: For selxTab "<<sPathString<<", srec = "<<PEGASUS_STD(hex)<<(int)srec<<PEGASUS_STD(dec)<<", eSelx = "<<PEGASUS_STD(hex)<<(int)srec->eSelx<<PEGASUS_STD(dec)<<", qContext = "<<PEGASUS_STD(hex)<<(int)srec->qContext<<PEGASUS_STD(dec)<<PEGASUS_STD(endl));
  
         JMPIProvider & pr=ph.GetProvider();             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 6737 
  
         env = JMPIjvm::attachThread(&jv);         env = JMPIjvm::attachThread(&jv);
  
           if (!env)
           {
               PEG_METHOD_EXIT();
   
               STAT_COPYDISPATCHER
   
               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);         JMPIProvider::pm_service_op_lock op_lock(&pr);
  
         STAT_GETSTARTTIME;         STAT_GETSTARTTIME;
  
         jmethodID id = NULL;         jmethodID id = NULL;
           String    interfaceType;
           String    interfaceVersion;
   
           getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
  
           if (interfaceType == "JMPI")
           {
         // public void deActivateFilter (org.pegasus.jmpi.SelectExp    filter,         // public void deActivateFilter (org.pegasus.jmpi.SelectExp    filter,
         //                              java.lang.String               eventType,         //                              java.lang.String               eventType,
         //                              org.pegasus.jmpi.CIMObjectPath classPath,         //                              org.pegasus.jmpi.CIMObjectPath classPath,
Line 3619 
Line 6773 
  
         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();
   
              STAT_COPYDISPATCHER
   
              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);              CMPI_SelectExp *eSelx     = newSelectExp (srec->qContext,
             jobject jSel = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jObj);                                                        prec->ctx,
                                                         srec->query,
                                                         srec->queryLanguage,
                                                         request->nameSpace,
                                                         request->classNames,
                                                         srec->propertyList);
               jint            jEselxRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx);
               jobject         jEselx    = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jEselxRef);
   
               JMPIjvm::checkException(env);
   
               jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString());
   
               JMPIjvm::checkException(env);
   
               CIMObjectPath *cop     = new CIMObjectPath (System::getHostName(),
                                                           request->nameSpace,
                                                           request->classNames[0]);
               jint           jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, cop);
               jobject        jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);
   
               JMPIjvm::checkException(env);
   
               env->CallVoidMethod ((jobject)pr.jProvider,
                                    id,
                                    jEselx,
                                    jType,
                                    jcop,
                                    (jboolean)fFreePrec);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jObj = DEBUG_ConvertCToJava (CIMObjectPath*, jint, &eSelx->classNames[0]);              STAT_PMS_PROVIDEREND;
               break;
           }
   
           case METHOD_EVENTPROVIDER2:
           {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
  
             jobject jRef = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jObj);              CMPI_SelectExp *eSelx     = newSelectExp (srec->qContext,
                                                         prec->ctx,
                                                         srec->query,
                                                         srec->queryLanguage,
                                                         request->nameSpace,
                                                         request->classNames,
                                                         srec->propertyList);
               jint            jEselxRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx);
               jobject         jEselx    = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jEselxRef);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 3644 
Line 6873 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               CIMObjectPath *cop     = new CIMObjectPath (System::getHostName(),
                                                           request->nameSpace,
                                                           request->classNames[0]);
               jint           jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, cop);
               jobject        jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);
   
               JMPIjvm::checkException(env);
   
             env->CallVoidMethod((jobject)pr.jProvider,             env->CallVoidMethod((jobject)pr.jProvider,
                                 id,                                 id,
                                 jSel,                                   joc,
                                    jEselx,
                                 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                 JMPIjvm::checkException(env);
                 //  Call the provider's disableIndications method  
                 //  
                 if (_subscriptionInitComplete)  
                 {  
                     prec->enabled = false;  
                     if (prec->handler) delete prec->handler;  
                     prec->handler = NULL;  
                 }  
             }             }
  
             STAT_PMS_PROVIDEREND;             STAT_PMS_PROVIDEREND;
   
             delete eSelx;  
             delete qContext;  
             delete srec;  
             break;             break;
         }         }
  
Line 3685 
Line 6908 
             break;             break;
         }         }
         }         }
   
           //
           //  Decrement count of current subscriptions for this provider
           //
           pr.decrementSubscriptionsAndTestIfZero ();
     }     }
     HandlerCatch(handler);     HandlerCatch(handler);
  
       if (srec)
       {
          if (  srec->eSelx
             && srec->eSelx->props
             )
          {
             const char **props = srec->eSelx->props;
   
             while (*props)
             {
                const char *prop = *props;
   
                props++;
   
                if (prop)
                {
                   free ((void *)prop);
                }
             }
   
             free ((void *)srec->eSelx->props);
          }
          delete srec->eSelx;
          delete srec->qContext;
       }
       delete srec;
   
       if (fFreePrec)
       {
          delete prec->ctx;
          delete prec->handler;
          delete prec;
       }
   
     if (env) JMPIjvm::detachThread();     if (env) JMPIjvm::detachThread();
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
       STAT_COPYDISPATCHER
   
     return(response);     return(response);
 } }
  
Line 3823 
Line 7087 
            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 7126 
     //  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 3906 
Line 7173 
                 "Unknown error in handleSubscriptionInitCompleteRequest");                 "Unknown error in handleSubscriptionInitCompleteRequest");
         }         }
     }     }
   #endif
  
     PEG_METHOD_EXIT ();     PEG_METHOD_EXIT ();
     return (response);     return (response);


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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2