(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.33 and 1.41.2.2

version 1.33, 2005/10/19 16:00:27 version 1.41.2.2, 2006/03/10 21:47:05
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 66 
Line 68 
 #else #else
 #define DDD(x) #define DDD(x)
 #endif #endif
   
   // request->localOnly is replaced with JMPI_LOCALONLY for getInstance () and enumerateInstances ()
 #define JMPI_LOCALONLY false #define JMPI_LOCALONLY false
 #define JMPI_DEEPINHERITANCE true  
 /* Fix for 4092 */ /* Fix for 4092 */
   // request->includeQualifiers is replaced with JMPI_INCLUDE_QUALIFIERS for getInstance (),
   //    setInstance (), enumerateInstances (), associators (), and references ()
 #define JMPI_INCLUDE_QUALIFIERS false #define JMPI_INCLUDE_QUALIFIERS false
  
 #include "Convert.h" #include "Convert.h"
Line 77 
Line 83 
 { {
    // 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;"},
       /* Fix for 4189 */        /* Begin Fix for 4189 */
       {"enumInstances","(Lorg/pegasus/jmpi/CIMObjectPath;ZLorg/pegasus/jmpi/CIMClass;ZZZ[Ljava/lang/String;)Ljava/util/Vector;"},        {"pegasus 2.5","enumerateInstances","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;ZZ[Ljava/lang/String;)Ljava/util/Vector;"},
       {"enumInstances","(Lorg/pegasus/jmpi/CIMObjectPath;ZLorg/pegasus/jmpi/CIMClass;Z)Ljava/util/Vector;"},        /* End Fix for 4189 */
       /* Fix for 4189 */        {"snia 2.0","enumInstances","(Lorg/pegasus/jmpi/CIMObjectPath;ZLorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;"},
       {"getInstance","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;Z)Lorg/pegasus/jmpi/CIMInstance;"},        {"pegasus 2.4","enumerateInstanceNames","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;)[Lorg/pegasus/jmpi/CIMObjectPath;"},
       {"createInstance","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMInstance;)Lorg/pegasus/jmpi/CIMObjectPath;"},        {"pegasus 2.5","enumerateInstanceNames","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;"},
       {"setInstance","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMInstance;)V"},        {"snia 2.0","getInstance","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;Z)Lorg/pegasus/jmpi/CIMInstance;"},
       {"deleteInstance","(Lorg/pegasus/jmpi/CIMObjectPath;)V"},        {"pegasus 2.4","getInstance","(Lorg/pegasus/jmpi/CIMObjectPath;ZZZ[Ljava/lang/String;Lorg/pegasus/jmpi/CIMClass;)Lorg/pegasus/jmpi/CIMInstance;"},
       {"execQuery","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ILorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;"},        /* 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 137 
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 222 
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;
 JMPIProviderManager::IndSelectTab  JMPIProviderManager::selxTab; JMPIProviderManager::IndSelectTab  JMPIProviderManager::selxTab;
 JMPIProviderManager::ProvRegistrar JMPIProviderManager::provReg; JMPIProviderManager::ProvRegistrar JMPIProviderManager::provReg;
Line 403 
Line 528 
     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 465 
Line 590 
  
     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 495 
Line 621 
                                    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 506 
Line 636 
  
         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 522 
Line 673 
  
         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 543 
Line 694 
  
             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 580 
Line 781 
             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 602 
Line 803 
             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 674 
Line 966 
  
     typedef enum {     typedef enum {
        METHOD_UNKNOWN = 0,        METHOD_UNKNOWN = 0,
        METHOD_PEGASUS_24,         METHOD_CIMINSTANCEPROVIDER,
        METHOD_SNIA_PROVIDER20_VER1,         METHOD_CIMINSTANCEPROVIDER2,
        METHOD_SNIA_PROVIDER20_VER2,         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 700 
Line 993 
             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 722 
Line 1015 
  
         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;
  
         /* Fix for 4189 */          getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
         // public synchronized Vector enumInstances(CIMObjectPath cop,                            interfaceType,
                             interfaceVersion);
   
           if (interfaceType == "JMPI")
           {
              // public abstract java.util.Vector enumInstances (org.pegasus.jmpi.CIMObjectPath cop,
         //                                          boolean       deep,         //                                          boolean       deep,
         //                                          CIMClass      cimClass,             //                                                 org.pegasus.jmpi.CIMClass      cimClass,
         //                                          boolean       localOnly,             //                                                 boolean                        localOnly)
         //                                          boolean       includeQualifiers,  
         //                                          boolean       includeClassOrigin,  
         //                                          String        propertyList[])  
         //        throws org.pegasus.jmpi.CIMException         //        throws org.pegasus.jmpi.CIMException
         id = env->GetMethodID((jclass)pr.jProviderClass,         id = env->GetMethodID((jclass)pr.jProviderClass,
                               "enumInstances",                               "enumInstances",
                               "(Lorg/pegasus/jmpi/CIMObjectPath;ZLorg/pegasus/jmpi/CIMClass;ZZZ[Ljava/lang/String;)Ljava/util/Vector;");                                   "(Lorg/pegasus/jmpi/CIMObjectPath;ZLorg/pegasus/jmpi/CIMClass;Z)Ljava/util/Vector;");
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20_VER1;                 eMethodFound = METHOD_INSTANCEPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_SNIA_PROVIDER20_VER1."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_INSTANCEPROVIDER."<<PEGASUS_STD(endl));
         }         }
         /* Fix for 4189 */  
  
         if (id == NULL)         if (id == NULL)
         {         {
             env->ExceptionClear();             env->ExceptionClear();
  
             // public abstract java.util.Vector enumInstances (org.pegasus.jmpi.CIMObjectPath cop,                 // public org.pegasus.jmpi.CIMInstance[] enumInstances (org.pegasus.jmpi.CIMObjectPath cop,
             //                                                 boolean                        deep,                 //                                                      boolean                        localOnly,
             //                                                 org.pegasus.jmpi.CIMClass      cimClass,                 //                                                      boolean                        includeQualifiers,
             //                                                 boolean                        localOnly)                 //                                                      boolean                        includeClassOrigin,
                  //                                                      java.lang.String[]             propertyList,
                  //                                                      org.pegasus.jmpi.CIMClass      cimClass)
             //        throws org.pegasus.jmpi.CIMException             //        throws org.pegasus.jmpi.CIMException
             id = env->GetMethodID((jclass)pr.jProviderClass,             id = env->GetMethodID((jclass)pr.jProviderClass,
                                   "enumInstances",                                   "enumInstances",
                                   "(Lorg/pegasus/jmpi/CIMObjectPath;ZLorg/pegasus/jmpi/CIMClass;Z)Ljava/util/Vector;");                                       "(Lorg/pegasus/jmpi/CIMObjectPath;ZZZ[Ljava/lang/String;Lorg/pegasus/jmpi/CIMClass;)[Lorg/pegasus/jmpi/CIMInstance;");
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_SNIA_PROVIDER20_VER2;                     eMethodFound = METHOD_CIMINSTANCEPROVIDER;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_SNIA_PROVIDER20_VER2."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_CIMINSTANCEPROVIDER."<<PEGASUS_STD(endl));
                  }
             }             }
         }         }
           else if (interfaceType == "JMPIExperimental")
           {
              /* Fix for 4189 */
              // public abstract java.util.Vector enumerateInstances (org.pegasus.jmpi.OperationContext oc
              //                                                      org.pegasus.jmpi.CIMObjectPath    cop,
              //                                                      org.pegasus.jmpi.CIMClass         cimClass,
              //                                                      boolean                           includeQualifiers,
              //                                                      boolean                           includeClassOrigin,
              //                                                      java.lang.String[]                propertyList)
              //         throws org.pegasus.jmpi.CIMException
              id = env->GetMethodID((jclass)pr.jProviderClass,
                                    "enumerateInstances",
                                    "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;ZZ[Ljava/lang/String;)Ljava/util/Vector;");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_INSTANCEPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_INSTANCEPROVIDER2."<<PEGASUS_STD(endl));
              }
              /* Fix for 4189 */
  
         if (id == NULL)         if (id == NULL)
         {         {
             env->ExceptionClear();             env->ExceptionClear();
  
             // public org.pegasus.jmpi.CIMInstance[] enumerateInstances (org.pegasus.jmpi.CIMObjectPath op,                 // public abstract org.pegasus.jmpi.CIMInstance[] enumerateInstances (org.pegasus.jmpi.OperationContext oc
             //                                                           boolean                        localOnly,                 //                                                                    org.pegasus.jmpi.CIMObjectPath    cop,
                  //                                                                    org.pegasus.jmpi.CIMClass         cimClass,
             //                                                           boolean                        includeQualifiers,             //                                                           boolean                        includeQualifiers,
             //                                                           boolean                        includeClassOrigin,             //                                                           boolean                        includeClassOrigin,
             //                                                           java.lang.String[]             propertyList,                 //                                                                    java.lang.String[]                propertyList)
             //                                                           org.pegasus.jmpi.CIMClass      cc)  
             //         throws org.pegasus.jmpi.CIMException             //         throws org.pegasus.jmpi.CIMException
             id = env->GetMethodID((jclass)pr.jProviderClass,             id = env->GetMethodID((jclass)pr.jProviderClass,
                                   "enumerateInstances",                                       "enumInstances",
                                   "(Lorg/pegasus/jmpi/CIMObjectPath;ZZZ[Ljava/lang/String;Lorg/pegasus/jmpi/CIMClass;)[Lorg/pegasus/jmpi/CIMInstance;");                                       "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;ZZ[Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMInstance;");
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_PEGASUS_24;                     eMethodFound = METHOD_CIMINSTANCEPROVIDER2;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_CIMINSTANCEPROVIDER2."<<PEGASUS_STD(endl));
                  }
              }
             }             }
   
           if (id == NULL)
           {
              DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: No method found!"<<PEGASUS_STD(endl));
   
              PEG_METHOD_EXIT();
   
              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 818 
Line 1177 
             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 844 
Line 1202 
                     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);
  
                     JMPIjvm::checkException(env);                      /* Fix for 4237 */
                       CIMClass cls;
                     handler.deliver(*ciRet);  
                 }                      try
             }                      {
             handler.complete();                         DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl));
             break;                         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;
           }
   
           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);
               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);
               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 */         /* Fix for 4189 */
         case METHOD_SNIA_PROVIDER20_VER1:          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);
  
             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 880 
Line 1391 
             jobjectArray jPropertyList = getList(jv,env,request->propertyList);             jobjectArray jPropertyList = getList(jv,env,request->propertyList);
             jobject      jVec          = env->CallObjectMethod((jobject)pr.jProvider,             jobject      jVec          = env->CallObjectMethod((jobject)pr.jProvider,
                                                                id,                                                                id,
                                                                  joc,
                                                                jcop,                                                                jcop,
                                                                request->deepInheritance,  
                                                                jcc,                                                                jcc,
                                                                JMPI_LOCALONLY,  
                                                                JMPI_INCLUDE_QUALIFIERS,                                                                JMPI_INCLUDE_QUALIFIERS,
                                                                request->includeClassOrigin,                                                                request->includeClassOrigin,
                                                                jPropertyList);                                                                jPropertyList);
Line 892 
Line 1402 
  
             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 905 
Line 1422 
                     CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                     CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);
  
                     /* Fix for 4237 */                     /* Fix for 4237 */
                     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::handleEnumerateInstancesRequest: 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 930 
Line 1462 
         }         }
         /* Fix for 4189 */         /* Fix for 4189 */
  
         case METHOD_SNIA_PROVIDER20_VER2:          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);
  
             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 978 
Line 1525 
                     CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);                     CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);
  
                     /* Fix for 4237 */                     /* Fix for 4237 */
                     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::handleEnumerateInstancesRequest: 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 1028 
Line 1590 
  
     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 1053 
Line 1617 
             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 1067 
Line 1631 
  
         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 1089 
Line 1672 
  
         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 1106 
Line 1689 
  
             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 1168 
Line 1815 
             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::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 1191 
Line 1856 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             jobject jVec = env->CallObjectMethod((jobject)pr.jProvider,              jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                  id,                                                  id,
                                                                      joc,
                                                  jcop,                                                  jcop,
                                                  true,  
                                                  jcimClass);                                                  jcimClass);
  
             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 jcopRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i);                      jobject jcopRet = env->GetObjectArrayElement(jAr,i);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
Line 1222 
Line 1894 
             break;             break;
         }         }
  
         case METHOD_UNKNOWN:          case METHOD_INSTANCEPROVIDER2:
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: 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);
  
     STAT_COPYDISPATCHER              CIMClass cls;
  
     return(response);              try
 }              {
                  DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl));
                  AutoMutex lock (pr._cimomMutex);
  
 Message * JMPIProviderManager::handleCreateInstanceRequest(const Message * message) throw()                 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)
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleCreateInstanceRequest");                 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);
   
               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,
                                                    jcop,
                                                    true,
                                                    jcimClass);
   
               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_UNKNOWN:
           {
               DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: should not be here!"<<PEGASUS_STD(endl));
               break;
           }
           }
       }
       HandlerCatch(handler);
   
       if (env) JMPIjvm::detachThread();
   
       PEG_METHOD_EXIT();
   
       STAT_COPYDISPATCHER
   
       return(response);
   }
   
   Message * JMPIProviderManager::handleCreateInstanceRequest(const Message * message) throw()
   {
       PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleCreateInstanceRequest");
  
     HandlerIntro(CreateInstance,message,request,response,handler,CIMObjectPath());     HandlerIntro(CreateInstance,message,request,response,handler,CIMObjectPath());
  
     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 1273 
Line 2094 
             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 1295 
Line 2109 
  
         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;
  
         // public abstract org.pegasus.jmpi.CIMObjectPath createInstance (org.pegasus.jmpi.CIMObjectPath cop,          getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
   
           if (interfaceType == "JMPI")
           {
              // public org.pegasus.jmpi.CIMObjectPath createInstance (org.pegasus.jmpi.CIMObjectPath cop,
         //                                                                org.pegasus.jmpi.CIMInstance   cimInstance)         //                                                                org.pegasus.jmpi.CIMInstance   cimInstance)
         //        throws org.pegasus.jmpi.CIMException         //        throws org.pegasus.jmpi.CIMException
         id = env->GetMethodID((jclass)pr.jProviderClass,         id = env->GetMethodID((jclass)pr.jProviderClass,
Line 1310 
Line 2143 
  
         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 1335 
Line 2237 
  
             jobject jcopRet = env->CallObjectMethod((jobject)pr.jProvider,             jobject jcopRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                     id,                                                     id,
                                                       joc,
                                                     jcop,                                                     jcop,
                                                     jci);                                                     jci);
  
Line 1342 
Line 2245 
  
             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 1380 
Line 2290 
  
     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 1408 
Line 2319 
         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 1424 
Line 2329 
         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 1445 
Line 2368 
  
         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 1464 
Line 2387 
  
             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 1490 
Line 2446 
  
             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;
   
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          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 1513 
Line 2476 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               jobjectArray jPropertyList = getList(jv,env,request->propertyList);
   
             env->CallVoidMethod((jobject)pr.jProvider,             env->CallVoidMethod((jobject)pr.jProvider,
                                 id,                                 id,
                                 jcop,                                 jcop,
                                 jci);                                  jci,
                                   JMPI_INCLUDE_QUALIFIERS,
                                   jPropertyList);
   
               JMPIjvm::checkException(env);
   
               STAT_PMS_PROVIDEREND;
               break;
           }
   
           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->modifiedInstance);
               jint         jciRef = DEBUG_ConvertCToJava (CIMInstance*, jint, ci);
               jobject      jci    = env->NewObject(jv->CIMInstanceClassRef,jv->CIMInstanceNewI,jciRef);
   
               JMPIjvm::checkException(env);
   
               env->CallVoidMethod((jobject)pr.jProvider,
                                   id,
                                   jcop,
                                   jci);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 1550 
Line 2541 
  
     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 1575 
Line 2567 
             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 1596 
Line 2582 
  
         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 1610 
Line 2615 
  
         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 1659 
Line 2723 
  
     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 1684 
Line 2750 
             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 1705 
Line 2772 
  
         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 1723 
Line 2809 
  
         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 1742 
Line 2828 
  
             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 1766 
Line 2900 
             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 1815 
Line 2964 
             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 1825 
Line 2977 
             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 1842 
Line 3009 
  
             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 1876 
Line 3049 
             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);
  
     STAT_COPYDISPATCHER              jstring jqueryLanguage = env->NewStringUTF(request->queryLanguage.getCString());
               jstring jquery         = env->NewStringUTF(request->query.getCString());
  
     return(response);              CIMClass cls;
 }  
  
 Message * JMPIProviderManager::handleAssociatorsRequest(const Message * message) throw()              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 jVec = (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 (jVec) {
                   for (int i=0,m=env->GetArrayLength(jVec); i<m; i++) {
                       JMPIjvm::checkException(env);
  
         JvmVector *jv = 0;                      jobject jciRet = env->GetObjectArrayElement(jVec,i);
  
         env = JMPIjvm::attachThread(&jv);                      JMPIjvm::checkException(env);
  
         JMPIProvider::pm_service_op_lock op_lock(&pr);                      jint         jciRetRef = env->CallIntMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst);
                       CIMInstance *ciRet     = DEBUG_ConvertJavaToC (jint, CIMInstance*, jciRetRef);
  
         STAT_GETSTARTTIME;                      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);
   
           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 1971 
Line 3327 
         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 1994 
Line 3399 
             //             //
             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 2040 
Line 3458 
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                   id,                                                                   id,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                     jPathName,
                                                                   jResultClass,                                                                   jResultClass,
                                                                   jRole,                                                                   jRole,
                                                                   jResultRole,                                                                   jResultRole,
                                                                   false,                                                                    JMPI_INCLUDE_QUALIFIERS,
                                                                   false,                                                                    request->includeClassOrigin,
                                                                   jPropertyList);                                                                   jPropertyList);
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
Line 2065 
Line 3484 
                     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 2087 
Line 3521 
             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 2109 
Line 3546 
  
 #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 2119 
Line 3555 
  
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                  id,                                                                  id,
                                                                     joc,
                                                                  jAssociationName,                                                                  jAssociationName,
                                                                  jPathName,                                                                  jPathName,
                                                                  jResultClass,                                                                  jResultClass,
Line 2132 
Line 3569 
  
             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->GetArrayLength(jVec); i<m; i++) {
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i);                      jobject jciRet = env->GetObjectArrayElement(jVec,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());
                          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 2165 
Line 3627 
             break;             break;
         }         }
  
         case METHOD_UNKNOWN:          case METHOD_ASSOCIATORPROVIDER2:
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: 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    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: 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->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);
   
                       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);
   
                       JMPIjvm::checkException(env);
   
                       iop.setNameSpace(op.getNameSpace());
                       ciRet->setPath(iop);
   
                       handler.deliver(*ciRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_UNKNOWN:
           {
               DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: should not be here!"<<PEGASUS_STD(endl));
               break;
           }
           }
       }
       HandlerCatch(handler);
   
       if (env) JMPIjvm::detachThread();
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
Line 2191 
Line 3852 
  
     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 2220 
Line 3883 
             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 2241 
Line 3898 
  
         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 2256 
Line 3932 
         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 2317 
Line 4047 
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                   id,                                                                   id,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                     jPathName,
                                                                   jResultClass,                                                                   jResultClass,
                                                                   jRole,                                                                   jRole,
                                                                   jResultRole);                                                                   jResultRole);
Line 2346 
Line 4077 
             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 2366 
Line 4099 
  
 #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));
Line 2374 
Line 4106 
  
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                   id,                                                                   id,
                                                                     joc,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                   jPathName,                                                                   jPathName,
                                                                   jResultClass,                                                                   jResultClass,
Line 2384 
Line 4117 
  
             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->GetArrayLength(jVec); i<m; i++) {
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jobject jcopRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i);                      jobject jcopRet = env->GetObjectArrayElement(jVec,i);
   
                       JMPIjvm::checkException(env);
   
                       jint           jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst);
                       CIMObjectPath *copRet     = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRet);
   
                       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);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
Line 2431 
Line 4300 
  
     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 2460 
Line 4331 
             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 2481 
Line 4353 
  
         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;
  
         // public abstract java.util.Vector references (org.pegasus.jmpi.CIMObjectPath assocName,          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,         //                                              org.pegasus.jmpi.CIMObjectPath pathName,
         //                                              java.lang.String               role,         //                                              java.lang.String               role,
         //                                              boolean                        includeQualifiers,         //                                              boolean                        includeQualifiers,
Line 2497 
Line 4388 
         id = env->GetMethodID((jclass)pr.jProviderClass,         id = env->GetMethodID((jclass)pr.jProviderClass,
                               "references",                               "references",
                               "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;");                               "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;");
 //@BUG was:                   "(Lorg/pegasus/jmpi/CIMObjectPath;                                Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;"  
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_ASSOCIATORPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_ASSOCIATORPROVIDER."<<PEGASUS_STD(endl));
              }
   
              if (id == NULL)
              {
                  env->ExceptionClear();
   
                  // public org.pegasus.jmpi.CIMInstance[] references (org.pegasus.jmpi.CIMObjectPath assocName,
                  //                                                   org.pegasus.jmpi.CIMObjectPath pathName,
                  //                                                   java.lang.String               role,
                  //                                                   boolean                        includeQualifiers,
                  //                                                   boolean                        includeClassOrigin,
                  //                                                   java.lang.String[]             propertyList)
                  //        throws org.pegasus.jmpi.CIMException
                  id = env->GetMethodID((jclass)pr.jProviderClass,
                                        "references",
                                        "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMInstance;");
   
                  if (id != NULL)
                  {
                      eMethodFound = METHOD_CIMASSOCIATORPROVIDER;
                      DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_CIMASSOCIATORPROVIDER."<<PEGASUS_STD(endl));
                  }
              }
           }
           else if (interfaceType == "JMPIExperimental")
           {
              // public java.util.Vector references (org.pegasus.jmpi.OperationContext oc,
              //                                     org.pegasus.jmpi.CIMObjectPath    assocName,
              //                                     org.pegasus.jmpi.CIMObjectPath    pathName,
              //                                     java.lang.String                  role,
              //                                     boolean                           includeQualifiers,
              //                                     boolean                           includeClassOrigin,
              //                                     java.lang.String[]                propertyList)
              //        throws org.pegasus.jmpi.CIMException
              id = env->GetMethodID((jclass)pr.jProviderClass,
                                    "references",
                                    " (Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;");
   
              if (id != NULL)
              {
                  eMethodFound = METHOD_ASSOCIATORPROVIDER2;
                  DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_ASSOCIATORPROVIDER2."<<PEGASUS_STD(endl));
         }         }
  
         if (id == NULL)         if (id == NULL)
         {         {
             env->ExceptionClear();             env->ExceptionClear();
  
             // public abstract java.util.Vector references (org.pegasus.jmpi.CIMObjectPath assocName,                 // public org.pegasus.jmpi.CIMInstance[] references (org.pegasus.jmpi.OperationContext oc,
                  //                                                   org.pegasus.jmpi.CIMObjectPath    assocName,
                  //                                                   org.pegasus.jmpi.CIMObjectPath    pathName,
             //                                              java.lang.String               role,             //                                              java.lang.String               role,
             //                                              boolean                        includeQualifiers,             //                                              boolean                        includeQualifiers,
             //                                              boolean                        includeClassOrigin,             //                                              boolean                        includeClassOrigin,
Line 2517 
Line 4451 
             //        throws org.pegasus.jmpi.CIMException             //        throws org.pegasus.jmpi.CIMException
             id = env->GetMethodID((jclass)pr.jProviderClass,             id = env->GetMethodID((jclass)pr.jProviderClass,
                                   "references",                                   "references",
                                   "(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;");                                       "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMInstance;");
 //@BUG was:                       "(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMInstance;"  
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_PEGASUS_24;                     eMethodFound = METHOD_CIMASSOCIATORPROVIDER2;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_CIMASSOCIATORPROVIDER2."<<PEGASUS_STD(endl));
                  }
             }             }
         }         }
  
         if (id == NULL)         if (id == NULL)
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found no method!"<<PEGASUS_STD(endl));             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found no method!"<<PEGASUS_STD(endl));
   
               PEG_METHOD_EXIT();
   
               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, 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 2559 
Line 4506 
             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 2582 
Line 4530 
                     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::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 2604 
Line 4567 
             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, 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 2624 
Line 4590 
  
 #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 2632 
Line 4597 
  
             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 2643 
Line 4609 
  
             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->GetArrayLength(jVec); i<m; i++) {
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i);                      jobject jciRet = env->GetObjectArrayElement(jVec,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());
                          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 2676 
Line 4667 
             break;             break;
         }         }
  
         case METHOD_UNKNOWN:          case METHOD_ASSOCIATORPROVIDER:
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: should not be here!"<<PEGASUS_STD(endl));              jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, resultPath);
             break;              jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);
         }  
         }  
     }  
     HandlerCatch(handler);  
  
     if (env) JMPIjvm::detachThread();              JMPIjvm::checkException(env);
  
     PEG_METHOD_EXIT();              jint    jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, objectPath);
               jobject jPathName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jPathNameRef);
  
     STAT_COPYDISPATCHER              JMPIjvm::checkException(env);
  
     return(response);              jstring jRole = env->NewStringUTF(request->role.getCString());
 }  
  
 Message * JMPIProviderManager::handleReferenceNamesRequest(const Message * message) throw()              JMPIjvm::checkException(env);
 {  
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleReferenceNamesRequest");  
  
     HandlerIntro(ReferenceNames,message,request,response,handler,Array<CIMObjectPath>());              jobjectArray jPropertyList = getList(jv,env,request->propertyList);
  
     typedef enum {  #ifdef PEGASUS_DEBUG
        METHOD_UNKNOWN = 0,              DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: assocName          = "<<resultPath->toString ()<<PEGASUS_STD(endl));
        METHOD_PEGASUS_24,              DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: pathName           = "<<objectPath->toString ()<<PEGASUS_STD(endl));
        METHOD_SNIA_PROVIDER20,              DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: role               = "<<request->role<<PEGASUS_STD(endl));
     } METHOD_VERSION;              DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeQualifiers  = "<<false<<PEGASUS_STD(endl));
     METHOD_VERSION   eMethodFound  = METHOD_UNKNOWN;              DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));
     JNIEnv          *env           = NULL;  #endif
  
     try {              jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
         Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,                                                                    id,
             "JMPIProviderManager::handleReferenceNamesRequest - Host name: $0  Name space: $1  Class name: $2",                                                                    jAssociationName,
             System::getHostName(),                                                                    jPathName,
             request->nameSpace.getString(),                                                                    jRole,
             request->objectName.getClassName().getString());                                                                    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::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_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);
               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: pathName           = "<<objectPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: role               = "<<request->role<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeQualifiers  = "<<false<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl));
   #endif
   
               jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     joc,
                                                                     jAssociationName,
                                                                     jPathName,
                                                                     jRole,
                                                                     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);
                       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_UNKNOWN:
           {
               DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: should not be here!"<<PEGASUS_STD(endl));
               break;
           }
           }
       }
       HandlerCatch(handler);
   
       if (env) JMPIjvm::detachThread();
   
       PEG_METHOD_EXIT();
   
       STAT_COPYDISPATCHER
   
       return(response);
   }
   
   Message * JMPIProviderManager::handleReferenceNamesRequest(const Message * message) throw()
   {
       PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleReferenceNamesRequest");
   
       HandlerIntro(ReferenceNames,message,request,response,handler,Array<CIMObjectPath>());
   
       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::handleReferenceNamesRequest - Host name: $0  Name space: $1  Class name: $2",
               System::getHostName(),
               request->nameSpace.getString(),
               request->objectName.getClassName().getString());
  
         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", classname = "<<request->objectName.getClassName().getString()<<PEGASUS_STD(endl));         DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", classname = "<<request->objectName.getClassName().getString()<<PEGASUS_STD(endl));
  
Line 2731 
Line 4909 
             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 2751 
Line 4923 
  
         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;
  
         // public abstract java.util.Vector referenceNames (org.pegasus.jmpi.CIMObjectPath assocName,          getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME),
                             interfaceType,
                             interfaceVersion);
   
           if (interfaceType == "JMPI")
           {
              // public java.util.Vector referenceNames (org.pegasus.jmpi.CIMObjectPath assocName,
         //                                                  org.pegasus.jmpi.CIMObjectPath pathName,         //                                                  org.pegasus.jmpi.CIMObjectPath pathName,
         //                                                  java.lang.String               role)         //                                                  java.lang.String               role)
         //        throws org.pegasus.jmpi.CIMException         //        throws org.pegasus.jmpi.CIMException
         id = env->GetMethodID((jclass)pr.jProviderClass,         id = env->GetMethodID((jclass)pr.jProviderClass,
                               "referenceNames",                               "referenceNames",
                               "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)Ljava/util/Vector;");                               "(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)Ljava/util/Vector;");
 //@BUG was:                   "(Lorg/pegasus/jmpi/CIMObjectPath;                                Ljava/lang/String;)Ljava/util/Vector;"  
  
         if (id != NULL)         if (id != NULL)
         {         {
             eMethodFound = METHOD_SNIA_PROVIDER20;                 eMethodFound = METHOD_ASSOCIATORPROVIDER;
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found METHOD_SNIA_PROVIDER20."<<PEGASUS_STD(endl));                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found METHOD_ASSOCIATORPROVIDER."<<PEGASUS_STD(endl));
         }         }
  
         if (id == NULL)         if (id == NULL)
         {         {
             env->ExceptionClear();             env->ExceptionClear();
  
             // public abstract java.util.Vector referenceNames (org.pegasus.jmpi.CIMObjectPath assocName,                 // public org.pegasus.jmpi.CIMObjectPath[] referenceNames (org.pegasus.jmpi.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)             //                                                  java.lang.String               role)
             //        throws org.pegasus.jmpi.CIMException             //        throws org.pegasus.jmpi.CIMException
             id = env->GetMethodID((jclass)pr.jProviderClass,             id = env->GetMethodID((jclass)pr.jProviderClass,
                                   "referenceNames",                                   "referenceNames",
                                   "(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)Ljava/util/Vector;");                                       "(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMObjectPath;");
 //@BUG was:                       "(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMObjectPath;"  
  
             if (id != NULL)             if (id != NULL)
             {             {
                 eMethodFound = METHOD_PEGASUS_24;                     eMethodFound = METHOD_CIMASSOCIATORPROVIDER2;
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));                     DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found METHOD_CIMASSOCIATORPROVIDER2."<<PEGASUS_STD(endl));
                  }
             }             }
         }         }
  
         if (id == NULL)         if (id == NULL)
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found no method!"<<PEGASUS_STD(endl));             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found no method!"<<PEGASUS_STD(endl));
   
               PEG_METHOD_EXIT();
   
               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, 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 2818 
Line 5059 
  
             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,             jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                   id,                                                                   id,
                                                                     jPathName,
                                                                   jAssociationName,                                                                   jAssociationName,
                                                                   jRole);                                                                   jRole);
  
Line 2847 
Line 5089 
             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, 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 2865 
Line 5110 
  
 #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,                                                                    joc,
                                                                   jPathName,                                                                   jPathName,
                                                                     jAssociationName,
                                                                   jRole);                                                                   jRole);
  
             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->GetArrayLength(jVec); i<m; i++) {
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
                     jobject jcopRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i);                      jobject jcopRet = env->GetObjectArrayElement(jVec,i);
  
                     JMPIjvm::checkException(env);                     JMPIjvm::checkException(env);
  
Line 2901 
Line 5153 
             break;             break;
         }         }
  
         case METHOD_UNKNOWN:          case METHOD_ASSOCIATORPROVIDER:
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: should not be here!"<<PEGASUS_STD(endl));              jint    jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, resultPath);
             break;              jobject jAssociationName    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jAssociationNameRef);
         }  
         }  
     }  
     HandlerCatch(handler);  
  
     if (env) JMPIjvm::detachThread();              JMPIjvm::checkException(env);
  
     PEG_METHOD_EXIT();              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: pathName           = "<<resultPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: role               = "<<request->role<<PEGASUS_STD(endl));
   #endif
   
               jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     jAssociationName,
                                                                     jPathName,
                                                                     jRole);
   
               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);
   
                       JMPIjvm::checkException(env);
   
                       CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRetRef);
   
                       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, 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: pathName           = "<<resultPath->toString ()<<PEGASUS_STD(endl));
               DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: role               = "<<request->role<<PEGASUS_STD(endl));
   #endif
   
               jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider,
                                                                     id,
                                                                     joc,
                                                                     jAssociationName,
                                                                     jPathName,
                                                                     jRole);
   
               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);
   
                       JMPIjvm::checkException(env);
   
                       CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRetRef);
   
                       handler.deliver(*copRet);
                   }
               }
               handler.complete();
               break;
           }
   
           case METHOD_UNKNOWN:
           {
               DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: should not be here!"<<PEGASUS_STD(endl));
               break;
           }
           }
       }
       HandlerCatch(handler);
   
       if (env) JMPIjvm::detachThread();
   
       PEG_METHOD_EXIT();
  
     STAT_COPYDISPATCHER     STAT_COPYDISPATCHER
  
Line 2927 
Line 5298 
  
     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 2952 
Line 5324 
             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 2973 
Line 5339 
  
         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 2990 
Line 5375 
  
         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);             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 3045 
Line 5457 
             break;             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);
               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,
                                                        joc,
                                                        jcop,
                                                        joclass,
                                                        jpName);
   
               JMPIjvm::checkException(env);
   
               STAT_PMS_PROVIDEREND;
   
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
   
               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_UNKNOWN:         case METHOD_UNKNOWN:
         {         {
             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetPropertyRequest: should not be here!"<<PEGASUS_STD(endl));             DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetPropertyRequest: should not be here!"<<PEGASUS_STD(endl));
Line 3071 
Line 5536 
  
     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 3096 
Line 5562 
             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 3117 
Line 5577 
  
         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 3135 
Line 5614 
  
         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 3176 
Line 5725 
  
             env->CallVoidMethod ((jobject)pr.jProvider,             env->CallVoidMethod ((jobject)pr.jProvider,
                                  id,                                  id,
                                    joc,
                                  jcop,                                  jcop,
                                  joclass,                                  joclass,
                                  jpName,                                  jpName,
Line 3183 
Line 5733 
  
             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 3213 
Line 5770 
  
     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 3239 
Line 5798 
             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 3259 
Line 5812 
  
         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 3276 
Line 5848 
  
         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)
              {
                  env->ExceptionClear();
   
                  // public org.pegasus.jmpi.CIMValue invokeMethod (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/CIMObjectPath;Ljava/lang/String;[Lorg/pegasus/jmpi/CIMArgument;[Lorg/pegasus/jmpi/CIMArgument;)Lorg/pegasus/jmpi/CIMValue;");
   
                  if (id != NULL)
                  {
                      eMethodFound = METHOD_CIMMETHODPROVIDER;
                      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);
   
           switch (eMethodFound)
           {
           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);
         }         }
  
         if (id == NULL)              jobjectArray jArOut=(jobjectArray)env->NewObjectArray(24,jv->CIMArgumentClassRef,NULL);
         {  
             env->ExceptionClear();              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);
               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,
                                                         joc,
                                                         jcop,
                                                         jMethod,
                                                         jArIn,
                                                         jArOut);
               JMPIjvm::checkException(env);
   
               STAT_PMS_PROVIDEREND;
   
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
   
               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);
  
             // public org.pegasus.jmpi.CIMValue invokeMethod (org.pegasus.jmpi.CIMObjectPath op,                  JMPIjvm::checkException(env);
             //                                                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/CIMObjectPath;Ljava/lang/String;[Lorg/pegasus/jmpi/CIMArgument;[Lorg/pegasus/jmpi/CIMArgument;)Lorg/pegasus/jmpi/CIMValue;");  
  
             if (id != NULL)                  handler.deliverParamValue(*p);
             {  
                 eMethodFound = METHOD_PEGASUS_24;  
                 DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleInvokeMethodRequest: found METHOD_PEGASUS_24."<<PEGASUS_STD(endl));  
             }  
         }         }
  
         JMPIjvm::checkException(env);              handler.complete();
               break;
           }
  
         switch (eMethodFound)          case METHOD_METHODPROVIDER:
         {  
         case METHOD_PEGASUS_24:  
         {         {
             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 3315 
Line 6075 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             Uint32 m=request->inParameters.size();              jobject jVecIn = env->NewObject(jv->VectorClassRef,jv->VectorNew);
  
             jobjectArray jArIn=(jobjectArray)env->NewObjectArray(m,jv->CIMArgumentClassRef,NULL);              JMPIjvm::checkException(env);
  
             for (Uint32 i=0; i<m; i++) {              for (int i=0,m=request->inParameters.size(); i<m; i++)
               CIMParamValue *parm    = new CIMParamValue(request->inParameters[i]);              {
               jint           jArgRef = DEBUG_ConvertCToJava (CIMParamValue*, jint, parm);                  const CIMParamValue &parm  = request->inParameters[i];
               jobject        jArg    = env->NewObject(jv->CIMArgumentClassRef,jv->CIMArgumentNewI,jArgRef);                  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->SetObjectArrayElement(jArIn,i,jArg);                  env->CallVoidMethod(jVecIn,jv->VectorAddElement,jp);
             }             }
  
             jobjectArray jArOut=(jobjectArray)env->NewObjectArray(24,jv->CIMArgumentClassRef,NULL);              jobject jVecOut=env->NewObject(jv->VectorClassRef,jv->VectorNew);
               JMPIjvm::checkException(env);
  
             jobject jValueRet = env->CallObjectMethod((jobject)pr.jProvider,             jobject jValueRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                       id,                                                       id,
                                                       jcop,                                                       jcop,
                                                       jMethod,                                                       jMethod,
                                                       jArIn,                                                        jVecIn,
                                                       jArOut);                                                        jVecOut);
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
             STAT_PMS_PROVIDEREND;             STAT_PMS_PROVIDEREND;
Line 3346 
Line 6110 
  
             handler.deliver(*valueRet);             handler.deliver(*valueRet);
  
             for (int i=0; i<24; i++) {              for (int i=0,m=env->CallIntMethod(jVecOut,JMPIjvm::jv.VectorSize); i<m; i++)
                 jobject jArg = env->GetObjectArrayElement(jArOut,i);              {
   
                 JMPIjvm::checkException(env);                 JMPIjvm::checkException(env);
  
                 if (jArg==NULL)                  jobject jProp = env->CallObjectMethod(jVecOut,JMPIjvm::jv.VectorElementAt,i);
                    break;  
  
                 jint           jpRef = env->CallIntMethod(jArg,JMPIjvm::jv.CIMArgumentCInst);                  JMPIjvm::checkException(env);
                 CIMParamValue *p     = DEBUG_ConvertJavaToC (jint, CIMParamValue*, jpRef);  
                   jint         jpRef = env->CallIntMethod(jProp,JMPIjvm::jv.CIMPropertyCInst);
                   CIMProperty *p     = DEBUG_ConvertJavaToC (jint, CIMProperty*, jpRef);
  
                 JMPIjvm::checkException(env);                 JMPIjvm::checkException(env);
  
                 handler.deliverParamValue(*p);                  handler.deliverParamValue(CIMParamValue(p->getName().getString(),p->getValue()));
             }             }
  
             handler.complete();             handler.complete();
             break;             break;
         }         }
  
         case METHOD_SNIA_PROVIDER20:          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 3397 
Line 6164 
  
             jobject jValueRet = env->CallObjectMethod((jobject)pr.jProvider,             jobject jValueRet = env->CallObjectMethod((jobject)pr.jProvider,
                                                       id,                                                       id,
                                                         joc,
                                                       jcop,                                                       jcop,
                                                       jMethod,                                                       jMethod,
                                                       jVecIn,                                                       jVecIn,
Line 3405 
Line 6173 
  
             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 3469 
Line 6244 
  
     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;
Line 3498 
Line 6274 
         String fileName = resolveFileName(providerLocation);         String fileName = resolveFileName(providerLocation);
  
         // get cached or load new provider module         // get cached or load new provider module
         JMPIProvider::OpProviderHolder ph =          JMPIProvider::OpProviderHolder ph = providerManager.getProvider (fileName, providerName,
             providerManager.getProvider(fileName, providerName, String::EMPTY);                                                                           String::EMPTY);
  
         indProvRecord *prec = NULL;         indProvRecord *prec = NULL;
  
Line 3537 
Line 6313 
         context->insert(request->operationContext.get(AcceptLanguageListContainer::NAME));         context->insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
         context->insert(request->operationContext.get(ContentLanguageListContainer::NAME));         context->insert(request->operationContext.get(ContentLanguageListContainer::NAME));
         context->insert(request->operationContext.get(SubscriptionInstanceContainer::NAME));         context->insert(request->operationContext.get(SubscriptionInstanceContainer::NAME));
         context->insert(request->operationContext.get(SubscriptionLanguageListContainer::NAME));  
         context->insert(request->operationContext.get(SubscriptionFilterConditionContainer::NAME));         context->insert(request->operationContext.get(SubscriptionFilterConditionContainer::NAME));
  
         CIMObjectPath subscriptionName = request->subscriptionInstance.getPath();         CIMObjectPath subscriptionName = request->subscriptionInstance.getPath();
Line 3590 
Line 6365 
  
         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 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 3607 
Line 6401 
  
         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);
               jobject jSel    = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jSelRef);
   
               JMPIjvm::checkException(env);
   
               jint    jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, &eSelx->classNames[0]);
               jobject jcop    = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef);
   
               JMPIjvm::checkException(env);
   
               jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString());
   
               JMPIjvm::checkException(env);
   
               env->CallVoidMethod((jobject)pr.jProvider,
                                   id,
                                   jSel,
                                   jType,
                                   jcop,
                                   (jboolean)0);
   
               JMPIjvm::checkException(env);
   
               //
               //  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;
                       CIMRequestMessage * request = 0;
                       CIMResponseMessage * response = 0;
                       prec->handler = new EnableIndicationsResponseHandler (
                           request,
                           response,
                           req_provider,
                           _indicationCallback,
                           _responseChunkCallback);
                   }
               }
   
               STAT_PMS_PROVIDEREND;
               break;
           }
   
           case METHOD_EVENTPROVIDER2:
         {         {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
             jint    jSelRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx);             jint    jSelRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx);
             jobject jSel    = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jSelRef);             jobject jSel    = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jSelRef);
  
Line 3633 
Line 6515 
  
             env->CallVoidMethod((jobject)pr.jProvider,             env->CallVoidMethod((jobject)pr.jProvider,
                                 id,                                 id,
                                   joc,
                                 jSel,                                 jSel,
                                 jType,                                 jType,
                                 jcop,                                 jcop,
Line 3640 
Line 6523 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
   
             //             //
             //  Increment count of current subscriptions for this provider             //  Increment count of current subscriptions for this provider
             //             //
Line 3655 
Line 6545 
                     prec->enabled = true;                     prec->enabled = true;
                     CIMRequestMessage * request = 0;                     CIMRequestMessage * request = 0;
                     CIMResponseMessage * response = 0;                     CIMResponseMessage * response = 0;
                     prec->handler = new EnableIndicationsResponseHandler                      prec->handler = new EnableIndicationsResponseHandler(
                         (request, response, req_provider, _indicationCallback);                          request,
                           response,
                           req_provider,
                           _indicationCallback,
                           _responseChunkCallback);
                 }                 }
             }             }
  
Line 3689 
Line 6583 
  
     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;
Line 3717 
Line 6612 
         String fileName = resolveFileName(providerLocation);         String fileName = resolveFileName(providerLocation);
  
         // get cached or load new provider module         // get cached or load new provider module
         JMPIProvider::OpProviderHolder ph =          JMPIProvider::OpProviderHolder ph = providerManager.getProvider (fileName, providerName,
             providerManager.getProvider(fileName, providerName, String::EMPTY);                                                                           String::EMPTY);
  
         indProvRecord *prec = NULL;         indProvRecord *prec = NULL;
  
Line 3740 
Line 6635 
  
         selxTab.remove(sPathString);         selxTab.remove(sPathString);
  
         // 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));  
         context.insert(request->operationContext.get(SubscriptionInstanceContainer::NAME));  
         context.insert(request->operationContext.get(SubscriptionLanguageListContainer::NAME));  
   
         CIMObjectPath subscriptionName = request->subscriptionInstance.getPath();         CIMObjectPath subscriptionName = request->subscriptionInstance.getPath();
  
         JMPIProvider & pr=ph.GetProvider();         JMPIProvider & pr=ph.GetProvider();
Line 3761 
Line 6647 
  
         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 3778 
Line 6683 
  
         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/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);
               jobject jSel = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jObj);
   
               JMPIjvm::checkException(env);
   
               jObj = DEBUG_ConvertCToJava (CIMObjectPath*, jint, &eSelx->classNames[0]);
   
               jobject jRef = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jObj);
   
               JMPIjvm::checkException(env);
   
               jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString());
   
               JMPIjvm::checkException(env);
   
               env->CallVoidMethod((jobject)pr.jProvider,
                                   id,
                                   jSel,
                                   jType,
                                   jRef,
                                   (jboolean)(prec==NULL));
   
               JMPIjvm::checkException(env);
   
               //
               //  Decrement count of current subscriptions for this provider
               //
               if (ph.GetProvider ().decrementSubscriptionsAndTestIfZero ())
               {
                   //
                   //  If there are no current subscriptions after the decrement,
                   //  the last subscription has been deleted
                   //  Call the provider's disableIndications method
                   //
                   if (_subscriptionInitComplete)
                   {
                       prec->enabled = false;
                       if (prec->handler) delete prec->handler;
                       prec->handler = NULL;
                   }
               }
   
               STAT_PMS_PROVIDEREND;
   
               delete eSelx;
               delete qContext;
               delete srec;
               break;
           }
   
           case METHOD_EVENTPROVIDER2:
         {         {
               jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
               jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
   
             jint    jObj = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx);             jint    jObj = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx);
             jobject jSel = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jObj);             jobject jSel = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jObj);
  
Line 3805 
Line 6797 
  
             env->CallVoidMethod((jobject)pr.jProvider,             env->CallVoidMethod((jobject)pr.jProvider,
                                 id,                                 id,
                                   joc,
                                 jSel,                                 jSel,
                                 jType,                                 jType,
                                 jRef,                                 jRef,
Line 3812 
Line 6805 
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
               if (joc)
               {
                  env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate);
   
                  JMPIjvm::checkException(env);
               }
   
             //             //
             //  Decrement count of current subscriptions for this provider             //  Decrement count of current subscriptions for this provider
             //             //
Line 3984 
Line 6984 
            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 4047 
Line 7047 
                 prec->enabled = true;                 prec->enabled = true;
                 CIMRequestMessage * request = 0;                 CIMRequestMessage * request = 0;
                 CIMResponseMessage * response = 0;                 CIMResponseMessage * response = 0;
                 prec->handler = new EnableIndicationsResponseHandler                  prec->handler = new EnableIndicationsResponseHandler(
                     (request, response, provider, _indicationCallback);                      request,
                       response,
                       provider,
                       _indicationCallback,
                       _responseChunkCallback);
             }             }
         }         }
         catch (CIMException & e)         catch (CIMException & e)


Legend:
Removed from v.1.33  
changed lines
  Added in v.1.41.2.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2