version 1.59.4.2, 2007/07/07 01:35:43
|
version 1.68, 2008/01/30 12:06:31
|
|
|
//============================================================================== | //============================================================================== |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
// NOCHKSRC |
|
|
|
#include "JMPIProviderManager.h" | #include "JMPIProviderManager.h" |
| |
#include "JMPIImpl.h" | #include "JMPIImpl.h" |
|
|
#define DDD(x) | #define DDD(x) |
#endif | #endif |
| |
// request->localOnly is replaced with JMPI_LOCALONLY for getInstance () and enumerateInstances () |
// request->localOnly is replaced with JMPI_LOCALONLY for |
|
// getInstance () and enumerateInstances () |
#define JMPI_LOCALONLY false | #define JMPI_LOCALONLY false |
| |
/* Fix for 4092 */ | /* Fix for 4092 */ |
// request->includeQualifiers is replaced with JMPI_INCLUDE_QUALIFIERS for getInstance (), |
// request->includeQualifiers is replaced with JMPI_INCLUDE_QUALIFIERS |
// setInstance (), enumerateInstances (), associators (), and references () |
// for getInstance (), setInstance (), enumerateInstances (), associators () |
|
// and references () |
#define JMPI_INCLUDE_QUALIFIERS false | #define JMPI_INCLUDE_QUALIFIERS false |
| |
#include "Convert.h" | #include "Convert.h" |
| |
void JMPIProviderManager::debugPrintMethodPointers (JNIEnv *env, jclass jc) | void JMPIProviderManager::debugPrintMethodPointers (JNIEnv *env, jclass jc) |
{ | { |
// cd ${PEGAUSE_HOME}/src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/tests/JMPI_TestPropertyTypes |
|
// javap -s -p JMPI_TestPropertyTypes |
|
static const char *methodNames[][3] = { | static const char *methodNames[][3] = { |
// CIMProvider | // CIMProvider |
// cimom-2003-11-24/org/snia/wbem/provider/CIMProvider.java |
{"snia 2.0", |
// src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/CIMProvider.java |
"initialize", |
{"snia 2.0","initialize","(Lorg/pegasus/jmpi/CIMOMHandle;)V"}, |
"(Lorg/pegasus/jmpi/CIMOMHandle;)V"}, |
{"snia 2.0","cleanup","()V"}, |
{"snia 2.0", |
|
"cleanup", |
|
"()V"}, |
// InstanceProvider | // InstanceProvider |
// cimom-2003-11-24/org/snia/wbem/provider/InstanceProvider.java |
{"snia 2.0", |
// src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/CIMInstanceProvider.java |
"enumInstances", |
{"snia 2.0","enumInstances","(Lorg/pegasus/jmpi/CIMObjectPath;ZLorg/pegasus/jmpi/CIMClass;Z)Ljava/util/Vector;"}, |
"(Lorg/pegasus/jmpi/CIMObjectPath;ZLorg/pegasus/jmpi/CIMClass;" |
{"pegasus 2.4","enumInstances","(Lorg/pegasus/jmpi/CIMObjectPath;ZZZ[Ljava/lang/String;Lorg/pegasus/jmpi/CIMClass;)[Lorg/pegasus/jmpi/CIMInstance;"}, |
"Z)Ljava/util/Vector;"}, |
|
{"pegasus 2.4", |
|
"enumInstances", |
|
"(Lorg/pegasus/jmpi/CIMObjectPath;ZZZ[Ljava/lang/String;" |
|
"Lorg/pegasus/jmpi/CIMClass;)[Lorg/pegasus/jmpi/CIMInstance;"}, |
/* Begin Fix for 4189 */ | /* Begin Fix for 4189 */ |
{"pegasus 2.5","enumerateInstances","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;ZZ[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;"}, |
/* End Fix for 4189 */ | /* End Fix for 4189 */ |
{"snia 2.0","enumInstances","(Lorg/pegasus/jmpi/CIMObjectPath;ZLorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;"}, |
{"snia 2.0", |
{"pegasus 2.4","enumerateInstanceNames","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;)[Lorg/pegasus/jmpi/CIMObjectPath;"}, |
"enumInstances", |
{"pegasus 2.5","enumerateInstanceNames","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;"}, |
"(Lorg/pegasus/jmpi/CIMObjectPath;ZLorg/pegasus/jmpi/CIMClass;)" |
{"snia 2.0","getInstance","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;Z)Lorg/pegasus/jmpi/CIMInstance;"}, |
"Ljava/util/Vector;"}, |
{"pegasus 2.4","getInstance","(Lorg/pegasus/jmpi/CIMObjectPath;ZZZ[Ljava/lang/String;Lorg/pegasus/jmpi/CIMClass;)Lorg/pegasus/jmpi/CIMInstance;"}, |
{"pegasus 2.4", |
|
"enumerateInstanceNames", |
|
"(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;)" |
|
"[Lorg/pegasus/jmpi/CIMObjectPath;"}, |
|
{"pegasus 2.5", |
|
"enumerateInstanceNames", |
|
"(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;)" |
|
"Ljava/util/Vector;"}, |
|
{"snia 2.0", |
|
"getInstance", |
|
"(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;Z)" |
|
"Lorg/pegasus/jmpi/CIMInstance;"}, |
|
{"pegasus 2.4", |
|
"getInstance", |
|
"(Lorg/pegasus/jmpi/CIMObjectPath;ZZZ[Ljava/lang/String;" |
|
"Lorg/pegasus/jmpi/CIMClass;)Lorg/pegasus/jmpi/CIMInstance;"}, |
/* Begin Fix for 4238 */ | /* Begin Fix for 4238 */ |
{"pegasus 2.5","getInstance","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;ZZ[Ljava/lang/String;)Lorg/pegasus/jmpi/CIMInstance;"}, |
{"pegasus 2.5", |
|
"getInstance", |
|
"(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;" |
|
"ZZ[Ljava/lang/String;)Lorg/pegasus/jmpi/CIMInstance;"}, |
/* End Fix for 4238 */ | /* End Fix for 4238 */ |
{"snia 2.0","createInstance","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMInstance;)Lorg/pegasus/jmpi/CIMObjectPath;"}, |
{"snia 2.0", |
{"snia 2.0","setInstance","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMInstance;)V"}, |
"createInstance", |
{"pegasus 2.4","setInstance","(Lorg/pegasus/jmpi/CIMObjectPath;Z[Ljava/lang/String)V"}, |
"(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMInstance;)" |
{"snia 2.0","deleteInstance","(Lorg/pegasus/jmpi/CIMObjectPath;)V"}, |
"Lorg/pegasus/jmpi/CIMObjectPath;"}, |
{"snia 2.0","execQuery","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ILorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;"}, |
{"snia 2.0", |
{"pegasus 2.4","execQuery","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Lorg/pegasus/jmpi/CIMClass;)[Lorg/pegasus/jmpi/CIMInstance;"}, |
"setInstance", |
{"pegasus 2.5","execQuery","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector;"}, |
"(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 |
{"snia 2.0", |
// src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/CIMMethodProvider.java |
"invokeMethod", |
{"snia 2.0","invokeMethod","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/util/Vector;Ljava/util/Vector;)Lorg/pegasus/jmpi/CIMValue;"}, |
"(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;" |
{"pegasus 2.4","invokeMethod","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;[Lorg/pegasus/jmpi/CIMArgument;[Lorg/pegasus/jmpi/CIMArgument;)Lorg/pegasus/jmpi/CIMValue;"}, |
"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 |
{"snia 2.0", |
// src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/PropertyProvider.java |
"getPropertyValue", |
{"snia 2.0","getPropertyValue","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;)Lorg/pegasus/jmpi/CIMValue;"}, |
"(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;)" |
{"snia 2.0","setPropertyValue","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Lorg/pegasus/jmpi/CIMValue;)V"}, |
"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 |
{"snia 2.0", |
// src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/AssociatorProvider.java |
"associators", |
{"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;"}, |
"(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;" |
{"pegasus 2.4","associators","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;"}, |
"Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;" |
{"snia 2.0","associatorNames","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector;"}, |
"ZZ[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;"}, |
{"pegasus 2.4", |
{"snia 2.0","references","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;"}, |
"associators", |
{"pegasus 2.4","references","(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;"}, |
"(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;" |
{"snia 2.0","referenceNames","(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)Ljava/util/Vector;"}, |
"Ljava/lang/String;ZZ[Ljava/lang/String;)Ljava/util/Vector;"}, |
{"pegasus 2.4","referenceNames","(Lorg/pegasus/jmpi/CIMObjectPath;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 |
|
// EventProvider | // EventProvider |
// cimom-2003-11-24/org/snia/wbem/provider20/EventProvider.java |
{"snia 2.0", |
// src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/EventProvider.java |
"activateFilter", |
{"snia 2.0","activateFilter","(Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;Lorg/pegasus/jmpi/CIMObjectPath;Z)V"}, |
"(Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;" |
{"snia 2.0","deActivateFilter","(Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;Lorg/pegasus/jmpi/CIMObjectPath;Z)V"}, |
"Lorg/pegasus/jmpi/CIMObjectPath;Z)V"}, |
|
{"snia 2.0", |
|
"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 |
|
// ProviderAdapter | // ProviderAdapter |
// cimom-2003-11-24/org/snia/wbem/provider20/ProviderAdapter.java |
|
// JMPI_TestPropertyTypes | // JMPI_TestPropertyTypes |
{"JMPI_TestPropertyTypes","findObjectPath","(Lorg/pegasus/jmpi/CIMObjectPath;)I"}, |
{"JMPI_TestPropertyTypes", |
{"JMPI_TestPropertyTypes","testPropertyTypesValue","(Lorg/pegasus/jmpi/CIMInstance;)V"} |
"findObjectPath", |
|
"(Lorg/pegasus/jmpi/CIMObjectPath;)I"}, |
|
{"JMPI_TestPropertyTypes", |
|
"testPropertyTypesValue", |
|
"(Lorg/pegasus/jmpi/CIMInstance;)V"} |
}; | }; |
| |
if (!env) | if (!env) |
{ | { |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::debugPrintMethodPointers: env is NULL!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::debugPrintMethodPointers:" |
|
" env is NULL!"<<endl); |
return; | return; |
} | } |
if (!jc) | if (!jc) |
{ | { |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::debugPrintMethodPointers: jc is NULL!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::debugPrintMethodPointers: " |
|
"jc is NULL!"<<endl); |
return; | return; |
} | } |
| |
for (int i = 0; i < (int)(sizeof (methodNames)/sizeof (methodNames[0])); i++) | for (int i = 0; i < (int)(sizeof (methodNames)/sizeof (methodNames[0])); i++) |
{ | { |
jmethodID id = env->GetMethodID(jc,methodNames[i][1], methodNames[i][2]); | jmethodID id = env->GetMethodID(jc,methodNames[i][1], methodNames[i][2]); |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::debugPrintMethodPointers: "<<methodNames[i][0]<<", "<<methodNames[i][1]<<", id = "<<PEGASUS_STD(hex)<<(long)id<<PEGASUS_STD(dec)<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::debugPrintMethodPointers: " |
|
<<methodNames[i][0]<<", "<<methodNames[i][1]<<", id = " |
|
<<hex<<(long)id<<dec<<endl); |
env->ExceptionClear(); | env->ExceptionClear(); |
} | } |
| |
|
|
{ | { |
jclass jInstClass = env->GetObjectClass(jInst); | jclass jInstClass = env->GetObjectClass(jInst); |
jclass jInstSuperClass = env->GetSuperclass(jInstClass); | jclass jInstSuperClass = env->GetSuperclass(jInstClass); |
jmethodID jmidGetDeclaredMethods = env->GetMethodID(jInstClass, "getDeclaredMethods", "()[Ljava/lang/reflect/Method;"); |
jmethodID jmidGetDeclaredMethods = env->GetMethodID( |
|
jInstClass, |
|
"getDeclaredMethods", |
|
"()[Ljava/lang/reflect/Method;"); |
| |
if (!jmidGetDeclaredMethods) | if (!jmidGetDeclaredMethods) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
jmidGetDeclaredMethods = env->GetMethodID(jInstSuperClass, "getDeclaredMethods", "()[Ljava/lang/reflect/Method;"); |
jmidGetDeclaredMethods = env->GetMethodID( |
|
jInstSuperClass, |
|
"getDeclaredMethods", |
|
"()[Ljava/lang/reflect/Method;"); |
} | } |
| |
if (jmidGetDeclaredMethods) | if (jmidGetDeclaredMethods) |
{ | { |
jobjectArray jarrayDeclaredMethods = (jobjectArray)env->CallObjectMethod(jInstClass, |
jobjectArray jarrayDeclaredMethods = (jobjectArray)env->CallObjectMethod( |
|
jInstClass, |
jmidGetDeclaredMethods); | jmidGetDeclaredMethods); |
| |
if (jarrayDeclaredMethods) | if (jarrayDeclaredMethods) |
{ | { |
for (int i = 0, iLen = env->GetArrayLength (jarrayDeclaredMethods); i < iLen; i++) |
for (int i=0,iLen=env->GetArrayLength(jarrayDeclaredMethods); |
|
i < iLen; |
|
i++) |
{ | { |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jDeclaredMethod = env->GetObjectArrayElement (jarrayDeclaredMethods, i); |
jobject jDeclaredMethod = env->GetObjectArrayElement( |
|
jarrayDeclaredMethods, |
|
i); |
jclass jDeclaredMethodClass = env->GetObjectClass (jDeclaredMethod); | jclass jDeclaredMethodClass = env->GetObjectClass (jDeclaredMethod); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jmethodID jmidToString = env->GetMethodID (jDeclaredMethodClass, "toString", "()Ljava/lang/String;"); |
jmethodID jmidToString = env->GetMethodID( |
jstring jstringResult = (jstring)env->CallObjectMethod (jDeclaredMethod, jmidToString); |
jDeclaredMethodClass, |
|
"toString", |
|
"()Ljava/lang/String;"); |
|
jstring jstringResult = (jstring)env->CallObjectMethod( |
|
jDeclaredMethod, |
|
jmidToString); |
const char *pszResult = env->GetStringUTFChars(jstringResult, 0); | const char *pszResult = env->GetStringUTFChars(jstringResult, 0); |
| |
PEGASUS_STD(cout)<<"--- JMPIProviderManager::debugIntrospectJavaObject: "<<pszResult<<PEGASUS_STD(endl); |
cout<<"--- JMPIProviderManager::debugIntrospectJavaObject: " |
|
<<pszResult<<endl; |
| |
env->ReleaseStringUTFChars (jstringResult, pszResult); | env->ReleaseStringUTFChars (jstringResult, pszResult); |
} | } |
|
|
{ | { |
jclass jInstClass = env->GetObjectClass(jInst); | jclass jInstClass = env->GetObjectClass(jInst); |
jclass jInstSuperClass = env->GetSuperclass(jInstClass); | jclass jInstSuperClass = env->GetSuperclass(jInstClass); |
jmethodID jmidToString1 = env->GetMethodID(jInstClass, "toString", "()Ljava/lang/String;"); |
jmethodID jmidToString1 = env->GetMethodID( |
jmethodID jmidToString2 = env->GetMethodID(jInstSuperClass, "toString", "()Ljava/lang/String;"); |
jInstClass, |
|
"toString", |
|
"()Ljava/lang/String;"); |
|
jmethodID jmidToString2 = env->GetMethodID( |
|
jInstSuperClass, |
|
"toString", |
|
"()Ljava/lang/String;"); |
if (!jmidToString1 || !jmidToString2) | if (!jmidToString1 || !jmidToString2) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
return; | return; |
} | } |
jstring jstringResult1 = (jstring)env->CallObjectMethod(jInstClass, jmidToString1); |
jstring jstringResult1 = (jstring)env->CallObjectMethod( |
jstring jstringResult2 = (jstring)env->CallObjectMethod(jInstSuperClass, jmidToString2); |
jInstClass, |
jstring jstringResult3 = (jstring)env->CallObjectMethod(jInst, jmidToString1); |
jmidToString1); |
|
jstring jstringResult2 = (jstring)env->CallObjectMethod( |
|
jInstSuperClass, |
|
jmidToString2); |
|
jstring jstringResult3 = (jstring)env->CallObjectMethod( |
|
jInst, |
|
jmidToString1); |
const char *pszResult1 = env->GetStringUTFChars(jstringResult1, 0); | const char *pszResult1 = env->GetStringUTFChars(jstringResult1, 0); |
const char *pszResult2 = env->GetStringUTFChars(jstringResult2, 0); | const char *pszResult2 = env->GetStringUTFChars(jstringResult2, 0); |
const char *pszResult3 = env->GetStringUTFChars(jstringResult3, 0); | const char *pszResult3 = env->GetStringUTFChars(jstringResult3, 0); |
| |
jmethodID jmidCInst = env->GetMethodID(env->GetObjectClass(jInst),JMPIjvm::jv.instanceMethodNames[22].methodName, JMPIjvm::jv.instanceMethodNames[22].signature); |
jmethodID jmidCInst = env->GetMethodID( |
|
env->GetObjectClass(jInst), |
PEGASUS_STD(cout)<<"--- JMPIProviderManager::debugIntrospectJavaObject: jInstClass = "<<jInstClass<<", jInstSuperClass = "<<jInstSuperClass<<", jClassShouldBe = "<<JMPIjvm::jv.classRefs[18]<<", jmidCInst = "<<jmidCInst<<PEGASUS_STD(endl); |
JMPIjvm::jv.instanceMethodNames[22].methodName, |
PEGASUS_STD(cout)<<"pszResult1 = "<<pszResult1<<PEGASUS_STD(endl); |
JMPIjvm::jv.instanceMethodNames[22].signature); |
PEGASUS_STD(cout)<<"pszResult2 = "<<pszResult2<<PEGASUS_STD(endl); |
|
PEGASUS_STD(cout)<<"pszResult3 = "<<pszResult3<<PEGASUS_STD(endl); |
cout<<"--- JMPIProviderManager::debugIntrospectJavaObject: jInstClass = " |
|
<<jInstClass<<", jInstSuperClass = "<<jInstSuperClass |
|
<<", jClassShouldBe = "<<JMPIjvm::jv.classRefs[18]<<", jmidCInst = " |
|
<<jmidCInst<<endl; |
|
cout<<"pszResult1 = "<<pszResult1<<endl; |
|
cout<<"pszResult2 = "<<pszResult2<<endl; |
|
cout<<"pszResult3 = "<<pszResult3<<endl; |
| |
env->ReleaseStringUTFChars (jstringResult1, pszResult1); | env->ReleaseStringUTFChars (jstringResult1, pszResult1); |
env->ReleaseStringUTFChars (jstringResult2, pszResult2); | env->ReleaseStringUTFChars (jstringResult2, pszResult2); |
|
|
env->ExceptionClear(); | env->ExceptionClear(); |
} | } |
| |
bool JMPIProviderManager::getInterfaceType (ProviderIdContainer pidc, |
bool JMPIProviderManager::getInterfaceType( |
|
ProviderIdContainer pidc, |
String& interfaceType, | String& interfaceType, |
String& interfaceVersion) | String& interfaceVersion) |
{ | { |
///CIMInstance ciProvider = pidc.getProvider (); |
|
CIMInstance ciProviderModule = pidc.getModule (); | CIMInstance ciProviderModule = pidc.getModule (); |
Uint32 idx; | Uint32 idx; |
bool fRet = true; | 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"); | idx = ciProviderModule.findProperty ("InterfaceType"); |
| |
if (idx != PEG_NOT_FOUND) | if (idx != PEG_NOT_FOUND) |
|
|
| |
itValue.get (interfaceType); | itValue.get (interfaceType); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::getInterfaceType: interfaceType = "<<interfaceType<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::getInterfaceType: interfaceType = " |
|
<<interfaceType<<endl); |
} | } |
else | else |
{ | { |
|
|
| |
itValue.get (interfaceVersion); | itValue.get (interfaceVersion); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::getInterfaceType: interfaceVersion = "<<interfaceVersion<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::getInterfaceType: interfaceVersion = " |
|
<<interfaceVersion<<endl); |
} | } |
else | else |
{ | { |
|
|
return false; | return false; |
} | } |
| |
jInterfaces = (jobjectArray)env->CallObjectMethod (env->GetObjectClass (jObject), |
jInterfaces = (jobjectArray)env->CallObjectMethod( |
|
env->GetObjectClass (jObject), |
JMPIjvm::jv.ClassGetInterfaces); | JMPIjvm::jv.ClassGetInterfaces); |
| |
if (!jInterfaces) | if (!jInterfaces) |
|
|
| |
if (jInterface) | if (jInterface) |
{ | { |
jstring jInterfaceName = (jstring)env->CallObjectMethod (jInterface, |
jstring jInterfaceName = (jstring)env->CallObjectMethod( |
|
jInterface, |
JMPIjvm::jv.ClassGetName); | JMPIjvm::jv.ClassGetName); |
| |
if (jInterfaceName) | if (jInterfaceName) |
{ | { |
const char *pszInterfaceName = env->GetStringUTFChars (jInterfaceName, |
const char *pszInterfaceName = env->GetStringUTFChars( |
|
jInterfaceName, |
0); | 0); |
String interfaceName = pszInterfaceName; | String interfaceName = pszInterfaceName; |
| |
|
|
Boolean JMPIProviderManager::insertProvider(const ProviderName & name, | Boolean JMPIProviderManager::insertProvider(const ProviderName & name, |
const String &ns, const String &cn) | const String &ns, const String &cn) |
{ | { |
String key(ns+String("::")+cn+String("::")+CIMValue(name.getCapabilitiesMask()).toString()); |
String key(ns + String("::") + cn); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::insertProvider: "<<key<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::insertProvider: "<<key<<endl); |
| |
Boolean ret = false; | Boolean ret = false; |
| |
|
|
| |
Message * JMPIProviderManager::processMessage(Message * request) throw() | Message * JMPIProviderManager::processMessage(Message * request) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "JMPIProviderManager::processMessage()"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::processMessage()"); |
| |
Message * response = 0; | Message * response = 0; |
| |
|
|
response = handleStopAllProvidersRequest(request); | response = handleStopAllProvidersRequest(request); |
break; | break; |
| |
case CIM_INITIALIZE_PROVIDER_REQUEST_MESSAGE: |
|
response = handleInitializeProviderRequest(request); |
|
break; |
|
|
|
case CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE: | case CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE: |
response = handleSubscriptionInitCompleteRequest (request); | response = handleSubscriptionInitCompleteRequest (request); |
break; | break; |
| |
default: | default: |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL2, |
PEG_TRACE((TRC_PROVIDERMANAGER, Tracer::LEVEL2, |
"*** Unsupported Request "+request->getType()); |
"*** Unsupported Request %d", |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::processMessage: Unsupported request "<<request->getType ()<<PEGASUS_STD(endl)); |
request->getType() |
|
)); |
|
DDD(cout<<"--- JMPIProviderManager::processMessage:" |
|
" Unsupported request "<<request->getType ()<<endl); |
| |
response = handleUnsupportedRequest(request); | response = handleUnsupportedRequest(request); |
break; | break; |
|
|
| |
#define HandlerIntroBase(type,type1,message,request,response,handler) \ | #define HandlerIntroBase(type,type1,message,request,response,handler) \ |
CIM##type##RequestMessage * request = \ | CIM##type##RequestMessage * request = \ |
dynamic_cast<CIM##type##RequestMessage *>(const_cast<Message *>(message)); \ |
dynamic_cast<CIM##type##RequestMessage *>(const_cast<Message *> \ |
|
(message)); \ |
PEGASUS_ASSERT(request != 0); \ | PEGASUS_ASSERT(request != 0); \ |
CIM##type##ResponseMessage * response = \ | CIM##type##ResponseMessage * response = \ |
dynamic_cast<CIM##type##ResponseMessage*>(request->buildResponse()); \ | dynamic_cast<CIM##type##ResponseMessage*>(request->buildResponse()); \ |
|
|
catch(CIMException & e) \ | catch(CIMException & e) \ |
{ PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, \ | { PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, \ |
"Exception: " + e.getMessage()); \ | "Exception: " + e.getMessage()); \ |
handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); \ |
handler.setStatus(e.getCode(), e.getContentLanguages(), \ |
|
e.getMessage()); \ |
} \ | } \ |
catch(Exception & e) \ | catch(Exception & e) \ |
{ PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, \ | { PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, \ |
"Exception: " + e.getMessage()); \ | "Exception: " + e.getMessage()); \ |
handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); \ |
handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), \ |
|
e.getMessage()); \ |
} \ | } \ |
catch(...) \ | catch(...) \ |
{ PEG_TRACE_CSTRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, \ | { PEG_TRACE_CSTRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, \ |
|
|
return pl; | return pl; |
} | } |
| |
Message * JMPIProviderManager::handleGetInstanceRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleGetInstanceRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleGetInstanceRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleGetInstanceRequest"); |
| |
HandlerIntro(GetInstance,message,request,response,handler); | HandlerIntro(GetInstance,message,request,response,handler); |
| |
|
|
METHOD_VERSION eMethodFound = METHOD_UNKNOWN; | METHOD_VERSION eMethodFound = METHOD_UNKNOWN; |
JNIEnv *env = NULL; | JNIEnv *env = NULL; |
| |
try { |
try |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
{ |
"JMPIProviderManager::handleGetInstanceRequest - Host name: $0 Name space: $1 Class name: $2", |
Logger::put( |
|
Logger::STANDARD_LOG, |
|
System::CIMSERVER, |
|
Logger::TRACE, |
|
"JMPIProviderManager::handleGetInstanceRequest - Host name: $0 " |
|
"Name space: $1 Class name: $2", |
System::getHostName(), | System::getHostName(), |
request->nameSpace.getString(), | request->nameSpace.getString(), |
request->instanceName.getClassName().getString()); | request->instanceName.getClassName().getString()); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstanceRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", classname = "<<request->instanceName.getClassName().getString()<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleGetInstanceRequest: " |
|
"hostname = "<<System::getHostName()<<", namespace = " |
|
<<request->nameSpace.getString()<<", classname = " |
|
<<request->instanceName.getClassName().getString()<<endl); |
| |
// make target object path | // make target object path |
CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(), |
CIMObjectPath *objectPath = new CIMObjectPath( |
|
System::getHostName(), |
request->nameSpace, | request->nameSpace, |
request->instanceName.getClassName(), | request->instanceName.getClassName(), |
request->instanceName.getKeyBindings()); | request->instanceName.getKeyBindings()); |
|
|
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 = providerManager.getProvider (name.getPhysicalName(), |
JMPIProvider::OpProviderHolder ph = providerManager.getProvider( |
|
name.getPhysicalName(), |
name.getLogicalName()); | name.getLogicalName()); |
OperationContext context; | OperationContext context; |
| |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert( |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
request->operationContext.get(IdentityContainer::NAME)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
context.insert( |
|
request->operationContext.get(AcceptLanguageListContainer::NAME)); |
|
context.insert( |
|
request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
// forward request | // forward request |
JMPIProvider &pr=ph.GetProvider(); | JMPIProvider &pr=ph.GetProvider(); |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.getInstance: " + pr.getName()); |
PEG_TRACE_STRING( |
|
TRC_PROVIDERMANAGER, |
|
Tracer::LEVEL4, |
|
"Calling provider.getInstance: " + pr.getName()); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstanceRequest: Calling provider getInstance: "<<pr.getName()<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleGetInstanceRequest: " |
|
"Calling provider getInstance: "<<pr.getName()<<endl); |
| |
JvmVector *jv = 0; | JvmVector *jv = 0; |
| |
|
|
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED", |
CIM_ERR_FAILED, |
"Could not initialize the JVM (Java Virtual Machine) runtime environment.")); |
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); |
| |
jmethodID id = NULL; | jmethodID id = NULL; |
String interfaceType; | String interfaceType; |
String interfaceVersion; | String interfaceVersion; |
| |
getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME), |
getInterfaceType( |
|
request->operationContext.get(ProviderIdContainer::NAME), |
interfaceType, | interfaceType, |
interfaceVersion); | interfaceVersion); |
| |
if (interfaceType == "JMPI") | if (interfaceType == "JMPI") |
{ | { |
// public org.pegasus.jmpi.CIMInstance getInstance (org.pegasus.jmpi.CIMObjectPath cop, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMClass cimClass, |
(jclass)pr.jProviderClass, |
// boolean localOnly) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"getInstance", | "getInstance", |
"(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;Z)Lorg/pegasus/jmpi/CIMInstance;"); |
"(Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Lorg/pegasus/jmpi/CIMClass;Z)" |
|
"Lorg/pegasus/jmpi/CIMInstance;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_INSTANCEPROVIDER; | eMethodFound = METHOD_INSTANCEPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstanceRequest: found METHOD_INSTANCEPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleGetInstanceRequest: " |
|
"found METHOD_INSTANCEPROVIDER."<<endl); |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
| |
// public org.pegasus.jmpi.CIMInstance getInstance (org.pegasus.jmpi.CIMObjectPath op, |
id = env->GetMethodID( |
// boolean localOnly, |
(jclass)pr.jProviderClass, |
// boolean includeQualifiers, |
|
// boolean includeClassOrigin, |
|
// java.lang.String[] propertyList, |
|
// org.pegasus.jmpi.CIMClass cc) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"getInstance", | "getInstance", |
"(Lorg/pegasus/jmpi/CIMObjectPath;ZZZ[Ljava/lang/String;Lorg/pegasus/jmpi/CIMClass;)Lorg/pegasus/jmpi/CIMInstance;"); |
"(Lorg/pegasus/jmpi/CIMObjectPath;ZZZ[" |
|
"Ljava/lang/String;Lorg/pegasus/jmpi/CIMClass;)" |
|
"Lorg/pegasus/jmpi/CIMInstance;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_CIMINSTANCEPROVIDER; | eMethodFound = METHOD_CIMINSTANCEPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstanceRequest: found METHOD_CIMINSTANCEPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleGetInstanceRequest" |
|
": found METHOD_CIMINSTANCEPROVIDER."<<endl); |
} | } |
} | } |
} | } |
else if (interfaceType == "JMPIExperimental") | else if (interfaceType == "JMPIExperimental") |
{ | { |
/* Fix for 4238 */ |
id = env->GetMethodID( |
// public org.pegasus.jmpi.CIMInstance getInstance (org.pegasus.jmpi.OperationContext oc |
(jclass)pr.jProviderClass, |
// 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", | "getInstance", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;ZZ[Ljava/lang/String;)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_INSTANCEPROVIDER2; | eMethodFound = METHOD_INSTANCEPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstanceRequest: found METHOD_INSTANCEPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleGetInstanceRequest: " |
|
"found METHOD_INSTANCEPROVIDER2."<<endl); |
} | } |
/* Fix for 4238 */ | /* Fix for 4238 */ |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstanceRequest: No method found!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleGetInstanceRequest: " |
|
"No method found!"<<endl); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, | throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND", |
MessageLoaderParms( |
"Could not find a method for the provider based on InterfaceType.")); |
"ProviderManager.JMPI.JMPIProviderManager.METHOD_NOT_FOUND", |
|
"Could not find a method for the provider based on " |
|
"InterfaceType.")); |
} | } |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
|
|
case METHOD_CIMINSTANCEPROVIDER: | case METHOD_CIMINSTANCEPROVIDER: |
{ | { |
jlong jopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); | jlong jopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jobject jop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jopRef); |
jobject jop=env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->instanceName.getClassName()<<PEGASUS_STD(endl)); |
DDD(cout<<"enter: cimom_handle->getClass("<<__LINE__<<") " |
|
<<request->instanceName.getClassName()<<endl); |
|
|
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, |
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)); |
|
|
DDD (cout<<"exit: cimom_handle->getClass("<<__LINE__<<") " |
|
<<request->instanceName.getClassName()<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstanceRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleGetInstanceRequest: " |
|
"Error: Caught CIMExcetion during " |
|
"cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); |
jlong jcimClassRef = DEBUG_ConvertCToJava( |
jobject jcimClass = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcimClassRef); |
CIMClass*, |
|
jlong, |
|
pcls); |
|
jobject jcimClass = env->NewObject( |
|
jv->CIMClassClassRef, |
|
jv->CIMClassNewJ, |
|
jcimClassRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
handler.processing(); | handler.processing(); |
| |
if (jciRet) { | if (jciRet) { |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
|
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
| |
handler.deliver(*ciRet); | handler.deliver(*ciRet); |
} | } |
|
|
/* Fix for 4238 */ | /* Fix for 4238 */ |
case METHOD_INSTANCEPROVIDER2: | case METHOD_INSTANCEPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
&request->operationContext); |
jobject jop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jopRef); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jopRef = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->instanceName.getClassName()<<PEGASUS_STD(endl)); |
DDD (cout<<"enter: cimom_handle->getClass("<<__LINE__ |
|
<<") "<<request->instanceName.getClassName()<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, |
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)); |
DDD (cout<<"exit: cimom_handle->getClass("<<__LINE__ |
|
<<") "<<request->instanceName.getClassName()<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstanceRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::handleGetInstanceRequest: " |
|
"Error: Caught CIMExcetion during " |
|
"cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); | jlong jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); |
jobject jcimClass = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcimClassRef); |
jobject jcimClass = env->NewObject( |
|
jv->CIMClassClassRef, |
|
jv->CIMClassNewJ, |
|
jcimClassRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobject jciRet = env->CallObjectMethod((jobject)pr.jProvider, |
jobject jciRet = env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jop, | jop, |
|
|
| |
if (joc) | if (joc) |
{ | { |
env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate); |
env->CallVoidMethod( |
|
joc, |
|
JMPIjvm::jv.OperationContextUnassociate); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
} | } |
|
|
handler.processing(); | handler.processing(); |
| |
if (jciRet) { | if (jciRet) { |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
|
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
| |
handler.deliver(*ciRet); | handler.deliver(*ciRet); |
} | } |
|
|
| |
case METHOD_INSTANCEPROVIDER: | case METHOD_INSTANCEPROVIDER: |
{ | { |
jlong jopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jopRef = DEBUG_ConvertCToJava( |
jobject jop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jopRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ,jopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->instanceName.getClassName()<<PEGASUS_STD(endl)); |
DDD (cout<<"enter: cimom_handle->getClass("<<__LINE__<<") " |
|
<<request->instanceName.getClassName()<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, |
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)); |
DDD (cout<<"exit: cimom_handle->getClass("<<__LINE__ |
|
<<") "<<request->instanceName.getClassName()<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstancesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleGetInstancesRequest: " |
|
"Error: Caught CIMExcetion during " |
|
"cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); | jlong jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); |
jobject jcimClass = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcimClassRef); |
jobject jcimClass = env->NewObject( |
|
jv->CIMClassClassRef, |
|
jv->CIMClassNewJ, |
|
jcimClassRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
handler.processing(); | handler.processing(); |
| |
if (jciRet) { | if (jciRet) { |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
|
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
| |
handler.deliver(*ciRet); | handler.deliver(*ciRet); |
} | } |
|
|
| |
case METHOD_UNKNOWN: | case METHOD_UNKNOWN: |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetInstanceRequest: should not be here!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleGetInstanceRequest: " |
|
"should not be here!"<<endl); |
break; | break; |
} | } |
} | } |
|
|
return(response); | return(response); |
} | } |
| |
Message * JMPIProviderManager::handleEnumerateInstancesRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleEnumerateInstancesRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleEnumerateInstanceRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleEnumerateInstanceRequest"); |
| |
HandlerIntro(EnumerateInstances,message,request,response,handler); | HandlerIntro(EnumerateInstances,message,request,response,handler); |
| |
|
|
METHOD_VERSION eMethodFound = METHOD_UNKNOWN; | METHOD_VERSION eMethodFound = METHOD_UNKNOWN; |
JNIEnv *env = NULL; | JNIEnv *env = NULL; |
| |
try { |
try |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
{ |
"JMPIProviderManager::handleEnumerateInstancesRequest - Host name: $0 Name space: $1 Class name: $2", |
Logger::put( |
|
Logger::STANDARD_LOG, |
|
System::CIMSERVER, |
|
Logger::TRACE, |
|
"JMPIProviderManager::handleEnumerateInstancesRequest - Host name: $0" |
|
" Name space: $1 Class name: $2", |
System::getHostName(), | System::getHostName(), |
request->nameSpace.getString(), | request->nameSpace.getString(), |
request->className.getString()); | request->className.getString()); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", classname = "<<request->className.getString()<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: " |
|
"hostname = "<<System::getHostName()<<", namespace = " |
|
<<request->nameSpace.getString()<<", classname = " |
|
<<request->className.getString()<<endl); |
| |
// make target object path | // make target object path |
CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(), | CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(), |
|
|
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 = providerManager.getProvider (name.getPhysicalName(), |
JMPIProvider::OpProviderHolder ph = providerManager.getProvider( |
|
name.getPhysicalName(), |
name.getLogicalName(), | name.getLogicalName(), |
String::EMPTY); | String::EMPTY); |
| |
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert( |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
request->operationContext.get(IdentityContainer::NAME)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
context.insert( |
|
request->operationContext.get(AcceptLanguageListContainer::NAME)); |
|
context.insert( |
|
request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
// forward request | // forward request |
JMPIProvider &pr = ph.GetProvider(); | JMPIProvider &pr = ph.GetProvider(); |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.enumerateInstances: " + pr.getName()); |
PEG_TRACE_STRING( |
|
TRC_PROVIDERMANAGER, |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: Calling provider enumerateInstances: "<<pr.getName()<<PEGASUS_STD(endl)); |
Tracer::LEVEL4, |
|
"Calling provider.enumerateInstances: " + pr.getName()); |
|
|
|
DDD(cout<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: " |
|
"Calling provider enumerateInstances: " |
|
<<pr.getName()<<endl); |
| |
JvmVector *jv = 0; | JvmVector *jv = 0; |
| |
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, | throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED", |
MessageLoaderParms( |
"Could not initialize the JVM (Java Virtual Machine) runtime environment.")); |
"ProviderManager.JMPI.JMPIProviderManager.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); |
|
|
String interfaceType; | String interfaceType; |
String interfaceVersion; | String interfaceVersion; |
| |
getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME), |
getInterfaceType( |
|
request->operationContext.get (ProviderIdContainer::NAME), |
interfaceType, | interfaceType, |
interfaceVersion); | interfaceVersion); |
| |
if (interfaceType == "JMPI") | if (interfaceType == "JMPI") |
{ | { |
// public abstract java.util.Vector enumInstances (org.pegasus.jmpi.CIMObjectPath cop, |
id = env->GetMethodID( |
// boolean deep, |
(jclass)pr.jProviderClass, |
// org.pegasus.jmpi.CIMClass cimClass, |
|
// boolean localOnly) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"enumInstances", | "enumInstances", |
"(Lorg/pegasus/jmpi/CIMObjectPath;ZLorg/pegasus/jmpi/CIMClass;Z)Ljava/util/Vector;"); |
"(Lorg/pegasus/jmpi/CIMObjectPath;Z" |
|
"Lorg/pegasus/jmpi/CIMClass;Z)Ljava/util/Vector;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_INSTANCEPROVIDER; | eMethodFound = METHOD_INSTANCEPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_INSTANCEPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleEnumerateInstances" |
|
"Request: found METHOD_INSTANCEPROVIDER."<<endl); |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
| |
// public org.pegasus.jmpi.CIMInstance[] enumerateInstances (org.pegasus.jmpi.CIMObjectPath cop, |
id = env->GetMethodID( |
// boolean localOnly, |
(jclass)pr.jProviderClass, |
// boolean includeQualifiers, |
|
// boolean includeClassOrigin, |
|
// java.lang.String[] propertyList, |
|
// org.pegasus.jmpi.CIMClass cimClass) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"enumerateInstances", | "enumerateInstances", |
"(Lorg/pegasus/jmpi/CIMObjectPath;ZZZ[Ljava/lang/String;Lorg/pegasus/jmpi/CIMClass;)[Lorg/pegasus/jmpi/CIMInstance;"); |
"(Lorg/pegasus/jmpi/CIMObjectPath;ZZZ[" |
|
"Ljava/lang/String;Lorg/pegasus/jmpi/CIMClass;)[" |
|
"Lorg/pegasus/jmpi/CIMInstance;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_CIMINSTANCEPROVIDER; | eMethodFound = METHOD_CIMINSTANCEPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_CIMINSTANCEPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleEnumerateInstances" |
|
"Request: found METHOD_CIMINSTANCEPROVIDER." |
|
<<endl); |
} | } |
} | } |
} | } |
else if (interfaceType == "JMPIExperimental") | else if (interfaceType == "JMPIExperimental") |
{ | { |
/* Fix for 4189 */ |
id = env->GetMethodID( |
// public abstract java.util.Vector enumerateInstances (org.pegasus.jmpi.OperationContext oc |
(jclass)pr.jProviderClass, |
// 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", | "enumerateInstances", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;ZZ[Ljava/lang/String;)Ljava/util/Vector;"); |
"(Lorg/pegasus/jmpi/OperationContext;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Lorg/pegasus/jmpi/CIMClass;ZZ[Ljava/lang/String;)" |
|
"Ljava/util/Vector;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_INSTANCEPROVIDER2; | eMethodFound = METHOD_INSTANCEPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_INSTANCEPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleEnumerateInstances" |
|
"Request: found METHOD_INSTANCEPROVIDER2." |
|
<<endl); |
} | } |
/* Fix for 4189 */ |
|
|
|
if (id == NULL) | if (id == NULL) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
|
id = env->GetMethodID( |
// public abstract org.pegasus.jmpi.CIMInstance[] enumerateInstances (org.pegasus.jmpi.OperationContext oc |
(jclass)pr.jProviderClass, |
// 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", | "enumerateInstances", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;ZZ[Ljava/lang/String;)[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_CIMINSTANCEPROVIDER2; | eMethodFound = METHOD_CIMINSTANCEPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: found METHOD_CIMINSTANCEPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleEnumerateInstances" |
|
"Request: found METHOD_CIMINSTANCEPROVIDER2." |
|
<<endl); |
} | } |
} | } |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: No method found!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleEnumerateInstancesRequest:" |
|
" No method found!"<<endl); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND", |
CIM_ERR_FAILED, |
"Could not find a method for the provider based on InterfaceType.")); |
MessageLoaderParms( |
|
"ProviderManager.JMPI.METHOD_NOT_FOUND", |
|
"Could not find a method for the provider based on " |
|
"InterfaceType.")); |
} | } |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
|
|
{ | { |
case METHOD_CIMINSTANCEPROVIDER: | case METHOD_CIMINSTANCEPROVIDER: |
{ | { |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jcopRef = DEBUG_ConvertCToJava( |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD (cout<<"enter: cimom_handle->getClass("<<__LINE__<<") " |
|
<<request->className<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD (cout<<"exit: cimom_handle->getClass("<<__LINE__<<") " |
|
<<request->className<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleEnumerateInstances" |
|
"Request: Error: Caught CIMExcetion during " |
|
"cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jccRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); | jlong jccRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); |
jobject jcc = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jccRef); |
jobject jcc = env->NewObject( |
|
jv->CIMClassClassRef, |
|
jv->CIMClassNewJ, |
|
jccRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr = (jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
jcop, | jcop, |
JMPI_LOCALONLY, | JMPI_LOCALONLY, |
|
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
|
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
| |
/* Fix for 4237 */ | /* Fix for 4237 */ |
CIMClass cls; | CIMClass cls; |
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD(cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD (cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleEnumerate" |
|
"InstancesRequest: Error: Caught " |
|
"CIMException during " |
|
"cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
case METHOD_CIMINSTANCEPROVIDER2: | case METHOD_CIMINSTANCEPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
&request->operationContext); |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jcopRef = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD (cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<request->className<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD (cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<request->className<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::" |
|
"handleEnumerateInstancesRequest: Error: Caught " |
|
"CIMExcetion during cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jccRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); | jlong jccRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); |
jobject jcc = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jccRef); |
jobject jcc = env->NewObject( |
|
jv->CIMClassClassRef, |
|
jv->CIMClassNewJ, |
|
jccRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr = (jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jcop, | jcop, |
|
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
|
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
| |
/* Fix for 4237 */ | /* Fix for 4237 */ |
CIMClass cls; | CIMClass cls; |
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD (cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD (cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::" |
|
"handleEnumerateInstancesRequest: Error: " |
|
"Caught CIMExcetion during " |
|
"cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
/* Fix for 4189 */ | /* Fix for 4189 */ |
case METHOD_INSTANCEPROVIDER2: | case METHOD_INSTANCEPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
&request->operationContext); |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jcopRef = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD (cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<request->className<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass (context, | cls = pr._cimom_handle->getClass (context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD (cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<request->className<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::" |
|
"handleEnumerateInstancesRequest: Error: Caught " |
|
"CIMExcetion during cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jccRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); | jlong jccRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); |
jobject jcc = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jccRef); |
jobject jcc = env->NewObject( |
|
jv->CIMClassClassRef, |
|
jv->CIMClassNewJ, |
|
jccRef); |
| |
JMPIjvm::checkException(env); | 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++) |
|
{ |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i); |
jobject jciRet = env->CallObjectMethod( |
|
jVec, |
|
JMPIjvm::jv.VectorElementAt, |
|
i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
|
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
| |
/* Fix for 4237 */ | /* Fix for 4237 */ |
CIMClass cls; | CIMClass cls; |
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD (cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD (cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::" |
|
"handleEnumerateInstancesRequest: Error: " |
|
"Caught CIMExcetion during " |
|
"cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
case METHOD_INSTANCEPROVIDER: | case METHOD_INSTANCEPROVIDER: |
{ | { |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jcopRef = DEBUG_ConvertCToJava( |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD (cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<request->className<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD (cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<request->className<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::" |
|
"handleEnumerateInstancesRequest: Error: Caught " |
|
"CIMExcetion during cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jccRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); | jlong jccRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); |
jobject jcc = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jccRef); |
jobject jcc = env->NewObject( |
|
jv->CIMClassClassRef, |
|
jv->CIMClassNewJ, |
|
jccRef); |
| |
JMPIjvm::checkException(env); | 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++) |
|
{ |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i); |
jobject jciRet = env->CallObjectMethod( |
|
jVec, |
|
JMPIjvm::jv.VectorElementAt, |
|
i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
|
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
| |
/* Fix for 4237 */ | /* Fix for 4237 */ |
CIMClass cls; | CIMClass cls; |
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD (cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD (cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::" |
|
"handleEnumerateInstancesRequest: Error: " |
|
"Caught CIMExcetion during " |
|
"cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
case METHOD_UNKNOWN: | case METHOD_UNKNOWN: |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstancesRequest: should not be here!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleEnumerateInstancesRequest" |
|
": should not be here!"<<endl); |
break; | break; |
} | } |
} | } |
|
|
return(response); | return(response); |
} | } |
| |
Message * JMPIProviderManager::handleEnumerateInstanceNamesRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleEnumerateInstanceNamesRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "JMPIProviderManager::handleEnumerateInstanceNamesRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleEnumerateInstanceNamesRequest"); |
| |
HandlerIntro(EnumerateInstanceNames,message,request,response, handler); | HandlerIntro(EnumerateInstanceNames,message,request,response, handler); |
| |
|
|
JNIEnv *env = NULL; | JNIEnv *env = NULL; |
| |
try { | try { |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
Logger::put( |
"JMPIProviderManager::handleEnumerateInstanceNamesRequest - Host name: $0 Name space: $1 Class name: $2", |
Logger::STANDARD_LOG, |
|
System::CIMSERVER, |
|
Logger::TRACE, |
|
"JMPIProviderManager::handleEnumerateInstanceNamesRequest - " |
|
"Host name: $0 Name space: $1 Class name: $2", |
System::getHostName(), | System::getHostName(), |
request->nameSpace.getString(), | request->nameSpace.getString(), |
request->className.getString()); | request->className.getString()); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", classname = "<<request->className.getString()<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest" |
|
": hostname = " |
|
<<System::getHostName()<<", namespace = " |
|
<<request->nameSpace.getString()<<", classname = " |
|
<<request->className.getString()<<endl); |
| |
// make target object path | // make target object path |
CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(), | CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(), |
|
|
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 = providerManager.getProvider (name.getPhysicalName(), |
JMPIProvider::OpProviderHolder ph = providerManager.getProvider( |
|
name.getPhysicalName(), |
name.getLogicalName()); | name.getLogicalName()); |
| |
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert( |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
request->operationContext.get(IdentityContainer::NAME)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
context.insert( |
|
request->operationContext.get(AcceptLanguageListContainer::NAME)); |
|
context.insert( |
|
request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
JMPIProvider &pr = ph.GetProvider(); | JMPIProvider &pr = ph.GetProvider(); |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.enumerateInstanceNames: " + pr.getName()); |
PEG_TRACE_STRING( |
|
TRC_PROVIDERMANAGER, |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: Calling provider : enumerateInstanceNames: "<<pr.getName()<<PEGASUS_STD(endl)); |
Tracer::LEVEL4, |
|
"Calling provider.enumerateInstanceNames: " + pr.getName()); |
|
|
|
DDD(cout<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest" |
|
": Calling provider : enumerateInstanceNames: " |
|
<<pr.getName()<<endl); |
| |
JvmVector *jv = 0; | JvmVector *jv = 0; |
| |
|
|
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED", |
CIM_ERR_FAILED, |
"Could not initialize the JVM (Java Virtual Machine) runtime environment.")); |
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); |
|
|
String interfaceType; | String interfaceType; |
String interfaceVersion; | String interfaceVersion; |
| |
getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME), |
getInterfaceType( |
|
request->operationContext.get(ProviderIdContainer::NAME), |
interfaceType, | interfaceType, |
interfaceVersion); | interfaceVersion); |
| |
if (interfaceType == "JMPI") | if (interfaceType == "JMPI") |
{ | { |
// public abstract java.util.Vector enumInstances (org.pegasus.jmpi.CIMObjectPath cop, |
id = env->GetMethodID( |
// boolean deep, |
(jclass)pr.jProviderClass, |
// org.pegasus.jmpi.CIMClass cimClass) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"enumInstances", | "enumInstances", |
"(Lorg/pegasus/jmpi/CIMObjectPath;ZLorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;"); |
"(Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"ZLorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_INSTANCEPROVIDER; | eMethodFound = METHOD_INSTANCEPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: found METHOD_INSTANCEPROVIDER."<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::" |
|
"handleEnumerateInstanceNamesRequest: found " |
|
"METHOD_INSTANCEPROVIDER." |
|
<<endl); |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
| |
// public org.pegasus.jmpi.CIMObjectPath[] enumerateInstanceNames (org.pegasus.jmpi.CIMObjectPath op, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMClass cc) |
(jclass)pr.jProviderClass, |
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"enumerateInstanceNames", | "enumerateInstanceNames", |
"(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;)[Lorg/pegasus/jmpi/CIMObjectPath;"); |
"(Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Lorg/pegasus/jmpi/CIMClass;)[" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_CIMINSTANCEPROVIDER; | eMethodFound = METHOD_CIMINSTANCEPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: found METHOD_CIMINSTANCEPROVIDER."<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::" |
|
"handleEnumerateInstanceNamesRequest: found " |
|
"METHOD_CIMINSTANCEPROVIDER." |
|
<<endl); |
} | } |
} | } |
} | } |
else if (interfaceType == "JMPIExperimental") | else if (interfaceType == "JMPIExperimental") |
{ | { |
// public abstract java.util.Vector enumerateInstanceNames (org.pegasus.jmpi.OperationContext oc |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath cop, |
(jclass)pr.jProviderClass, |
// org.pegasus.jmpi.CIMClass cimClass) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"enumerateInstanceNames", | "enumerateInstanceNames", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;"); |
"(Lorg/pegasus/jmpi/OperationContext;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Lorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_INSTANCEPROVIDER2; | eMethodFound = METHOD_INSTANCEPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: found METHOD_INSTANCEPROVIDER2."<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::" |
|
"handleEnumerateInstanceNamesRequest: found " |
|
"METHOD_INSTANCEPROVIDER2." |
|
<<endl); |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
| |
// public abstract org.pegasus.jmpi.CIMObjectPath[] enumerateInstanceNames (org.pegasus.jmpi.OperationContext oc |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath cop, |
(jclass)pr.jProviderClass, |
// org.pegasus.jmpi.CIMClass cimClass) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"enumerateInstanceNames", | "enumerateInstanceNames", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;)[Lorg/pegasus/jmpi/CIMObjectPath;"); |
"(Lorg/pegasus/jmpi/OperationContext;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Lorg/pegasus/jmpi/CIMClass;)" |
|
"[Lorg/pegasus/jmpi/CIMObjectPath;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_CIMINSTANCEPROVIDER2; | eMethodFound = METHOD_CIMINSTANCEPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: found METHOD_CIMINSTANCEPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::" |
|
"handleEnumerateInstanceNamesRequest: found " |
|
"METHOD_CIMINSTANCEPROVIDER2." |
|
<<endl); |
} | } |
} | } |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: No method found!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::" |
|
"handleEnumerateInstanceNamesRequest: No method found!" |
|
<<endl); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND", |
CIM_ERR_FAILED, |
"Could not find a method for the provider based on InterfaceType.")); |
MessageLoaderParms( |
|
"ProviderManager.JMPI.METHOD_NOT_FOUND", |
|
"Could not find a method for the provider based on " |
|
"InterfaceType.")); |
} | } |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
|
|
{ | { |
case METHOD_CIMINSTANCEPROVIDER: | case METHOD_CIMINSTANCEPROVIDER: |
{ | { |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jcopRef = DEBUG_ConvertCToJava( |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD(cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<request->className<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD(cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<request->className<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::" |
|
"handleEnumerateInstanceNamesRequest: Error: " |
|
"Caught CIMExcetion during " |
|
"cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); |
jlong jcimClassRef = DEBUG_ConvertCToJava( |
jobject jcimClass = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcimClassRef); |
CIMClass*, |
|
jlong, |
|
pcls); |
|
jobject jcimClass = env->NewObject( |
|
jv->CIMClassClassRef, |
|
jv->CIMClassNewJ, |
|
jcimClassRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr = (jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
jcop, | jcop, |
jcimClass); | jcimClass); |
|
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst); |
jlong jcopRetRef = env->CallLongMethod( |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef); |
jcopRet, |
|
JMPIjvm::jv.CIMObjectPathCInst); |
|
CIMObjectPath *copRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMObjectPath*, |
|
jcopRetRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_CIMINSTANCEPROVIDER2: | case METHOD_CIMINSTANCEPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
&request->operationContext); |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jcopRef = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD(cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<request->className<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD(cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<request->className<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::" |
|
"handleEnumerateInstanceNamesRequest: Error: " |
|
"Caught CIMExcetion during " |
|
"cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); | jlong jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); |
jobject jcimClass = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcimClassRef); |
jobject jcimClass = env->NewObject( |
|
jv->CIMClassClassRef, |
|
jv->CIMClassNewJ, |
|
jcimClassRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr = (jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jcop, | jcop, |
|
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst); |
jlong jcopRetRef = env->CallLongMethod( |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef); |
jcopRet, |
|
JMPIjvm::jv.CIMObjectPathCInst); |
|
CIMObjectPath *copRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMObjectPath*, |
|
jcopRetRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_INSTANCEPROVIDER2: | case METHOD_INSTANCEPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
&request->operationContext); |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jcopRef = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD(cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<request->className<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD(cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<request->className<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::" |
|
"handleEnumerateInstanceNamesRequest: Error: " |
|
"Caught CIMExcetion during " |
|
"cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); |
jlong jcimClassRef = DEBUG_ConvertCToJava( |
jobject jcimClass = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcimClassRef); |
CIMClass*, |
|
jlong, |
|
pcls); |
|
jobject jcimClass = env->NewObject( |
|
jv->CIMClassClassRef, |
|
jv->CIMClassNewJ, |
|
jcimClassRef); |
| |
JMPIjvm::checkException(env); | 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++) |
|
{ |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jcopRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i); |
jobject jcopRet = env->CallObjectMethod( |
|
jVec, |
|
JMPIjvm::jv.VectorElementAt, |
|
i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst); |
jlong jcopRetRef = env->CallLongMethod( |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef); |
jcopRet, |
|
JMPIjvm::jv.CIMObjectPathCInst); |
|
CIMObjectPath *copRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMObjectPath*, |
|
jcopRetRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_INSTANCEPROVIDER: | case METHOD_INSTANCEPROVIDER: |
{ | { |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jcopRef = DEBUG_ConvertCToJava( |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD(cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<request->className<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD(cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<request->className<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::" |
|
"handleEnumerateInstanceNamesRequest: Error: " |
|
"Caught CIMExcetion during " |
|
"cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jcimClassRef = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); |
jlong jcimClassRef = DEBUG_ConvertCToJava( |
jobject jcimClass = env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcimClassRef); |
CIMClass*, |
|
jlong, |
|
pcls); |
|
jobject jcimClass = env->NewObject( |
|
jv->CIMClassClassRef, |
|
jv->CIMClassNewJ, |
|
jcimClassRef); |
| |
JMPIjvm::checkException(env); | 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++) |
|
{ |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jcopRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i); |
jobject jcopRet = env->CallObjectMethod( |
|
jVec, |
|
JMPIjvm::jv.VectorElementAt, |
|
i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst); |
jlong jcopRetRef = env->CallLongMethod( |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef); |
jcopRet, |
|
JMPIjvm::jv.CIMObjectPathCInst); |
|
CIMObjectPath *copRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMObjectPath*, |
|
jcopRetRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_UNKNOWN: | case METHOD_UNKNOWN: |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleEnumerateInstanceNamesRequest: should not be here!"<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::" |
|
"handleEnumerateInstanceNamesRequest: should not be" |
|
" here!" |
|
<<endl); |
break; | break; |
} | } |
} | } |
|
|
return(response); | return(response); |
} | } |
| |
Message * JMPIProviderManager::handleCreateInstanceRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleCreateInstanceRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleCreateInstanceRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleCreateInstanceRequest"); |
| |
HandlerIntro(CreateInstance,message,request,response,handler); | HandlerIntro(CreateInstance,message,request,response,handler); |
| |
|
|
| |
try { | try { |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, | Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
"JMPIProviderManager::handleCreateInstanceRequest - Host name: $0 Name space: $1 Class name: $2", |
"JMPIProviderManager::handleCreateInstanceRequest - Host name: $0 " |
|
"Name space: $1 Class name: $2", |
System::getHostName(), | System::getHostName(), |
request->nameSpace.getString(), | request->nameSpace.getString(), |
request->newInstance.getPath().getClassName().getString()); | request->newInstance.getPath().getClassName().getString()); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateInstanceRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", classname = "<<request->newInstance.getPath().getClassName().getString()<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleCreateInstanceRequest: " |
|
"hostname = " |
|
<<System::getHostName()<<", namespace = " |
|
<<request->nameSpace.getString()<<", classname = " |
|
<<request->newInstance.getPath().getClassName().getString() |
|
<<endl); |
| |
// make target object path | // make target object path |
CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(), |
CIMObjectPath *objectPath = |
|
new CIMObjectPath( |
|
System::getHostName(), |
request->nameSpace, | request->nameSpace, |
request->newInstance.getPath().getClassName(), | request->newInstance.getPath().getClassName(), |
request->newInstance.getPath().getKeyBindings()); | request->newInstance.getPath().getKeyBindings()); |
|
|
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 = providerManager.getProvider (name.getPhysicalName(), |
JMPIProvider::OpProviderHolder ph = |
|
providerManager.getProvider( |
|
name.getPhysicalName(), |
name.getLogicalName(), | name.getLogicalName(), |
String::EMPTY); | String::EMPTY); |
| |
// forward request | // forward request |
JMPIProvider &pr = ph.GetProvider(); | JMPIProvider &pr = ph.GetProvider(); |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.createInstance: " + ph.GetProvider().getName()); |
PEG_TRACE_STRING( |
|
TRC_PROVIDERMANAGER, |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateInstanceRequest: Calling provider createInstance: "<<pr.getName()<<PEGASUS_STD(endl)); |
Tracer::LEVEL4, |
|
"Calling provider.createInstance: " + ph.GetProvider().getName()); |
|
|
|
DDD(cout<<"--- JMPIProviderManager::handleCreateInstanceRequest: " |
|
"Calling provider createInstance: " |
|
<<pr.getName()<<endl); |
| |
JvmVector *jv = 0; | JvmVector *jv = 0; |
| |
|
|
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED", |
CIM_ERR_FAILED, |
"Could not initialize the JVM (Java Virtual Machine) runtime environment.")); |
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); |
|
|
String interfaceType; | String interfaceType; |
String interfaceVersion; | String interfaceVersion; |
| |
getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME), |
getInterfaceType( |
|
request->operationContext.get( |
|
ProviderIdContainer::NAME), |
interfaceType, | interfaceType, |
interfaceVersion); | interfaceVersion); |
| |
if (interfaceType == "JMPI") | if (interfaceType == "JMPI") |
{ | { |
// public org.pegasus.jmpi.CIMObjectPath createInstance (org.pegasus.jmpi.CIMObjectPath cop, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMInstance cimInstance) |
(jclass)pr.jProviderClass, |
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"createInstance", | "createInstance", |
"(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMInstance;)Lorg/pegasus/jmpi/CIMObjectPath;"); |
"(Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Lorg/pegasus/jmpi/CIMInstance;)" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_INSTANCEPROVIDER; | eMethodFound = METHOD_INSTANCEPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateInstanceRequest: found METHOD_INSTANCEPROVIDER."<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::handleCreateInstanceRequest" |
|
": found METHOD_INSTANCEPROVIDER." |
|
<<endl); |
} | } |
} | } |
else if (interfaceType == "JMPIExperimental") | else if (interfaceType == "JMPIExperimental") |
{ | { |
// public org.pegasus.jmpi.CIMObjectPath createInstance (org.pegasus.jmpi.OperationContext oc |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath cop, |
(jclass)pr.jProviderClass, |
// org.pegasus.jmpi.CIMInstance cimInstance) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"createInstance", | "createInstance", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMInstance;)Lorg/pegasus/jmpi/CIMObjectPath;"); |
"(Lorg/pegasus/jmpi/OperationContext;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Lorg/pegasus/jmpi/CIMInstance;)" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_INSTANCEPROVIDER2; | eMethodFound = METHOD_INSTANCEPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateInstanceRequest: found METHOD_INSTANCEPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleCreateInstanceRequest:" |
|
" found METHOD_INSTANCEPROVIDER2."<<endl); |
} | } |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateInstanceRequest: No method found!"<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::handleCreateInstanceRequest: " |
|
"No method found!"<<endl); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND", |
CIM_ERR_FAILED, |
"Could not find a method for the provider based on InterfaceType.")); |
MessageLoaderParms( |
|
"ProviderManager.JMPI.METHOD_NOT_FOUND", |
|
"Could not find a method for the provider based on " |
|
"InterfaceType.")); |
} | } |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
|
|
{ | { |
case METHOD_INSTANCEPROVIDER: | case METHOD_INSTANCEPROVIDER: |
{ | { |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jcopRef = DEBUG_ConvertCToJava( |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
CIMInstance *ci = new CIMInstance (request->newInstance); | CIMInstance *ci = new CIMInstance (request->newInstance); |
jlong jciRef = DEBUG_ConvertCToJava (CIMInstance*, jlong, ci); | jlong jciRef = DEBUG_ConvertCToJava (CIMInstance*, jlong, ci); |
jobject jci = env->NewObject(jv->CIMInstanceClassRef,jv->CIMInstanceNewJ,jciRef); |
jobject jci = env->NewObject( |
|
jv->CIMInstanceClassRef, |
|
jv->CIMInstanceNewJ, |
|
jciRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateInstanceRequest: id = "<<id<<", jcop = "<<jcop<<", jci = "<<jci<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleCreateInstanceRequest: " |
|
"id = "<<id<<", jcop = "<<jcop |
|
<<", jci = "<<jci<<endl); |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
|
|
handler.processing(); | handler.processing(); |
| |
if (jcopRet) { | if (jcopRet) { |
jlong jCopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst); |
jlong jCopRetRef = env->CallLongMethod( |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jCopRetRef); |
jcopRet, |
|
JMPIjvm::jv.CIMObjectPathCInst); |
|
CIMObjectPath *copRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMObjectPath*, |
|
jCopRetRef); |
| |
handler.deliver(*copRet); | handler.deliver(*copRet); |
} | } |
|
|
| |
case METHOD_INSTANCEPROVIDER2: | case METHOD_INSTANCEPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
&request->operationContext); |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jcopRef = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
CIMInstance *ci = new CIMInstance (request->newInstance); | CIMInstance *ci = new CIMInstance (request->newInstance); |
jlong jciRef = DEBUG_ConvertCToJava (CIMInstance*, jlong, ci); | jlong jciRef = DEBUG_ConvertCToJava (CIMInstance*, jlong, ci); |
jobject jci = env->NewObject(jv->CIMInstanceClassRef,jv->CIMInstanceNewJ,jciRef); |
jobject jci = env->NewObject( |
|
jv->CIMInstanceClassRef, |
|
jv->CIMInstanceNewJ, |
|
jciRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateInstanceRequest: id = "<<id<<", jcop = "<<jcop<<", jci = "<<jci<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleCreateInstanceRequest: " |
|
"id = "<<id<<", jcop = "<<jcop |
|
<<", jci = "<<jci<<endl); |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
|
|
handler.processing(); | handler.processing(); |
| |
if (jcopRet) { | if (jcopRet) { |
jlong jCopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst); |
jlong jCopRetRef = env->CallLongMethod( |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jCopRetRef); |
jcopRet, |
|
JMPIjvm::jv.CIMObjectPathCInst); |
|
CIMObjectPath *copRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMObjectPath*, |
|
jCopRetRef); |
| |
handler.deliver(*copRet); | handler.deliver(*copRet); |
} | } |
|
|
| |
case METHOD_UNKNOWN: | case METHOD_UNKNOWN: |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateInstanceRequest: should not be here!"<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::handleCreateInstanceRequest: " |
|
"should not be here!"<<endl); |
break; | break; |
} | } |
} | } |
|
|
return(response); | return(response); |
} | } |
| |
Message * JMPIProviderManager::handleModifyInstanceRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleModifyInstanceRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleModifyInstanceRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleModifyInstanceRequest"); |
| |
HandlerIntro(ModifyInstance,message,request,response,handler); | HandlerIntro(ModifyInstance,message,request,response,handler); |
| |
|
|
| |
try { | try { |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, | Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
"JMPIProviderManager::handleModifyInstanceRequest - Host name: $0 Name space: $1 Class name: $2", |
"JMPIProviderManager::handleModifyInstanceRequest - Host name: $0 " |
|
" Name space: $1 Class name: $2", |
System::getHostName(), | System::getHostName(), |
request->nameSpace.getString(), | request->nameSpace.getString(), |
request->modifiedInstance.getPath().getClassName().getString()); | request->modifiedInstance.getPath().getClassName().getString()); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleModifyInstanceRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", classname = "<<request->modifiedInstance.getPath().getClassName().getString()<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleModifyInstanceRequest: " |
|
"hostname = "<<System::getHostName() |
|
<<", namespace = "<<request->nameSpace.getString() |
|
<<", classname = " |
|
<<request->modifiedInstance.getPath().getClassName().getString() |
|
<<endl); |
| |
// make target object path | // make target object path |
CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(), |
CIMObjectPath *objectPath = |
|
new CIMObjectPath( |
|
System::getHostName(), |
request->nameSpace, | request->nameSpace, |
request->modifiedInstance.getPath ().getClassName(), | request->modifiedInstance.getPath ().getClassName(), |
request->modifiedInstance.getPath ().getKeyBindings()); | request->modifiedInstance.getPath ().getKeyBindings()); |
|
|
ProviderName name = _resolveProviderName( | ProviderName name = _resolveProviderName( |
request->operationContext.get(ProviderIdContainer::NAME)); | request->operationContext.get(ProviderIdContainer::NAME)); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleModifyInstanceRequest: provider name physical = "<<name.getPhysicalName()<<", logical = "<<name.getLogicalName()<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleModifyInstanceRequest: " |
|
"provider name physical = "<<name.getPhysicalName() |
|
<<", logical = "<<name.getLogicalName()<<endl); |
| |
// get cached or load new provider module | // get cached or load new provider module |
JMPIProvider::OpProviderHolder ph = providerManager.getProvider (name.getPhysicalName(), |
JMPIProvider::OpProviderHolder ph = |
|
providerManager.getProvider( |
|
name.getPhysicalName(), |
name.getLogicalName(), | name.getLogicalName(), |
String::EMPTY); | String::EMPTY); |
| |
// forward request | // forward request |
JMPIProvider &pr = ph.GetProvider(); | JMPIProvider &pr = ph.GetProvider(); |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,"Calling provider.modifyInstance: " + pr.getName()); |
PEG_TRACE_STRING( |
|
TRC_PROVIDERMANAGER, |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleModifyInstanceRequest: Calling provider "<<PEGASUS_STD(hex)<<(long)&pr<<PEGASUS_STD(dec)<<", name = "<<pr.getName ()<<", module = "<<pr.getModule()<<" modifyInstance: "<<pr.getName()<<PEGASUS_STD(endl)); |
Tracer::LEVEL4, |
|
"Calling provider.modifyInstance: " + pr.getName()); |
|
|
|
DDD(cout<<"--- JMPIProviderManager::handleModifyInstanceRequest: " |
|
"Calling provider "<<hex<<(long)&pr<<dec |
|
<<", name = "<<pr.getName ()<<", module = " |
|
<<pr.getModule()<<" modifyInstance: "<<pr.getName()<<endl); |
| |
JvmVector *jv = 0; | JvmVector *jv = 0; |
| |
|
|
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED", |
CIM_ERR_FAILED, |
"Could not initialize the JVM (Java Virtual Machine) runtime environment.")); |
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); |
|
|
String interfaceType; | String interfaceType; |
String interfaceVersion; | String interfaceVersion; |
| |
getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME), |
getInterfaceType( |
|
request->operationContext.get( |
|
ProviderIdContainer::NAME), |
interfaceType, | interfaceType, |
interfaceVersion); | interfaceVersion); |
| |
if (interfaceType == "JMPI") | if (interfaceType == "JMPI") |
{ | { |
// public abstract void setInstance (org.pegasus.jmpi.CIMObjectPath cop, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMInstance cimInstance) |
(jclass)pr.jProviderClass, |
// org.pegasus.jmpi.throws CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"setInstance", | "setInstance", |
"(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMInstance;)V"); |
"(Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Lorg/pegasus/jmpi/CIMInstance;)V"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_INSTANCEPROVIDER; | eMethodFound = METHOD_INSTANCEPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleModifyInstanceRequest: found METHOD_INSTANCEPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleModifyInstanceRequest:" |
|
" found METHOD_INSTANCEPROVIDER."<<endl); |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
| |
// public void setInstance (org.pegasus.jmpi.CIMObjectPath op, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMInstance ci, |
(jclass)pr.jProviderClass, |
// boolean includeQualifiers, |
|
// java.lang.String[] propertyList) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"setInstance", | "setInstance", |
"(Lorg/pegasus/jmpi/CIMObjectPath;Z[Ljava/lang/String)V"); |
"(Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Z[Ljava/lang/String)V"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_CIMINSTANCEPROVIDER; | eMethodFound = METHOD_CIMINSTANCEPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleModifyInstanceRequest: found METHOD_CIMINSTANCEPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::" |
|
"handleModifyInstanceRequest: found " |
|
"METHOD_CIMINSTANCEPROVIDER." |
|
<<endl); |
} | } |
} | } |
} | } |
else if (interfaceType == "JMPIExperimental") | else if (interfaceType == "JMPIExperimental") |
{ | { |
// public abstract void setInstance (org.pegasus.jmpi.OperationContext oc, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath op, |
(jclass)pr.jProviderClass, |
// org.pegasus.jmpi.CIMInstance cimInstance); |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"setInstance", | "setInstance", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMInstance;)V"); |
"(Lorg/pegasus/jmpi/OperationContext;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Lorg/pegasus/jmpi/CIMInstance;)V"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_INSTANCEPROVIDER2; | eMethodFound = METHOD_INSTANCEPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleModifyInstanceRequest: found METHOD_INSTANCEPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleModifyInstanceRequest:" |
|
" found METHOD_INSTANCEPROVIDER2."<<endl); |
} | } |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleModifyInstanceRequest: No method found!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleModifyInstanceRequest:" |
|
" No method found!"<<endl); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND", |
CIM_ERR_FAILED, |
"Could not find a method for the provider based on InterfaceType.")); |
MessageLoaderParms( |
|
"ProviderManager.JMPI.METHOD_NOT_FOUND", |
|
"Could not find a method for the provider based on " |
|
"InterfaceType.")); |
} | } |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
|
|
{ | { |
case METHOD_INSTANCEPROVIDER2: | case METHOD_INSTANCEPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
&request->operationContext); |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
|
|
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jcopRef = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
CIMInstance *ci = new CIMInstance (request->modifiedInstance); | CIMInstance *ci = new CIMInstance (request->modifiedInstance); |
jlong jciRef = DEBUG_ConvertCToJava (CIMInstance*, jlong, ci); | jlong jciRef = DEBUG_ConvertCToJava (CIMInstance*, jlong, ci); |
jobject jci = env->NewObject(jv->CIMInstanceClassRef,jv->CIMInstanceNewJ,jciRef); |
jobject jci = env->NewObject( |
|
jv->CIMInstanceClassRef, |
|
jv->CIMInstanceNewJ, |
|
jciRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_CIMINSTANCEPROVIDER: | case METHOD_CIMINSTANCEPROVIDER: |
{ | { |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jcopRef = DEBUG_ConvertCToJava( |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
CIMInstance *ci = new CIMInstance (request->modifiedInstance); | CIMInstance *ci = new CIMInstance (request->modifiedInstance); |
jlong jciRef = DEBUG_ConvertCToJava (CIMInstance*, jlong, ci); | jlong jciRef = DEBUG_ConvertCToJava (CIMInstance*, jlong, ci); |
jobject jci = env->NewObject(jv->CIMInstanceClassRef,jv->CIMInstanceNewJ,jciRef); |
jobject jci = env->NewObject( |
|
jv->CIMInstanceClassRef, |
|
jv->CIMInstanceNewJ, |
|
jciRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_INSTANCEPROVIDER: | case METHOD_INSTANCEPROVIDER: |
{ | { |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jcopRef = DEBUG_ConvertCToJava( |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
CIMInstance *ci = new CIMInstance (request->modifiedInstance); | CIMInstance *ci = new CIMInstance (request->modifiedInstance); |
jlong jciRef = DEBUG_ConvertCToJava (CIMInstance*, jlong, ci); | jlong jciRef = DEBUG_ConvertCToJava (CIMInstance*, jlong, ci); |
jobject jci = env->NewObject(jv->CIMInstanceClassRef,jv->CIMInstanceNewJ,jciRef); |
jobject jci = env->NewObject( |
|
jv->CIMInstanceClassRef, |
|
jv->CIMInstanceNewJ, |
|
jciRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_UNKNOWN: | case METHOD_UNKNOWN: |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleModifyInstanceRequest: should not be here!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleModifyInstanceRequest: " |
|
"should not be here!" |
|
<<endl); |
break; | break; |
} | } |
} | } |
|
|
return(response); | return(response); |
} | } |
| |
Message * JMPIProviderManager::handleDeleteInstanceRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleDeleteInstanceRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleDeleteInstanceRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleDeleteInstanceRequest"); |
| |
HandlerIntro(DeleteInstance,message,request,response,handler); | HandlerIntro(DeleteInstance,message,request,response,handler); |
| |
|
|
JNIEnv *env = NULL; | JNIEnv *env = NULL; |
| |
try { | try { |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
Logger::put( |
"JMPIProviderManager::handleDeleteInstanceRequest - Host name: $0 Name space: $1 Class name: $2", |
Logger::STANDARD_LOG, |
|
System::CIMSERVER, |
|
Logger::TRACE, |
|
"JMPIProviderManager::handleDeleteInstanceRequest - Host name: $0 " |
|
" Name space: $1 Class name: $2", |
System::getHostName(), | System::getHostName(), |
request->nameSpace.getString(), | request->nameSpace.getString(), |
request->instanceName.getClassName().getString()); | request->instanceName.getClassName().getString()); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteInstanceRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", classname = "<<request->instanceName.getClassName().getString()<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleDeleteInstanceRequest: " |
|
"hostname = " |
|
<<System::getHostName()<<", namespace = " |
|
<<request->nameSpace.getString()<<", classname = " |
|
<<request->instanceName.getClassName().getString()<<endl); |
| |
// make target object path | // make target object path |
CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(), |
CIMObjectPath *objectPath = new CIMObjectPath( |
|
System::getHostName(), |
request->nameSpace, | request->nameSpace, |
request->instanceName.getClassName(), | request->instanceName.getClassName(), |
request->instanceName.getKeyBindings()); | request->instanceName.getKeyBindings()); |
|
|
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 = providerManager.getProvider (name.getPhysicalName(), |
JMPIProvider::OpProviderHolder ph = |
|
providerManager.getProvider( |
|
name.getPhysicalName(), |
name.getLogicalName(), | name.getLogicalName(), |
String::EMPTY); | String::EMPTY); |
| |
// forward request | // forward request |
JMPIProvider &pr = ph.GetProvider(); | JMPIProvider &pr = ph.GetProvider(); |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.deleteInstance: " + pr.getName()); |
PEG_TRACE_STRING( |
|
TRC_PROVIDERMANAGER, |
|
Tracer::LEVEL4, |
|
"Calling provider.deleteInstance: " + pr.getName()); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteInstanceRequest: Calling provider deleteInstance: "<<pr.getName()<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleDeleteInstanceRequest: " |
|
"Calling provider deleteInstance: "<<pr.getName()<<endl); |
| |
JvmVector *jv = 0; | JvmVector *jv = 0; |
| |
|
|
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED", |
CIM_ERR_FAILED, |
"Could not initialize the JVM (Java Virtual Machine) runtime environment.")); |
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); |
|
|
String interfaceType; | String interfaceType; |
String interfaceVersion; | String interfaceVersion; |
| |
getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME), |
getInterfaceType( |
|
request->operationContext.get(ProviderIdContainer::NAME), |
interfaceType, | interfaceType, |
interfaceVersion); | interfaceVersion); |
| |
if (interfaceType == "JMPI") | if (interfaceType == "JMPI") |
{ | { |
// public abstract void deleteInstance (org.pegasus.jmpi.CIMObjectPath cop) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, | id = env->GetMethodID((jclass)pr.jProviderClass, |
"deleteInstance", | "deleteInstance", |
"(Lorg/pegasus/jmpi/CIMObjectPath;)V"); | "(Lorg/pegasus/jmpi/CIMObjectPath;)V"); |
|
|
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_INSTANCEPROVIDER; | eMethodFound = METHOD_INSTANCEPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteInstanceRequest: found METHOD_INSTANCEPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleDeleteInstanceRequest:" |
|
" found METHOD_INSTANCEPROVIDER." |
|
<<endl); |
} | } |
} | } |
else if (interfaceType == "JMPIExperimental") | else if (interfaceType == "JMPIExperimental") |
{ | { |
// public abstract void deleteInstance (org.pegasus.jmpi.OperationContext oc, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath cop) |
(jclass)pr.jProviderClass, |
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"deleteInstance", | "deleteInstance", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;)V"); |
"(Lorg/pegasus/jmpi/OperationContext;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;)V"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_INSTANCEPROVIDER2; | eMethodFound = METHOD_INSTANCEPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteInstanceRequest: found METHOD_INSTANCEPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleDeleteInstanceRequest:" |
|
" found METHOD_INSTANCEPROVIDER2." |
|
<<endl); |
} | } |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteInstanceRequest: No method found!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleDeleteInstanceRequest: " |
|
"No method found!"<<endl); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND", |
CIM_ERR_FAILED, |
"Could not find a method for the provider based on InterfaceType.")); |
MessageLoaderParms( |
|
"ProviderManager.JMPI.METHOD_NOT_FOUND", |
|
"Could not find a method for the provider based on " |
|
"InterfaceType.")); |
} | } |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
|
|
{ | { |
case METHOD_INSTANCEPROVIDER2: | case METHOD_INSTANCEPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
&request->operationContext); |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jcopRef = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_INSTANCEPROVIDER: | case METHOD_INSTANCEPROVIDER: |
{ | { |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jcopRef = DEBUG_ConvertCToJava( |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_UNKNOWN: | case METHOD_UNKNOWN: |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteInstanceRequest: should not be here!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleDeleteInstanceRequest: " |
|
"should not be here!"<<endl); |
break; | break; |
} | } |
} | } |
|
|
return(response); | return(response); |
} | } |
| |
Message * JMPIProviderManager::handleExecQueryRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleExecQueryRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleExecQueryRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleExecQueryRequest"); |
| |
HandlerIntro(ExecQuery,message,request,response,handler); | HandlerIntro(ExecQuery,message,request,response,handler); |
| |
|
|
JNIEnv *env = NULL; | JNIEnv *env = NULL; |
| |
try { | try { |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
Logger::put( |
"JMPIProviderManager::handleExecQueryRequest - Host name: $0 Name space: $1 Class name: $2", |
Logger::STANDARD_LOG, |
|
System::CIMSERVER, |
|
Logger::TRACE, |
|
"JMPIProviderManager::handleExecQueryRequest - Host name: $0 " |
|
"Name space: $1 Class name: $2", |
System::getHostName(), | System::getHostName(), |
request->nameSpace.getString(), | request->nameSpace.getString(), |
request->className.getString()); | request->className.getString()); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", classname = "<<request->className.getString()<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleExecQueryRequest: hostname = " |
|
<<System::getHostName()<<", namespace = " |
|
<<request->nameSpace.getString()<<", classname = " |
|
<<request->className.getString()<<endl); |
| |
// make target object path | // make target object path |
CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(), | CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(), |
|
|
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 = providerManager.getProvider (name.getPhysicalName(), |
JMPIProvider::OpProviderHolder ph = |
|
providerManager.getProvider( |
|
name.getPhysicalName(), |
name.getLogicalName(), | name.getLogicalName(), |
String::EMPTY); | String::EMPTY); |
| |
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert( |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
request->operationContext.get(IdentityContainer::NAME)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
context.insert( |
|
request->operationContext.get(AcceptLanguageListContainer::NAME)); |
|
context.insert( |
|
request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
// forward request | // forward request |
JMPIProvider &pr = ph.GetProvider(); | JMPIProvider &pr = ph.GetProvider(); |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,"Calling provider.execQuery: " + pr.getName()); |
PEG_TRACE_STRING( |
|
TRC_PROVIDERMANAGER, |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: Calling provider execQuery: "<<pr.getName()<<", queryLanguage: "<<request->queryLanguage<<", query: "<<request->query<<PEGASUS_STD(endl)); |
Tracer::LEVEL4, |
|
"Calling provider.execQuery: " + pr.getName()); |
|
|
|
DDD(cout<<"--- JMPIProviderManager::handleExecQueryRequest: " |
|
"Calling provider execQuery: "<<pr.getName() |
|
<<", queryLanguage: "<<request->queryLanguage<<", query: " |
|
<<request->query<<endl); |
| |
JvmVector *jv = 0; | JvmVector *jv = 0; |
| |
|
|
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED", |
CIM_ERR_FAILED, |
"Could not initialize the JVM (Java Virtual Machine) runtime environment.")); |
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); |
|
|
String interfaceType; | String interfaceType; |
String interfaceVersion; | String interfaceVersion; |
| |
getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME), |
getInterfaceType( |
|
request->operationContext.get( |
|
ProviderIdContainer::NAME), |
interfaceType, | interfaceType, |
interfaceVersion); | interfaceVersion); |
| |
if (interfaceType == "JMPI") | if (interfaceType == "JMPI") |
{ | { |
// public abstract java.util.Vector execQuery (org.pegasus.jmpi.CIMObjectPath cop, |
id = env->GetMethodID( |
// java.lang.String queryStatement, |
(jclass)pr.jProviderClass, |
// int ql, |
|
// org.pegasus.jmpi.CIMClass cimClass) |
|
// throws org.pegasus.jmpi.CIMException |
|
// |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"execQuery", | "execQuery", |
"(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ILorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;"); |
"(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;" |
|
"ILorg/pegasus/jmpi/CIMClass;)Ljava/util/Vector;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_INSTANCEPROVIDER; | eMethodFound = METHOD_INSTANCEPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: found METHOD_INSTANCEPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleExecQueryRequest: " |
|
"found METHOD_INSTANCEPROVIDER."<<endl); |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
| |
// public abstract org.pegasus.jmpi.CIMInstance[] execQuery(org.pegasus.jmpi.CIMObjectPath cop, |
id = env->GetMethodID( |
// java.lang.String query, |
(jclass)pr.jProviderClass, |
// java.lang.String ql, |
|
// org.pegasus.jmpi.CIMClass cimClass) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"execQuery", | "execQuery", |
"(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Lorg/pegasus/jmpi/CIMClass;)[Lorg/pegasus/jmpi/CIMInstance;"); |
"(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;" |
|
"Ljava/lang/String;Lorg/pegasus/jmpi/CIMClass;)" |
|
"[Lorg/pegasus/jmpi/CIMInstance;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_CIMINSTANCEPROVIDER; | eMethodFound = METHOD_CIMINSTANCEPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: found METHOD_CIMINSTANCEPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleExecQueryRequest: " |
|
"found METHOD_CIMINSTANCEPROVIDER."<<endl); |
} | } |
} | } |
} | } |
else if (interfaceType == "JMPIExperimental") | else if (interfaceType == "JMPIExperimental") |
{ | { |
// public abstract java.util.Vector execQuery (org.pegasus.jmpi.OperationContext oc, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath cop, |
(jclass)pr.jProviderClass, |
// 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", | "execQuery", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector;"); |
"(Lorg/pegasus/jmpi/OperationContext;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Lorg/pegasus/jmpi/CIMClass;Ljava/lang/String;" |
|
"Ljava/lang/String;)Ljava/util/Vector;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_INSTANCEPROVIDER2; | eMethodFound = METHOD_INSTANCEPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: found METHOD_INSTANCEPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleExecQueryRequest: " |
|
"found METHOD_INSTANCEPROVIDER2."<<endl); |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
| |
// public abstract org.pegasus.jmpi.CIMInstance[] execQuery (org.pegasus.jmpi.OperationContext oc, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath cop, |
(jclass)pr.jProviderClass, |
// 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", | "execQuery", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMClass;Ljava/lang/String;Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMInstance;"); |
"(Lorg/pegasus/jmpi/OperationContext;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Lorg/pegasus/jmpi/CIMClass;Ljava/lang/String;" |
|
"Ljava/lang/String;)" |
|
"[Lorg/pegasus/jmpi/CIMInstance;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_CIMINSTANCEPROVIDER2; | eMethodFound = METHOD_CIMINSTANCEPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: found METHOD_CIMINSTANCEPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleExecQueryRequest: " |
|
"found METHOD_CIMINSTANCEPROVIDER2."<<endl); |
} | } |
} | } |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: found no method!"<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::handleExecQueryRequest: " |
|
"found no method!"<<endl); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND", |
CIM_ERR_FAILED, |
"Could not find a method for the provider based on InterfaceType.")); |
MessageLoaderParms( |
|
"ProviderManager.JMPI.METHOD_NOT_FOUND", |
|
"Could not find a method for the provider based on " |
|
"InterfaceType.")); |
} | } |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
|
|
{ | { |
case METHOD_CIMINSTANCEPROVIDER: | case METHOD_CIMINSTANCEPROVIDER: |
{ | { |
jlong jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jcopref = DEBUG_ConvertCToJava( |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewJ, jcopref); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopref); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jqueryLanguage = env->NewStringUTF(request->queryLanguage.getCString()); |
jstring jqueryLanguage = env->NewStringUTF( |
jstring jquery = env->NewStringUTF(request->query.getCString()); |
request->queryLanguage.getCString()); |
|
jstring jquery = env->NewStringUTF( |
|
request->query.getCString()); |
| |
CIMClass cls; | CIMClass cls; |
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD(cout<<"enter: cimom_handle->getClass("<<__LINE__ |
|
<<") "<<request->className<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD (cout<<"exit: cimom_handle->getClass("<<__LINE__<<") " |
|
<<request->className<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::handleExecQueryRequest: " |
|
"Error: Caught CIMExcetion during " |
|
"cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
jlong jcls = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); | jlong jcls = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); |
| |
jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcls); |
jobject jCc=env->NewObject( |
|
jv->CIMClassClassRef, |
|
jv->CIMClassNewJ, |
|
jcls); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr = (jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
jcop, | jcop, |
jquery, | jquery, |
|
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
|
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_CIMINSTANCEPROVIDER2: | case METHOD_CIMINSTANCEPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
&request->operationContext); |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewJ, jcopref); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jcopref = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopref); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jqueryLanguage = env->NewStringUTF(request->queryLanguage.getCString()); |
jstring jqueryLanguage = env->NewStringUTF( |
jstring jquery = env->NewStringUTF(request->query.getCString()); |
request->queryLanguage.getCString()); |
|
jstring jquery = env->NewStringUTF( |
|
request->query.getCString()); |
| |
CIMClass cls; | CIMClass cls; |
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD (cout<<"enter: cimom_handle->getClass("<<__LINE__<<") " |
|
<<request->className<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD (cout<<"exit: cimom_handle->getClass("<<__LINE__<<") " |
|
<<request->className<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleExecQueryRequest: " |
|
"Error: Caught CIMExcetion during " |
|
"cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
jlong jcls = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); | jlong jcls = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); |
| |
jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcls); |
jobject jCc=env->NewObject( |
|
jv->CIMClassClassRef, |
|
jv->CIMClassNewJ, |
|
jcls); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jAr = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr = (jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jcop, | jcop, |
|
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
|
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_INSTANCEPROVIDER2: | case METHOD_INSTANCEPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
&request->operationContext); |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewJ, jcopref); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jcopref = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopref); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jqueryLanguage = env->NewStringUTF(request->queryLanguage.getCString()); |
jstring jqueryLanguage = env->NewStringUTF( |
jstring jquery = env->NewStringUTF(request->query.getCString()); |
request->queryLanguage.getCString()); |
|
jstring jquery = env->NewStringUTF( |
|
request->query.getCString()); |
| |
CIMClass cls; | CIMClass cls; |
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD(cout<<"enter: cimom_handle->getClass("<<__LINE__<<") " |
|
<<request->className<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD (cout<<"exit: cimom_handle->getClass("<<__LINE__<<") " |
|
<<request->className<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::handleExecQueryRequest: " |
|
"Error: Caught CIMExcetion during " |
|
"cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
jlong jcls = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); | jlong jcls = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); |
| |
jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcls); |
jobject jCc=env->NewObject( |
|
jv->CIMClassClassRef, |
|
jv->CIMClassNewJ, |
|
jcls); |
| |
JMPIjvm::checkException(env); | 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++) |
{ | { |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i); |
jobject jciRet = env->CallObjectMethod( |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: jciRet = "<<jciRet<<PEGASUS_STD(endl)); |
jVec, |
|
JMPIjvm::jv.VectorElementAt, |
|
i); |
|
DDD(cout<<"--- JMPIProviderManager::handleExecQueryRequest:" |
|
" jciRet = "<<jciRet<<endl); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
|
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
handler.deliver(*ciRet); | handler.deliver(*ciRet); |
} | } |
} | } |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: done!"<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::handleExecQueryRequest: done!" |
|
<<endl); |
handler.complete(); | handler.complete(); |
break; | break; |
} | } |
| |
case METHOD_INSTANCEPROVIDER: | case METHOD_INSTANCEPROVIDER: |
{ | { |
jlong jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jcopref = DEBUG_ConvertCToJava( |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewJ, jcopref); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopref); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jqueryLanguage = env->NewStringUTF(request->queryLanguage.getCString()); |
jstring jqueryLanguage = env->NewStringUTF( |
jstring jquery = env->NewStringUTF(request->query.getCString()); |
request->queryLanguage.getCString()); |
|
jstring jquery = env->NewStringUTF( |
|
request->query.getCString()); |
| |
CIMClass cls; | CIMClass cls; |
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD (cout<<"enter: cimom_handle->getClass("<<__LINE__<<") " |
|
<<request->className<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<request->className<<PEGASUS_STD(endl)); |
DDD (cout<<"exit: cimom_handle->getClass("<<__LINE__<<") " |
|
<<request->className<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleExecQueryRequest: " |
|
"Error: Caught CIMExcetion during " |
|
"cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
jlong jcls = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); | jlong jcls = DEBUG_ConvertCToJava (CIMClass*, jlong, pcls); |
| |
jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewJ,jcls); |
jobject jCc=env->NewObject( |
|
jv->CIMClassClassRef, |
|
jv->CIMClassNewJ, |
|
jcls); |
| |
JMPIjvm::checkException(env); | 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++) |
|
{ |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i); |
jobject jciRet = env->CallObjectMethod( |
|
jVec, |
|
JMPIjvm::jv.VectorElementAt, |
|
i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
|
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_UNKNOWN: | case METHOD_UNKNOWN: |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: should not be here!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleExecQueryRequest: " |
|
"should not be here!"<<endl); |
break; | break; |
} | } |
} | } |
|
|
return(response); | return(response); |
} | } |
| |
Message * JMPIProviderManager::handleAssociatorsRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleAssociatorsRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleAssociatorsRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleAssociatorsRequest"); |
| |
HandlerIntro(Associators,message,request,response,handler); | HandlerIntro(Associators,message,request,response,handler); |
| |
|
|
METHOD_VERSION eMethodFound = METHOD_UNKNOWN; | METHOD_VERSION eMethodFound = METHOD_UNKNOWN; |
JNIEnv *env = NULL; | JNIEnv *env = NULL; |
| |
try { |
try |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
{ |
"JMPIProviderManager::handleAssociatorsRequest - Host name: $0 Name space: $1 Class name: $2", |
Logger::put( |
|
Logger::STANDARD_LOG, |
|
System::CIMSERVER, |
|
Logger::TRACE, |
|
"JMPIProviderManager::handleAssociatorsRequest - Host name: $0 " |
|
"Name space: $1 Class name: $2", |
System::getHostName(), | System::getHostName(), |
request->nameSpace.getString(), | request->nameSpace.getString(), |
request->objectName.getClassName().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)); |
DDD(cout<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"hostname = "<<System::getHostName()<<", namespace = " |
|
<<request->nameSpace.getString()<<", classname = " |
|
<<request->objectName.getClassName().getString()<<endl); |
| |
// make target object path | // make target object path |
CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(), |
CIMObjectPath *objectPath = new CIMObjectPath( |
|
System::getHostName(), |
request->nameSpace, | request->nameSpace, |
request->objectName.getClassName(), | request->objectName.getClassName(), |
request->objectName.getKeyBindings()); | request->objectName.getKeyBindings()); |
CIMObjectPath *assocPath = new CIMObjectPath (System::getHostName(), |
CIMObjectPath *assocPath = new CIMObjectPath( |
|
System::getHostName(), |
request->nameSpace, | request->nameSpace, |
request->assocClass.getString()); | request->assocClass.getString()); |
| |
|
|
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 = providerManager.getProvider (name.getPhysicalName(), |
JMPIProvider::OpProviderHolder ph = |
|
providerManager.getProvider( |
|
name.getPhysicalName(), |
name.getLogicalName(), | name.getLogicalName(), |
String::EMPTY); | String::EMPTY); |
| |
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert( |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
request->operationContext.get(IdentityContainer::NAME)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
context.insert( |
|
request->operationContext.get(AcceptLanguageListContainer::NAME)); |
|
context.insert( |
|
request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
// forward request | // forward request |
JMPIProvider &pr = ph.GetProvider(); | JMPIProvider &pr = ph.GetProvider(); |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,"Calling provider.associators: " + pr.getName()); |
PEG_TRACE_STRING( |
|
TRC_PROVIDERMANAGER, |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: Calling provider associators: "<<pr.getName()<<", role: "<<request->role<<", aCls: "<<request->assocClass<<PEGASUS_STD(endl)); |
Tracer::LEVEL4, |
|
"Calling provider.associators: " + pr.getName()); |
|
|
|
DDD(cout<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"Calling provider associators: "<<pr.getName() |
|
<<", role: "<<request->role<<", aCls: " |
|
<<request->assocClass<<endl); |
| |
JvmVector *jv = 0; | JvmVector *jv = 0; |
| |
|
|
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED", |
CIM_ERR_FAILED, |
"Could not initialize the JVM (Java Virtual Machine) runtime environment.")); |
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); |
|
|
String interfaceType; | String interfaceType; |
String interfaceVersion; | String interfaceVersion; |
| |
getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME), |
getInterfaceType( |
|
request->operationContext.get( |
|
ProviderIdContainer::NAME), |
interfaceType, | interfaceType, |
interfaceVersion); | interfaceVersion); |
| |
if (interfaceType == "JMPI") | if (interfaceType == "JMPI") |
{ | { |
// public java.util.Vector associators (org.pegasus.jmpi.CIMObjectPath assocName, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath pathName, |
(jclass)pr.jProviderClass, |
// 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", | "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;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_ASSOCIATORPROVIDER; | eMethodFound = METHOD_ASSOCIATORPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found METHOD_ASSOCIATORPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"found METHOD_ASSOCIATORPROVIDER."<<endl); |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
| |
// public org.pegasus.jmpi.CIMInstance[] associators (org.pegasus.jmpi.CIMObjectPath assocName, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath pathName, |
(jclass)pr.jProviderClass, |
// 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", | "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;"); |
"(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) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_CIMASSOCIATORPROVIDER; | eMethodFound = METHOD_CIMASSOCIATORPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found METHOD_CIMASSOCIATORPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleAssociatorsRequest" |
|
": found METHOD_CIMASSOCIATORPROVIDER." |
|
<<endl); |
} | } |
} | } |
} | } |
else if (interfaceType == "JMPIExperimental") | else if (interfaceType == "JMPIExperimental") |
{ | { |
// public java.util.Vector associators (org.pegasus.jmpi.OperationContext oc, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath assocName, |
(jclass)pr.jProviderClass, |
// 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", | "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;"); |
"(Lorg/pegasus/jmpi/OperationContext;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Ljava/lang/String;Ljava/lang/String;" |
|
"Ljava/lang/String;ZZ[Ljava/lang/String;)" |
|
"Ljava/util/Vector;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_ASSOCIATORPROVIDER2; | eMethodFound = METHOD_ASSOCIATORPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found METHOD_ASSOCIATORPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"found METHOD_ASSOCIATORPROVIDER2."<<endl); |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
|
id = env->GetMethodID( |
// public org.pegasus.jmpi.CIMInstance[] associators (org.pegasus.jmpi.OperationContext oc, |
(jclass)pr.jProviderClass, |
// 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", | "associators", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ[Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMInstance;"); |
"(Lorg/pegasus/jmpi/OperationContext;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Ljava/lang/String;Ljava/lang/String;" |
|
"Ljava/lang/String;ZZ[Ljava/lang/String;" |
|
")[Lorg/pegasus/jmpi/CIMInstance;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_CIMASSOCIATORPROVIDER2; | eMethodFound = METHOD_CIMASSOCIATORPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found METHOD_CIMASSOCIATORPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleAssociatorsRequest" |
|
": found METHOD_CIMASSOCIATORPROVIDER2." |
|
<<endl); |
} | } |
} | } |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: found no method!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"found no method!"<<endl); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND", |
CIM_ERR_FAILED, |
"Could not find a method for the provider based on InterfaceType.")); |
MessageLoaderParms( |
|
"ProviderManager.JMPI.METHOD_NOT_FOUND", |
|
"Could not find a method for the provider based on " |
|
"InterfaceType.")); |
} | } |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
|
|
{ | { |
case METHOD_CIMASSOCIATORPROVIDER: | case METHOD_CIMASSOCIATORPROVIDER: |
{ | { |
jlong jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, assocPath); |
jlong jAssociationNameRef = DEBUG_ConvertCToJava( |
jobject jAssociationName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef); |
CIMObjectPath*, |
|
jlong, |
|
assocPath); |
|
jobject jAssociationName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jAssociationNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jPathNameRef = DEBUG_ConvertCToJava( |
jobject jPathName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jPathName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jPathNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString()); |
jstring jResultClass = |
jstring jRole = env->NewStringUTF(request->role.getCString()); |
env->NewStringUTF( |
jstring jResultRole = env->NewStringUTF(request->resultRole.getCString()); |
request->resultClass.getString().getCString()); |
|
jstring jRole = |
|
env->NewStringUTF( |
|
request->role.getCString()); |
|
jstring jResultRole = |
|
env->NewStringUTF( |
|
request->resultRole.getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobjectArray jPropertyList = getList(jv,env,request->propertyList); | jobjectArray jPropertyList = getList(jv,env,request->propertyList); |
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: assocName = "<<assocPath->toString ()<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: pathName = "<<objectPath->toString ()<<PEGASUS_STD(endl)); |
"assocName = " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultClass = "<<request->resultClass<<PEGASUS_STD(endl)); |
<<assocPath->toString ()<<endl); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultRole = "<<request->resultRole<<PEGASUS_STD(endl)); |
"pathName = " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeQualifiers = "<<false<<PEGASUS_STD(endl)); |
<<objectPath->toString ()<<endl); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"resultClass = " |
|
<<request->resultClass<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"role = " |
|
<<request->role<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"resultRole = " |
|
<<request->resultRole<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"includeQualifiers = " |
|
<<false<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"includeClassOrigin = " |
|
<<false<<endl); |
#endif | #endif |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
jAssociationName, | jAssociationName, |
jPathName, | jPathName, |
|
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
|
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
CIMClass cls; | CIMClass cls; |
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD(cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD(cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleAssociators" |
|
"Request: Error: Caught CIMExcetion during " |
|
"cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
case METHOD_CIMASSOCIATORPROVIDER2: | case METHOD_CIMASSOCIATORPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, assocPath); |
&request->operationContext); |
jobject jAssociationName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jAssociationNameRef = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
assocPath); |
|
jobject jAssociationName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jAssociationNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jPathNameRef = DEBUG_ConvertCToJava( |
jobject jPathName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jPathName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jPathNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString()); |
jstring jResultClass = |
jstring jRole = env->NewStringUTF(request->role.getCString()); |
env->NewStringUTF( |
jstring jResultRole = env->NewStringUTF(request->resultRole.getCString()); |
request->resultClass.getString().getCString()); |
|
jstring jRole = |
|
env->NewStringUTF(request->role.getCString()); |
|
jstring jResultRole = |
|
env->NewStringUTF(request->resultRole.getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobjectArray jPropertyList = getList(jv,env,request->propertyList); | jobjectArray jPropertyList = getList(jv,env,request->propertyList); |
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: assocName = "<<assocPath->toString ()<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: pathName = "<<objectPath->toString ()<<PEGASUS_STD(endl)); |
"assocName = " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultClass = "<<request->resultClass<<PEGASUS_STD(endl)); |
<<assocPath->toString ()<<endl); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultRole = "<<request->resultRole<<PEGASUS_STD(endl)); |
"pathName = " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeQualifiers = "<<false<<PEGASUS_STD(endl)); |
<<objectPath->toString ()<<endl); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"resultClass = " |
|
<<request->resultClass<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"role = " |
|
<<request->role<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"resultRole = " |
|
<<request->resultRole<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"includeQualifiers = " |
|
<<false<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"includeClassOrigin = " |
|
<<false<<endl); |
#endif | #endif |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jAssociationName, | jAssociationName, |
|
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
|
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
CIMClass cls; | CIMClass cls; |
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD(cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD(cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleAssociators" |
|
"Request: Error: Caught CIMExcetion during" |
|
" cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
case METHOD_ASSOCIATORPROVIDER2: | case METHOD_ASSOCIATORPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, assocPath); |
&request->operationContext); |
jobject jAssociationName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jAssociationNameRef = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
assocPath); |
|
jobject jAssociationName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jAssociationNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jPathNameRef = DEBUG_ConvertCToJava( |
jobject jPathName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jPathName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jPathNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString()); |
jstring jResultClass = |
jstring jRole = env->NewStringUTF(request->role.getCString()); |
env->NewStringUTF( |
jstring jResultRole = env->NewStringUTF(request->resultRole.getCString()); |
request->resultClass.getString().getCString()); |
|
jstring jRole = |
|
env->NewStringUTF(request->role.getCString()); |
|
jstring jResultRole = |
|
env->NewStringUTF(request->resultRole.getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobjectArray jPropertyList = getList(jv,env,request->propertyList); | jobjectArray jPropertyList = getList(jv,env,request->propertyList); |
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: assocName = "<<assocPath->toString ()<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: pathName = "<<objectPath->toString ()<<PEGASUS_STD(endl)); |
"assocName = " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultClass = "<<request->resultClass<<PEGASUS_STD(endl)); |
<<assocPath->toString ()<<endl); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultRole = "<<request->resultRole<<PEGASUS_STD(endl)); |
"pathName = " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeQualifiers = "<<false<<PEGASUS_STD(endl)); |
<<objectPath->toString ()<<endl); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"resultClass = " |
|
<<request->resultClass<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"role = " |
|
<<request->role<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"resultRole = " |
|
<<request->resultRole<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"includeQualifiers = " |
|
<<false<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"includeClassOrigin = " |
|
<<false<<endl); |
#endif | #endif |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jAssociationName, | jAssociationName, |
|
|
| |
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++) |
|
{ |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i); |
jobject jciRet = env->CallObjectMethod( |
|
jVec, |
|
JMPIjvm::jv.VectorElementAt, |
|
i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
|
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
CIMClass cls; | CIMClass cls; |
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD(cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, |
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)); |
DDD(cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleAssociators" |
|
"Request: Error: Caught CIMExcetion during" |
|
" cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
case METHOD_ASSOCIATORPROVIDER: | case METHOD_ASSOCIATORPROVIDER: |
{ | { |
jlong jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, assocPath); |
jlong jAssociationNameRef = DEBUG_ConvertCToJava( |
jobject jAssociationName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef); |
CIMObjectPath*, |
|
jlong, |
|
assocPath); |
|
jobject jAssociationName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jAssociationNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jPathNameRef = DEBUG_ConvertCToJava( |
jobject jPathName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jPathName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jPathNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString()); |
jstring jResultClass = |
jstring jRole = env->NewStringUTF(request->role.getCString()); |
env->NewStringUTF( |
jstring jResultRole = env->NewStringUTF(request->resultRole.getCString()); |
request->resultClass.getString().getCString()); |
|
jstring jRole = |
|
env->NewStringUTF(request->role.getCString()); |
|
jstring jResultRole = |
|
env->NewStringUTF(request->resultRole.getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobjectArray jPropertyList = getList(jv,env,request->propertyList); | jobjectArray jPropertyList = getList(jv,env,request->propertyList); |
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: assocName = "<<assocPath->toString ()<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: pathName = "<<objectPath->toString ()<<PEGASUS_STD(endl)); |
"assocName = " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultClass = "<<request->resultClass<<PEGASUS_STD(endl)); |
<<assocPath->toString ()<<endl); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultRole = "<<request->resultRole<<PEGASUS_STD(endl)); |
"pathName = " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeQualifiers = "<<false<<PEGASUS_STD(endl)); |
<<objectPath->toString ()<<endl); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"resultClass = " |
|
<<request->resultClass<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"role = " |
|
<<request->role<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"resultRole = " |
|
<<request->resultRole<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"includeQualifiers = " |
|
<<false<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"includeClassOrigin = " |
|
<<false<<endl); |
#endif | #endif |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
jAssociationName, | jAssociationName, |
jPathName, | jPathName, |
|
|
| |
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++) |
|
{ |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
|
jobject jciRet = env->CallObjectMethod( |
jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i); |
jVec, |
|
JMPIjvm::jv.VectorElementAt, |
|
i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
|
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
CIMClass cls; | CIMClass cls; |
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD (cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD (cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleAssociators" |
|
"Request: Error: Caught CIMExcetion during" |
|
" cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
case METHOD_UNKNOWN: | case METHOD_UNKNOWN: |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorsRequest: should not be here!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleAssociatorsRequest: " |
|
"should not be here!"<<endl); |
break; | break; |
} | } |
} | } |
|
|
return(response); | return(response); |
} | } |
| |
Message * JMPIProviderManager::handleAssociatorNamesRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleAssociatorNamesRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleAssociatorNamesRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleAssociatorNamesRequest"); |
| |
HandlerIntro(AssociatorNames,message,request,response,handler); | HandlerIntro(AssociatorNames,message,request,response,handler); |
| |
|
|
METHOD_VERSION eMethodFound = METHOD_UNKNOWN; | METHOD_VERSION eMethodFound = METHOD_UNKNOWN; |
JNIEnv *env = NULL; | JNIEnv *env = NULL; |
| |
try { |
try |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
{ |
"JMPIProviderManager::handleAssociatorNamesRequest - Host name: $0 Name space: $1 Class name: $2", |
Logger::put( |
|
Logger::STANDARD_LOG, |
|
System::CIMSERVER, |
|
Logger::TRACE, |
|
"JMPIProviderManager::handleAssociatorNamesRequest - Host name: $0 " |
|
" Name space: $1 Class name: $2", |
System::getHostName(), | System::getHostName(), |
request->nameSpace.getString(), | request->nameSpace.getString(), |
request->objectName.getClassName().getString()); | request->objectName.getClassName().getString()); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", classname = "<<request->objectName.getClassName().getString()<<", assocName = "<<request->assocClass.getString()<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
|
"hostname = " |
|
<<System::getHostName()<<", namespace = " |
|
<<request->nameSpace.getString()<<", classname = " |
|
<<request->objectName.getClassName().getString() |
|
<<", assocName = "<<request->assocClass.getString()<<endl); |
| |
// make target object path | // make target object path |
CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(), |
CIMObjectPath *objectPath = new CIMObjectPath( |
|
System::getHostName(), |
request->nameSpace, | request->nameSpace, |
request->objectName.getClassName(), | request->objectName.getClassName(), |
request->objectName.getKeyBindings()); | request->objectName.getKeyBindings()); |
CIMObjectPath *assocPath = new CIMObjectPath (System::getHostName(), |
CIMObjectPath *assocPath = new CIMObjectPath( |
|
System::getHostName(), |
request->nameSpace, | request->nameSpace, |
request->assocClass.getString()); | request->assocClass.getString()); |
| |
|
|
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 = providerManager.getProvider (name.getPhysicalName(), |
JMPIProvider::OpProviderHolder ph = |
|
providerManager.getProvider( |
|
name.getPhysicalName(), |
name.getLogicalName(), | name.getLogicalName(), |
String::EMPTY); | String::EMPTY); |
| |
// forward request | // forward request |
JMPIProvider &pr = ph.GetProvider(); | JMPIProvider &pr = ph.GetProvider(); |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,"Calling provider.associatorNames: " + pr.getName()); |
PEG_TRACE_STRING( |
|
TRC_PROVIDERMANAGER, |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: Calling provider associatorNames: "<<pr.getName()<<", role: "<<request->role<<", aCls: "<<request->assocClass<<PEGASUS_STD(endl)); |
Tracer::LEVEL4, |
|
"Calling provider.associatorNames: " + pr.getName()); |
|
|
|
DDD(cout<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
|
"Calling provider associatorNames: " |
|
<<pr.getName()<<", role: "<<request->role<<", aCls: " |
|
<<request->assocClass<<endl); |
| |
JvmVector *jv = 0; | JvmVector *jv = 0; |
| |
|
|
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED", |
CIM_ERR_FAILED, |
"Could not initialize the JVM (Java Virtual Machine) runtime environment.")); |
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); |
|
|
String interfaceType; | String interfaceType; |
String interfaceVersion; | String interfaceVersion; |
| |
getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME), |
getInterfaceType( |
|
request->operationContext.get(ProviderIdContainer::NAME), |
interfaceType, | interfaceType, |
interfaceVersion); | interfaceVersion); |
| |
if (interfaceType == "JMPI") | if (interfaceType == "JMPI") |
{ | { |
// public java.util.Vector associatorNames (org.pegasus.jmpi.CIMObjectPath assocName, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath pathName, |
(jclass)pr.jProviderClass, |
// java.lang.String resultClass, |
|
// java.lang.String role, |
|
// java.lang.String resultRole) |
|
// throws org.pegasus.jmpi.CIMException |
|
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;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_ASSOCIATORPROVIDER; | eMethodFound = METHOD_ASSOCIATORPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found METHOD_ASSOCIATORPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleAssociatorNamesRequest" |
|
": found METHOD_ASSOCIATORPROVIDER."<<endl); |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
|
id = env->GetMethodID( |
// public org.pegasus.jmpi.CIMObjectPath[] associatorNames (org.pegasus.jmpi.CIMObjectPath assocName, |
(jclass)pr.jProviderClass, |
// 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", | "associatorNames", |
"(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMObjectPath;"); |
"(Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"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_CIMASSOCIATORPROVIDER; | eMethodFound = METHOD_CIMASSOCIATORPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found METHOD_CIMASSOCIATORPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleAssociatorNames" |
|
"Request: found METHOD_CIMASSOCIATORPROVIDER." |
|
<<endl); |
} | } |
} | } |
} | } |
else if (interfaceType == "JMPIExperimental") | else if (interfaceType == "JMPIExperimental") |
{ | { |
// public java.util.Vector associatorNames (org.pegasus.jmpi.OperationContext oc, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath assocName, |
(jclass)pr.jProviderClass, |
// 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", | "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;"); |
"(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) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_ASSOCIATORPROVIDER2; | eMethodFound = METHOD_ASSOCIATORPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found METHOD_ASSOCIATORPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleAssociatorNamesRequest" |
|
": found METHOD_ASSOCIATORPROVIDER2."<<endl); |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
| |
// public org.pegasus.jmpi.CIMObjectPath[] associatorNames (org.pegasus.jmpi.OperationContext oc, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath assocName, |
(jclass)pr.jProviderClass, |
// 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", | "associatorNames", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMObjectPath;"); |
"(Lorg/pegasus/jmpi/OperationContext;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Ljava/lang/String;Ljava/lang/String;" |
|
"Ljava/lang/String;)[" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_CIMASSOCIATORPROVIDER2; | eMethodFound = METHOD_CIMASSOCIATORPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found METHOD_CIMASSOCIATORPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleAssociatorNames" |
|
"Request: found METHOD_CIMASSOCIATORPROVIDER2." |
|
<<endl); |
} | } |
} | } |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: found no method!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
|
"found no method!"<<endl); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND", |
CIM_ERR_FAILED, |
"Could not find a method for the provider based on InterfaceType.")); |
MessageLoaderParms( |
|
"ProviderManager.JMPI.METHOD_NOT_FOUND", |
|
"Could not find a method for the provider based on " |
|
"InterfaceType.")); |
} | } |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
|
|
{ | { |
case METHOD_CIMASSOCIATORPROVIDER: | case METHOD_CIMASSOCIATORPROVIDER: |
{ | { |
jlong jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, assocPath); |
jlong jAssociationNameRef = DEBUG_ConvertCToJava( |
jobject jAssociationName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef); |
CIMObjectPath*, |
|
jlong, |
|
assocPath); |
|
jobject jAssociationName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jAssociationNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jPathNameRef = DEBUG_ConvertCToJava( |
jobject jPathName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jPathName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jPathNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString()); |
jstring jResultClass = |
jstring jRole = env->NewStringUTF(request->role.getCString()); |
env->NewStringUTF( |
jstring jResultRole = env->NewStringUTF(request->resultRole.getCString()); |
request->resultClass.getString().getCString()); |
|
jstring jRole = |
|
env->NewStringUTF(request->role.getCString()); |
|
jstring jResultRole = |
|
env->NewStringUTF(request->resultRole.getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: assocName = "<<assocPath->toString ()<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultClass = "<<request->resultClass<<PEGASUS_STD(endl)); |
"assocName = "<<assocPath->toString ()<<endl); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultRole = "<<request->resultRole<<PEGASUS_STD(endl)); |
"resultClass = "<<request->resultClass<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
|
"role = "<<request->role<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
|
"resultRole = "<<request->resultRole<<endl); |
#endif | #endif |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
jAssociationName, | jAssociationName, |
jPathName, | jPathName, |
|
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst); |
jlong jcopRetRef = env->CallLongMethod( |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef); |
jcopRet, |
|
JMPIjvm::jv.CIMObjectPathCInst); |
|
CIMObjectPath *copRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMObjectPath*, |
|
jcopRetRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_CIMASSOCIATORPROVIDER2: | case METHOD_CIMASSOCIATORPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
jlong jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, assocPath); |
jlong, |
jobject jAssociationName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef); |
&request->operationContext); |
|
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
jlong jAssociationNameRef = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
assocPath); |
|
jobject jAssociationName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jAssociationNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jPathNameRef = DEBUG_ConvertCToJava( |
jobject jPathName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jPathName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jPathNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString()); |
jstring jResultClass = |
jstring jRole = env->NewStringUTF(request->role.getCString()); |
env->NewStringUTF( |
jstring jResultRole = env->NewStringUTF(request->resultRole.getCString()); |
request->resultClass.getString().getCString()); |
|
jstring jRole = |
|
env->NewStringUTF(request->role.getCString()); |
|
jstring jResultRole = |
|
env->NewStringUTF(request->resultRole.getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: assocName = "<<assocPath->toString ()<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultClass = "<<request->resultClass<<PEGASUS_STD(endl)); |
"assocName = "<<assocPath->toString ()<<endl); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultRole = "<<request->resultRole<<PEGASUS_STD(endl)); |
"resultClass = "<<request->resultClass<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
|
"role = "<<request->role<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
|
"resultRole = "<<request->resultRole<<endl); |
#endif | #endif |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jAssociationName, | jAssociationName, |
|
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst); |
jlong jcopRetRef = env->CallLongMethod( |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef); |
jcopRet, |
|
JMPIjvm::jv.CIMObjectPathCInst); |
|
CIMObjectPath *copRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMObjectPath*, |
|
jcopRetRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_ASSOCIATORPROVIDER: | case METHOD_ASSOCIATORPROVIDER: |
{ | { |
jlong jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, assocPath); |
jlong jAssociationNameRef = DEBUG_ConvertCToJava( |
jobject jAssociationName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef); |
CIMObjectPath*, |
|
jlong, |
|
assocPath); |
|
jobject jAssociationName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jAssociationNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jPathNameRef = DEBUG_ConvertCToJava( |
jobject jPathName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jPathName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jPathNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString()); |
jstring jResultClass = |
jstring jRole = env->NewStringUTF(request->role.getCString()); |
env->NewStringUTF( |
jstring jResultRole = env->NewStringUTF(request->resultRole.getCString()); |
request->resultClass.getString().getCString()); |
|
jstring jRole = |
|
env->NewStringUTF(request->role.getCString()); |
|
jstring jResultRole = |
|
env->NewStringUTF(request->resultRole.getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: assocName = "<<assocPath->toString ()<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: pathName = "<<objectPath->toString ()<<PEGASUS_STD(endl)); |
"assocName = "<<assocPath->toString ()<<endl); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultClass = "<<request->resultClass<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
"pathName = "<<objectPath->toString ()<<endl); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultRole = "<<request->resultRole<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
|
"resultClass = "<<request->resultClass<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
|
"role = "<<request->role<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
|
"resultRole = "<<request->resultRole<<endl); |
#endif | #endif |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
jAssociationName, | jAssociationName, |
jPathName, | jPathName, |
|
|
| |
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++) |
|
{ |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jcopRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i); |
jobject jcopRet = env->CallObjectMethod( |
|
jVec, |
|
JMPIjvm::jv.VectorElementAt, |
|
i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst); |
jlong jcopRetRef = env->CallLongMethod( |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef); |
jcopRet, |
|
JMPIjvm::jv.CIMObjectPathCInst); |
|
CIMObjectPath *copRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMObjectPath*, |
|
jcopRetRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_ASSOCIATORPROVIDER2: | case METHOD_ASSOCIATORPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, assocPath); |
&request->operationContext); |
jobject jAssociationName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jAssociationNameRef = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
assocPath); |
|
jobject jAssociationName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jAssociationNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jPathNameRef = DEBUG_ConvertCToJava( |
jobject jPathName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jPathName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jPathNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jResultClass = env->NewStringUTF(request->resultClass.getString().getCString()); |
jstring jResultClass = |
jstring jRole = env->NewStringUTF(request->role.getCString()); |
env->NewStringUTF( |
jstring jResultRole = env->NewStringUTF(request->resultRole.getCString()); |
request->resultClass.getString().getCString()); |
|
jstring jRole = |
|
env->NewStringUTF(request->role.getCString()); |
|
jstring jResultRole = |
|
env->NewStringUTF(request->resultRole.getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: assocName = "<<assocPath->toString ()<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: pathName = "<<objectPath->toString ()<<PEGASUS_STD(endl)); |
"assocName = "<<assocPath->toString ()<<endl); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultClass = "<<request->resultClass<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
"pathName = "<<objectPath->toString ()<<endl); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultRole = "<<request->resultRole<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
|
"resultClass = "<<request->resultClass<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
|
"role = "<<request->role<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
|
"resultRole = "<<request->resultRole<<endl); |
#endif | #endif |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jAssociationName, | jAssociationName, |
|
|
| |
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++) |
|
{ |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jcopRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i); |
jobject jcopRet = env->CallObjectMethod( |
|
jVec, |
|
JMPIjvm::jv.VectorElementAt, |
|
i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst); |
jlong jcopRetRef = env->CallLongMethod( |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef); |
jcopRet, |
|
JMPIjvm::jv.CIMObjectPathCInst); |
|
CIMObjectPath *copRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMObjectPath*, |
|
jcopRetRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_UNKNOWN: | case METHOD_UNKNOWN: |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: should not be here!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleAssociatorNamesRequest: " |
|
"should not be here!"<<endl); |
break; | break; |
} | } |
} | } |
|
|
return(response); | return(response); |
} | } |
| |
Message * JMPIProviderManager::handleReferencesRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleReferencesRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleReferencesRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleReferencesRequest"); |
| |
HandlerIntro(References,message,request,response,handler); | HandlerIntro(References,message,request,response,handler); |
| |
|
|
METHOD_VERSION eMethodFound = METHOD_UNKNOWN; | METHOD_VERSION eMethodFound = METHOD_UNKNOWN; |
JNIEnv *env = NULL; | JNIEnv *env = NULL; |
| |
try { |
try |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
{ |
"JMPIProviderManager::handleReferencesRequest - Host name: $0 Name space: $1 Class name: $2", |
Logger::put( |
|
Logger::STANDARD_LOG, |
|
System::CIMSERVER, |
|
Logger::TRACE, |
|
"JMPIProviderManager::handleReferencesRequest - Host name: $0 " |
|
"Name space: $1 Class name: $2", |
System::getHostName(), | System::getHostName(), |
request->nameSpace.getString(), | request->nameSpace.getString(), |
request->objectName.getClassName().getString()); | request->objectName.getClassName().getString()); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", classname = "<<request->objectName.getClassName().getString()<<", result = "<<request->resultClass.getString()<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleReferencesRequest: " |
|
"hostname = "<<System::getHostName() |
|
<<", namespace = "<<request->nameSpace.getString() |
|
<<", classname = " |
|
<<request->objectName.getClassName().getString() |
|
<<", result = "<<request->resultClass.getString()<<endl); |
| |
// make target object path | // make target object path |
CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(), |
CIMObjectPath *objectPath = new CIMObjectPath( |
|
System::getHostName(), |
request->nameSpace, | request->nameSpace, |
request->objectName.getClassName(), | request->objectName.getClassName(), |
request->objectName.getKeyBindings()); | request->objectName.getKeyBindings()); |
CIMObjectPath *resultPath = new CIMObjectPath (System::getHostName(), |
CIMObjectPath *resultPath = new CIMObjectPath( |
|
System::getHostName(), |
request->nameSpace, | request->nameSpace, |
request->resultClass.getString()); | request->resultClass.getString()); |
| |
|
|
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 = providerManager.getProvider (name.getPhysicalName(), |
JMPIProvider::OpProviderHolder ph = |
|
providerManager.getProvider( |
|
name.getPhysicalName(), |
name.getLogicalName(), | name.getLogicalName(), |
String::EMPTY); | String::EMPTY); |
| |
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert( |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
request->operationContext.get(IdentityContainer::NAME)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
context.insert( |
|
request->operationContext.get(AcceptLanguageListContainer::NAME)); |
|
context.insert( |
|
request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
// forward request | // forward request |
JMPIProvider &pr = ph.GetProvider(); | JMPIProvider &pr = ph.GetProvider(); |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,"Calling provider.references: " + pr.getName()); |
PEG_TRACE_STRING( |
|
TRC_PROVIDERMANAGER, |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: Calling provider references: "<<pr.getName()<<", role: "<<request->role<<" aCls: "<<request->resultClass<<PEGASUS_STD(endl)); |
Tracer::LEVEL4, |
|
"Calling provider.references: " + pr.getName()); |
|
|
|
DDD(cout<<"--- JMPIProviderManager::handleReferencesRequest: " |
|
"Calling provider references: "<<pr.getName() |
|
<<", role: "<<request->role<<" aCls: " |
|
<<request->resultClass<<endl); |
| |
JvmVector *jv = 0; | JvmVector *jv = 0; |
| |
|
|
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED", |
CIM_ERR_FAILED, |
"Could not initialize the JVM (Java Virtual Machine) runtime environment.")); |
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); |
|
|
String interfaceType; | String interfaceType; |
String interfaceVersion; | String interfaceVersion; |
| |
getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME), |
getInterfaceType( |
|
request->operationContext.get(ProviderIdContainer::NAME), |
interfaceType, | interfaceType, |
interfaceVersion); | interfaceVersion); |
| |
if (interfaceType == "JMPI") | if (interfaceType == "JMPI") |
{ | { |
// public java.util.Vector references (org.pegasus.jmpi.CIMObjectPath assocName, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath pathName, |
(jclass)pr.jProviderClass, |
// java.lang.String role, |
|
// boolean includeQualifiers, |
|
// boolean includeClassOrigin, |
|
// java.lang.String[] propertyList) |
|
// throws org.pegasus.jmpi.CIMException |
|
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;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_ASSOCIATORPROVIDER; | eMethodFound = METHOD_ASSOCIATORPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_ASSOCIATORPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleReferencesRequest: " |
|
"found METHOD_ASSOCIATORPROVIDER."<<endl); |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
|
id = env->GetMethodID( |
// public org.pegasus.jmpi.CIMInstance[] references (org.pegasus.jmpi.CIMObjectPath assocName, |
(jclass)pr.jProviderClass, |
// 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", | "references", |
"(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMInstance;"); |
"(Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;" |
|
"ZZ[Ljava/lang/String;)" |
|
"[Lorg/pegasus/jmpi/CIMInstance;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_CIMASSOCIATORPROVIDER; | eMethodFound = METHOD_CIMASSOCIATORPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_CIMASSOCIATORPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleReferencesRequest:" |
|
" found METHOD_CIMASSOCIATORPROVIDER."<<endl); |
} | } |
} | } |
} | } |
else if (interfaceType == "JMPIExperimental") | else if (interfaceType == "JMPIExperimental") |
{ | { |
// public java.util.Vector references (org.pegasus.jmpi.OperationContext oc, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath assocName, |
(jclass)pr.jProviderClass, |
// 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", | "references", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;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;)Ljava/util/Vector;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_ASSOCIATORPROVIDER2; | eMethodFound = METHOD_ASSOCIATORPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_ASSOCIATORPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleReferencesRequest: " |
|
"found METHOD_ASSOCIATORPROVIDER2."<<endl); |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
|
id = env->GetMethodID( |
// public org.pegasus.jmpi.CIMInstance[] references (org.pegasus.jmpi.OperationContext oc, |
(jclass)pr.jProviderClass, |
// 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", | "references", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;ZZ[Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMInstance;"); |
"(Lorg/pegasus/jmpi/OperationContext;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Ljava/lang/String;ZZ[Ljava/lang/String;)" |
|
"[Lorg/pegasus/jmpi/CIMInstance;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_CIMASSOCIATORPROVIDER2; | eMethodFound = METHOD_CIMASSOCIATORPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found METHOD_CIMASSOCIATORPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleReferencesRequest:" |
|
" found METHOD_CIMASSOCIATORPROVIDER2."<<endl); |
} | } |
} | } |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: found no method!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleReferencesRequest: " |
|
"found no method!"<<endl); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND", |
CIM_ERR_FAILED, |
"Could not find a method for the provider based on InterfaceType.")); |
MessageLoaderParms( |
|
"ProviderManager.JMPI.METHOD_NOT_FOUND", |
|
"Could not find a method for the provider based on " |
|
"InterfaceType.")); |
} | } |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
|
|
{ | { |
case METHOD_CIMASSOCIATORPROVIDER: | case METHOD_CIMASSOCIATORPROVIDER: |
{ | { |
jlong jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, resultPath); |
jlong jAssociationNameRef = DEBUG_ConvertCToJava( |
jobject jAssociationName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef); |
CIMObjectPath*, |
|
jlong, |
|
resultPath); |
|
jobject jAssociationName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jAssociationNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jPathNameRef = DEBUG_ConvertCToJava( |
jobject jPathName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jPathName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jPathNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
jobjectArray jPropertyList = getList(jv,env,request->propertyList); | jobjectArray jPropertyList = getList(jv,env,request->propertyList); |
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: assocName = "<<resultPath->toString ()<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleReferencesRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
"assocName = " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeQualifiers = "<<false<<PEGASUS_STD(endl)); |
<<resultPath->toString ()<<endl); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleReferencesRequest: " |
|
"role = "<<request->role<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleReferencesRequest: " |
|
"includeQualifiers = "<<false<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleReferencesRequest: " |
|
"includeClassOrigin = "<<false<<endl); |
#endif | #endif |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
jAssociationName, | jAssociationName, |
jPathName, | jPathName, |
|
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
|
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
CIMClass cls; | CIMClass cls; |
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD (cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD (cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleReferences" |
|
"Request: Error: Caught CIMExcetion during" |
|
" cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
case METHOD_CIMASSOCIATORPROVIDER2: | case METHOD_CIMASSOCIATORPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, resultPath); |
&request->operationContext); |
jobject jAssociationName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jAssociationNameRef = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
resultPath); |
|
jobject jAssociationName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jAssociationNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jPathNameRef = DEBUG_ConvertCToJava( |
jobject jPathName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jPathName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jPathNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
jobjectArray jPropertyList = getList(jv,env,request->propertyList); | jobjectArray jPropertyList = getList(jv,env,request->propertyList); |
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: assocName = "<<resultPath->toString ()<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleReferencesRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
"assocName = " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeQualifiers = "<<false<<PEGASUS_STD(endl)); |
<<resultPath->toString ()<<endl); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleReferencesRequest: " |
|
"role = "<<request->role<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleReferencesRequest: " |
|
"includeQualifiers = "<<false<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleReferencesRequest: " |
|
"includeClassOrigin = "<<false<<endl); |
#endif | #endif |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jAssociationName, | jAssociationName, |
|
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
|
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
CIMClass cls; | CIMClass cls; |
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD(cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD (cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleReferences" |
|
"Request: Error: Caught CIMExcetion during" |
|
" cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
case METHOD_ASSOCIATORPROVIDER: | case METHOD_ASSOCIATORPROVIDER: |
{ | { |
jlong jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, resultPath); |
jlong jAssociationNameRef = DEBUG_ConvertCToJava( |
jobject jAssociationName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef); |
CIMObjectPath*, |
|
jlong, |
|
resultPath); |
|
jobject jAssociationName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jAssociationNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jPathNameRef = DEBUG_ConvertCToJava( |
jobject jPathName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jPathName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jPathNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
jobjectArray jPropertyList = getList(jv,env,request->propertyList); | jobjectArray jPropertyList = getList(jv,env,request->propertyList); |
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: assocName = "<<resultPath->toString ()<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleReferencesRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: pathName = "<<objectPath->toString ()<<PEGASUS_STD(endl)); |
"assocName = " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
<<resultPath->toString ()<<endl); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeQualifiers = "<<false<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleReferencesRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl)); |
"pathName = " |
|
<<objectPath->toString ()<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleReferencesRequest: " |
|
"role = "<<request->role<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleReferencesRequest: " |
|
"includeQualifiers = "<<false<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleReferencesRequest: " |
|
"includeClassOrigin = "<<false<<endl); |
#endif | #endif |
|
|
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
jAssociationName, | jAssociationName, |
jPathName, | jPathName, |
|
|
| |
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++) |
|
{ |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i); |
jobject jciRet = env->CallObjectMethod( |
|
jVec, |
|
JMPIjvm::jv.VectorElementAt, |
|
i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
|
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
CIMClass cls; | CIMClass cls; |
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD (cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD(cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleReferences" |
|
"Request: Error: Caught CIMExcetion during" |
|
" cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
case METHOD_ASSOCIATORPROVIDER2: | case METHOD_ASSOCIATORPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, resultPath); |
&request->operationContext); |
jobject jAssociationName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jAssociationNameRef = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
resultPath); |
|
jobject jAssociationName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jAssociationNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jPathNameRef = DEBUG_ConvertCToJava( |
jobject jPathName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jPathName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jPathNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
jobjectArray jPropertyList = getList(jv,env,request->propertyList); | jobjectArray jPropertyList = getList(jv,env,request->propertyList); |
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: assocName = "<<resultPath->toString ()<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleReferencesRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: pathName = "<<objectPath->toString ()<<PEGASUS_STD(endl)); |
"assocName = " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
<<resultPath->toString ()<<endl); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeQualifiers = "<<false<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleReferencesRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl)); |
"pathName = " |
|
<<objectPath->toString ()<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleReferencesRequest: " |
|
"role = "<<request->role<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleReferencesRequest: " |
|
"includeQualifiers = "<<false<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleReferencesRequest: " |
|
"includeClassOrigin = "<<false<<endl); |
#endif | #endif |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jAssociationName, | jAssociationName, |
|
|
| |
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++) |
|
{ |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i); |
jobject jciRet = env->CallObjectMethod( |
|
jVec, |
|
JMPIjvm::jv.VectorElementAt, |
|
i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jciRetRef = env->CallLongMethod(jciRet,JMPIjvm::jv.CIMInstanceCInst); |
jlong jciRetRef = env->CallLongMethod( |
CIMInstance *ciRet = DEBUG_ConvertJavaToC (jlong, CIMInstance*, jciRetRef); |
jciRet, |
|
JMPIjvm::jv.CIMInstanceCInst); |
|
CIMInstance *ciRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMInstance*, |
|
jciRetRef); |
CIMClass cls; | CIMClass cls; |
| |
try | try |
{ | { |
DDD (PEGASUS_STD(cout)<<"enter: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD(cout<<"enter: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
AutoMutex lock (pr._cimomMutex); | AutoMutex lock (pr._cimomMutex); |
| |
cls = pr._cimom_handle->getClass(context, | cls = pr._cimom_handle->getClass(context, |
|
|
true, | true, |
true, | true, |
CIMPropertyList()); | CIMPropertyList()); |
DDD (PEGASUS_STD(cout)<<"exit: cimom_handle->getClass("<<__LINE__<<") "<<ciRet->getClassName()<<PEGASUS_STD(endl)); |
DDD (cout<<"exit: cimom_handle->getClass(" |
|
<<__LINE__<<") "<<ciRet->getClassName()<<endl); |
} | } |
catch (CIMException e) | catch (CIMException e) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: Error: Caught CIMExcetion during cimom_handle->getClass("<<__LINE__<<") "<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleReferences" |
|
"Request: Error: Caught CIMExcetion during" |
|
" cimom_handle->getClass(" |
|
<<__LINE__<<") "<<endl); |
throw; | throw; |
} | } |
| |
|
|
| |
case METHOD_UNKNOWN: | case METHOD_UNKNOWN: |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferencesRequest: should not be here!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleReferencesRequest: " |
|
"should not be here!"<<endl); |
break; | break; |
} | } |
} | } |
|
|
return(response); | return(response); |
} | } |
| |
Message * JMPIProviderManager::handleReferenceNamesRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleReferenceNamesRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleReferenceNamesRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleReferenceNamesRequest"); |
| |
HandlerIntro(ReferenceNames,message,request,response,handler); | HandlerIntro(ReferenceNames,message,request,response,handler); |
| |
|
|
METHOD_VERSION eMethodFound = METHOD_UNKNOWN; | METHOD_VERSION eMethodFound = METHOD_UNKNOWN; |
JNIEnv *env = NULL; | JNIEnv *env = NULL; |
| |
try { |
try |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
{ |
"JMPIProviderManager::handleReferenceNamesRequest - Host name: $0 Name space: $1 Class name: $2", |
Logger::put( |
|
Logger::STANDARD_LOG, |
|
System::CIMSERVER, |
|
Logger::TRACE, |
|
"JMPIProviderManager::handleReferenceNamesRequest - Host name: $0 " |
|
"Name space: $1 Class name: $2", |
System::getHostName(), | System::getHostName(), |
request->nameSpace.getString(), | request->nameSpace.getString(), |
request->objectName.getClassName().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(cout<<"--- JMPIProviderManager::handleReferenceNamesRequest: " |
|
"hostname = "<<System::getHostName()<<", namespace = " |
|
<<request->nameSpace.getString()<<", classname = " |
|
<<request->objectName.getClassName().getString()<<endl); |
| |
// make target object path | // make target object path |
CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(), |
CIMObjectPath *objectPath = new CIMObjectPath( |
|
System::getHostName(), |
request->nameSpace, | request->nameSpace, |
request->objectName.getClassName(), | request->objectName.getClassName(), |
request->objectName.getKeyBindings()); | request->objectName.getKeyBindings()); |
CIMObjectPath *resultPath = new CIMObjectPath (System::getHostName(), |
CIMObjectPath *resultPath = new CIMObjectPath( |
|
System::getHostName(), |
request->nameSpace, | request->nameSpace, |
request->resultClass.getString()); | request->resultClass.getString()); |
| |
|
|
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 = providerManager.getProvider (name.getPhysicalName(), |
JMPIProvider::OpProviderHolder ph = providerManager.getProvider( |
|
name.getPhysicalName(), |
name.getLogicalName(), | name.getLogicalName(), |
String::EMPTY); | String::EMPTY); |
| |
JMPIProvider &pr = ph.GetProvider(); | JMPIProvider &pr = ph.GetProvider(); |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.referenceNames: " + pr.getName()); |
PEG_TRACE_STRING( |
|
TRC_PROVIDERMANAGER, |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: Calling provider referenceNames: "<<pr.getName()<<", role: "<<request->role<<", aCls: "<<request->resultClass<<PEGASUS_STD(endl)); |
Tracer::LEVEL4, |
|
"Calling provider.referenceNames: " + pr.getName()); |
|
|
|
DDD(cout<<"--- JMPIProviderManager::handleReferenceNamesRequest: " |
|
"Calling provider referenceNames: "<<pr.getName() |
|
<<", role: "<<request->role<<", aCls: " |
|
<<request->resultClass<<endl); |
| |
JvmVector *jv = 0; | JvmVector *jv = 0; |
| |
|
|
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED", |
CIM_ERR_FAILED, |
"Could not initialize the JVM (Java Virtual Machine) runtime environment.")); |
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); |
|
|
String interfaceType; | String interfaceType; |
String interfaceVersion; | String interfaceVersion; |
| |
getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME), |
getInterfaceType( |
|
request->operationContext.get(ProviderIdContainer::NAME), |
interfaceType, | interfaceType, |
interfaceVersion); | interfaceVersion); |
| |
if (interfaceType == "JMPI") | if (interfaceType == "JMPI") |
{ | { |
// public java.util.Vector referenceNames (org.pegasus.jmpi.CIMObjectPath assocName, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath pathName, |
(jclass)pr.jProviderClass, |
// java.lang.String role) |
|
// throws org.pegasus.jmpi.CIMException |
|
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;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_ASSOCIATORPROVIDER; | eMethodFound = METHOD_ASSOCIATORPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found METHOD_ASSOCIATORPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleReferenceNamesRequest:" |
|
" found METHOD_ASSOCIATORPROVIDER."<<endl); |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
| |
// public org.pegasus.jmpi.CIMObjectPath[] referenceNames (org.pegasus.jmpi.CIMObjectPath assocName, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath pathName, |
(jclass)pr.jProviderClass, |
// java.lang.String role) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"referenceNames", | "referenceNames", |
"(Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMObjectPath;"); |
"(Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;" |
|
")[Lorg/pegasus/jmpi/CIMObjectPath;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_CIMASSOCIATORPROVIDER; | eMethodFound = METHOD_CIMASSOCIATORPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found METHOD_CIMASSOCIATORPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleReferenceNames" |
|
"Request: found METHOD_CIMASSOCIATORPROVIDER." |
|
<<endl); |
} | } |
} | } |
} | } |
else if (interfaceType == "JMPIExperimental") | else if (interfaceType == "JMPIExperimental") |
{ | { |
// public java.util.Vector referenceNames (org.pegasus.jmpi.OperationContext oc, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath assocName, |
(jclass)pr.jProviderClass, |
// org.pegasus.jmpi.CIMObjectPath pathName, |
|
// java.lang.String role) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"referenceNames", | "referenceNames", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;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;" |
|
")Ljava/util/Vector;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_ASSOCIATORPROVIDER2; | eMethodFound = METHOD_ASSOCIATORPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found METHOD_ASSOCIATORPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleReferenceNamesRequest:" |
|
" found METHOD_ASSOCIATORPROVIDER2."<<endl); |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
|
id = env->GetMethodID( |
// public org.pegasus.jmpi.CIMObjectPath[] referenceNames (org.pegasus.jmpi.OperationContext oc, |
(jclass)pr.jProviderClass, |
// 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", | "referenceNames", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;)[Lorg/pegasus/jmpi/CIMObjectPath;"); |
"(Lorg/pegasus/jmpi/OperationContext;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;" |
|
"Ljava/lang/String;)" |
|
"[Lorg/pegasus/jmpi/CIMObjectPath;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_CIMASSOCIATORPROVIDER2; | eMethodFound = METHOD_CIMASSOCIATORPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found METHOD_CIMASSOCIATORPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleReferenceNames" |
|
"Request: found METHOD_CIMASSOCIATORPROVIDER2." |
|
<<endl); |
} | } |
} | } |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: found no method!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleReferenceNamesRequest: " |
|
"found no method!"<<endl); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND", |
CIM_ERR_FAILED, |
"Could not find a method for the provider based on InterfaceType.")); |
MessageLoaderParms( |
|
"ProviderManager.JMPI.METHOD_NOT_FOUND", |
|
"Could not find a method for the provider based on " |
|
"InterfaceType.")); |
} | } |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
|
|
{ | { |
case METHOD_CIMASSOCIATORPROVIDER: | case METHOD_CIMASSOCIATORPROVIDER: |
{ | { |
jlong jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, resultPath); |
jlong jAssociationNameRef = DEBUG_ConvertCToJava( |
jobject jAssociationName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef); |
CIMObjectPath*, |
|
jlong, |
|
resultPath); |
|
jobject jAssociationName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jAssociationNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jPathNameRef = DEBUG_ConvertCToJava( |
jobject jPathName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jPathName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jPathNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: assocName = "<<objectPath->toString ()<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleReferenceNamesRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
"assocName = " |
|
<<objectPath->toString ()<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleReferenceNamesRequest: " |
|
"role = "<<request->role<<endl); |
#endif | #endif |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
jPathName, | jPathName, |
jAssociationName, | jAssociationName, |
|
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst); |
jlong jcopRetRef = env->CallLongMethod( |
|
jcopRet, |
|
JMPIjvm::jv.CIMObjectPathCInst); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef); |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMObjectPath*, |
|
jcopRetRef); |
| |
handler.deliver(*copRet); | handler.deliver(*copRet); |
} | } |
|
|
| |
case METHOD_CIMASSOCIATORPROVIDER2: | case METHOD_CIMASSOCIATORPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, resultPath); |
&request->operationContext); |
jobject jAssociationName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jAssociationNameRef = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
resultPath); |
|
jobject jAssociationName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jAssociationNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jPathNameRef = DEBUG_ConvertCToJava( |
jobject jPathName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jPathName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jPathNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: assocName = "<<objectPath->toString ()<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleReferenceNamesRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
"assocName = " |
|
<<objectPath->toString ()<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleReferenceNamesRequest: " |
|
"role = "<<request->role<<endl); |
#endif | #endif |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jPathName, | jPathName, |
|
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst); |
jlong jcopRetRef = env->CallLongMethod( |
|
jcopRet, |
|
JMPIjvm::jv.CIMObjectPathCInst); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef); |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMObjectPath*, |
|
jcopRetRef); |
| |
handler.deliver(*copRet); | handler.deliver(*copRet); |
} | } |
|
|
| |
case METHOD_ASSOCIATORPROVIDER: | case METHOD_ASSOCIATORPROVIDER: |
{ | { |
jlong jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, resultPath); |
jlong jAssociationNameRef = DEBUG_ConvertCToJava( |
jobject jAssociationName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef); |
CIMObjectPath*, |
|
jlong, |
|
resultPath); |
|
jobject jAssociationName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jAssociationNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jPathNameRef = DEBUG_ConvertCToJava( |
jobject jPathName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jPathName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jPathNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: assocName = "<<objectPath->toString ()<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleReferenceNamesRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: pathName = "<<resultPath->toString ()<<PEGASUS_STD(endl)); |
"assocName = " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
<<objectPath->toString ()<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleReferenceNamesRequest: " |
|
"pathName = " |
|
<<resultPath->toString ()<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleReferenceNamesRequest: " |
|
"role = "<<request->role<<endl); |
#endif | #endif |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
jAssociationName, | jAssociationName, |
jPathName, | jPathName, |
|
|
| |
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++) |
|
{ |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jcopRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i); |
jobject jcopRet = env->CallObjectMethod( |
|
jVec, |
|
JMPIjvm::jv.VectorElementAt, |
|
i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst); |
jlong jcopRetRef = env->CallLongMethod( |
|
jcopRet, |
|
JMPIjvm::jv.CIMObjectPathCInst); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef); |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMObjectPath*, |
|
jcopRetRef); |
| |
handler.deliver(*copRet); | handler.deliver(*copRet); |
} | } |
|
|
| |
case METHOD_ASSOCIATORPROVIDER2: | case METHOD_ASSOCIATORPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jAssociationNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, resultPath); |
&request->operationContext); |
jobject jAssociationName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jAssociationNameRef); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jAssociationNameRef = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
resultPath); |
|
jobject jAssociationName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jAssociationNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jPathNameRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jPathNameRef = DEBUG_ConvertCToJava( |
jobject jPathName = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jPathNameRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jPathName = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jPathNameRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: assocName = "<<objectPath->toString ()<<PEGASUS_STD(endl)); |
DDD(cerr<<"--- JMPIProviderManager::handleReferenceNamesRequest: " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: pathName = "<<resultPath->toString ()<<PEGASUS_STD(endl)); |
"assocName = " |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
<<objectPath->toString ()<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleReferenceNamesRequest: " |
|
"pathName = " |
|
<<resultPath->toString ()<<endl); |
|
DDD(cerr<<"--- JMPIProviderManager::handleReferenceNamesRequest: " |
|
"role = "<<request->role<<endl); |
#endif | #endif |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod( |
|
(jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jAssociationName, | jAssociationName, |
|
|
| |
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); |
JMPIjvm::checkException(env); |
i<m; i++) |
|
{ |
jobject jcopRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i); |
|
|
|
JMPIjvm::checkException(env); |
|
|
|
jlong jcopRetRef = env->CallLongMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst); |
|
|
|
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
|
jobject jcopRet = env->CallObjectMethod( |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jlong, CIMObjectPath*, jcopRetRef); |
jVec, |
|
JMPIjvm::jv.VectorElementAt, |
|
i); |
|
JMPIjvm::checkException(env); |
|
jlong jcopRetRef = env->CallLongMethod( |
|
jcopRet, |
|
JMPIjvm::jv.CIMObjectPathCInst); |
|
JMPIjvm::checkException(env); |
|
CIMObjectPath *copRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMObjectPath*, |
|
jcopRetRef); |
handler.deliver(*copRet); | handler.deliver(*copRet); |
} | } |
} | } |
|
|
| |
case METHOD_UNKNOWN: | case METHOD_UNKNOWN: |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleReferenceNamesRequest: should not be here!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleReferenceNamesRequest: " |
|
"should not be here!"<<endl); |
break; | break; |
} | } |
} | } |
|
|
return(response); | return(response); |
} | } |
| |
Message * JMPIProviderManager::handleGetPropertyRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleGetPropertyRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleGetPropertyRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleGetPropertyRequest"); |
| |
HandlerIntro(GetProperty,message,request,response,handler); | HandlerIntro(GetProperty,message,request,response,handler); |
| |
|
|
JNIEnv *env = NULL; | JNIEnv *env = NULL; |
| |
try { | try { |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
Logger::put( |
"JMPIProviderManager::handleGetPropertyRequest - Host name: $0 Name space: $1 Class name: $2", |
Logger::STANDARD_LOG, |
|
System::CIMSERVER, |
|
Logger::TRACE, |
|
"JMPIProviderManager::handleGetPropertyRequest - Host name: $0 " |
|
"Name space: $1 Class name: $2", |
System::getHostName(), | System::getHostName(), |
request->nameSpace.getString(), | request->nameSpace.getString(), |
request->instanceName.getClassName().getString()); | request->instanceName.getClassName().getString()); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetPropertyRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", classname = "<<request->className.getString()<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleGetPropertyRequest: " |
|
"hostname = "<<System::getHostName()<<", namespace = " |
|
<<request->nameSpace.getString()<<", classname = " |
|
<<request->className.getString()<<endl); |
| |
// make target object path | // make target object path |
CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(), |
CIMObjectPath *objectPath = new CIMObjectPath( |
|
System::getHostName(), |
request->nameSpace, | request->nameSpace, |
request->instanceName.getClassName(), | request->instanceName.getClassName(), |
request->instanceName.getKeyBindings()); | request->instanceName.getKeyBindings()); |
|
|
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 = providerManager.getProvider (name.getPhysicalName(), |
JMPIProvider::OpProviderHolder ph = providerManager.getProvider( |
|
name.getPhysicalName(), |
name.getLogicalName(), | name.getLogicalName(), |
String::EMPTY); | String::EMPTY); |
| |
// forward request | // forward request |
JMPIProvider &pr = ph.GetProvider(); | JMPIProvider &pr = ph.GetProvider(); |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,"Calling provider.getPropertyValue: " + pr.getName()); |
PEG_TRACE_STRING( |
|
TRC_PROVIDERMANAGER, |
|
Tracer::LEVEL4, |
|
"Calling provider.getPropertyValue: " + pr.getName()); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetPropertyRequest: Calling provider getPropertyValue: "<<pr.getName()<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleGetPropertyRequest: " |
|
"Calling provider getPropertyValue: "<<pr.getName()<<endl); |
| |
JvmVector *jv = 0; | JvmVector *jv = 0; |
| |
|
|
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED", |
CIM_ERR_FAILED, |
"Could not initialize the JVM (Java Virtual Machine) runtime environment.")); |
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); |
|
|
String interfaceType; | String interfaceType; |
String interfaceVersion; | String interfaceVersion; |
| |
getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME), |
getInterfaceType( |
|
request->operationContext.get(ProviderIdContainer::NAME), |
interfaceType, | interfaceType, |
interfaceVersion); | interfaceVersion); |
| |
if (interfaceType == "JMPI") | if (interfaceType == "JMPI") |
{ | { |
// public abstract org.pegasus.jmpi.CIMValue getPropertyValue (org.pegasus.jmpi.CIMObjectPath cop, |
id = env->GetMethodID( |
// java.lang.String oclass, |
(jclass)pr.jProviderClass, |
// java.lang.String pName) |
|
// throws org.pegasus.jmpi.CIMException |
|
// |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"getPropertyValue", | "getPropertyValue", |
"(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;)Lorg/pegasus/jmpi/CIMValue;"); |
"(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;" |
|
"Ljava/lang/String;)Lorg/pegasus/jmpi/CIMValue;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_PROPERTYPROVIDER; | eMethodFound = METHOD_PROPERTYPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetPropertyRequest: found METHOD_PROPERTYPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleGetPropertyRequest: " |
|
"found METHOD_PROPERTYPROVIDER."<<endl); |
} | } |
} | } |
else if (interfaceType == "JMPIExperimental") | else if (interfaceType == "JMPIExperimental") |
{ | { |
// public abstract org.pegasus.jmpi.CIMValue getPropertyValue (org.pegasus.jmpi.OperationContext oc, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath cop, |
(jclass)pr.jProviderClass, |
// java.lang.String oclass, |
|
// java.lang.String pName) |
|
// throws org.pegasus.jmpi.CIMException |
|
// |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"getPropertyValue", | "getPropertyValue", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;)Lorg/pegasus/jmpi/CIMValue;"); |
"(Lorg/pegasus/jmpi/OperationContext;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;" |
|
"Ljava/lang/String;)Lorg/pegasus/jmpi/CIMValue;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_PROPERTYPROVIDER2; | eMethodFound = METHOD_PROPERTYPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetPropertyRequest: found METHOD_PROPERTYPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleGetPropertyRequest: " |
|
"found METHOD_PROPERTYPROVIDER2."<<endl); |
} | } |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetPropertyRequest: found no method!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleGetPropertyRequest: " |
|
"found no method!"<<endl); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND", |
CIM_ERR_FAILED, |
"Could not find a method for the provider based on InterfaceType.")); |
MessageLoaderParms( |
|
"ProviderManager.JMPI.METHOD_NOT_FOUND", |
|
"Could not find a method for the provider based on " |
|
"InterfaceType.")); |
} | } |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
|
|
{ | { |
case METHOD_PROPERTYPROVIDER: | case METHOD_PROPERTYPROVIDER: |
{ | { |
jlong jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jcopref = DEBUG_ConvertCToJava( |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewJ, jcopref); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopref); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring joclass = env->NewStringUTF(request->instanceName.getClassName().getString().getCString()); |
jstring joclass = |
|
env->NewStringUTF( |
|
request->instanceName.getClassName().getString().getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jpName = env->NewStringUTF(request->propertyName.getString().getCString()); |
jstring jpName = |
|
env->NewStringUTF( |
|
request->propertyName.getString().getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
if (jvalRet) | if (jvalRet) |
{ | { |
jlong jvalRetRef = env->CallLongMethod(jvalRet,JMPIjvm::jv.CIMValueCInst); |
jlong jvalRetRef = env->CallLongMethod( |
CIMValue *valRet = DEBUG_ConvertJavaToC (jlong, CIMValue*, jvalRetRef); |
jvalRet, |
|
JMPIjvm::jv.CIMValueCInst); |
|
CIMValue *valRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMValue*, |
|
jvalRetRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_PROPERTYPROVIDER2: | case METHOD_PROPERTYPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
|
&request->operationContext); |
|
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
| |
jlong jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jcopref = DEBUG_ConvertCToJava( |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewJ, jcopref); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopref); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring joclass = env->NewStringUTF(request->instanceName.getClassName().getString().getCString()); |
jstring joclass = env->NewStringUTF( |
|
request->instanceName.getClassName().getString().getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jpName = env->NewStringUTF(request->propertyName.getString().getCString()); |
jstring jpName = env->NewStringUTF( |
|
request->propertyName.getString().getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
if (jvalRet) | if (jvalRet) |
{ | { |
jlong jvalRetRef = env->CallLongMethod(jvalRet,JMPIjvm::jv.CIMValueCInst); |
jlong jvalRetRef = env->CallLongMethod( |
CIMValue *valRet = DEBUG_ConvertJavaToC (jlong, CIMValue*, jvalRetRef); |
jvalRet, |
|
JMPIjvm::jv.CIMValueCInst); |
|
CIMValue *valRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMValue*, |
|
jvalRetRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_UNKNOWN: | case METHOD_UNKNOWN: |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleGetPropertyRequest: should not be here!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleGetPropertyRequest: " |
|
"should not be here!"<<endl); |
break; | break; |
} | } |
} | } |
|
|
return(response); | return(response); |
} | } |
| |
Message * JMPIProviderManager::handleSetPropertyRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleSetPropertyRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleSetPropertyRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleSetPropertyRequest"); |
| |
HandlerIntro(SetProperty,message,request,response,handler); | HandlerIntro(SetProperty,message,request,response,handler); |
| |
|
|
METHOD_VERSION eMethodFound = METHOD_UNKNOWN; | METHOD_VERSION eMethodFound = METHOD_UNKNOWN; |
JNIEnv *env = NULL; | JNIEnv *env = NULL; |
| |
try { |
try |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
{ |
"JMPIProviderManager::handleSetPropertyRequest - Host name: $0 Name space: $1 Class name: $2", |
Logger::put( |
|
Logger::STANDARD_LOG, |
|
System::CIMSERVER, |
|
Logger::TRACE, |
|
"JMPIProviderManager::handleSetPropertyRequest - Host name: $0 " |
|
"Name space: $1 Class name: $2", |
System::getHostName(), | System::getHostName(), |
request->nameSpace.getString(), | request->nameSpace.getString(), |
request->instanceName.getClassName().getString()); | request->instanceName.getClassName().getString()); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleSetPropertyRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", classname = "<<request->className.getString()<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleSetPropertyRequest: hostname " |
|
"= "<<System::getHostName()<<", namespace = " |
|
<<request->nameSpace.getString()<<", classname = " |
|
<<request->className.getString()<<endl); |
| |
// make target object path | // make target object path |
CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(), |
CIMObjectPath *objectPath = new CIMObjectPath( |
|
System::getHostName(), |
request->nameSpace, | request->nameSpace, |
request->instanceName.getClassName(), | request->instanceName.getClassName(), |
request->instanceName.getKeyBindings()); | request->instanceName.getKeyBindings()); |
|
|
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 = providerManager.getProvider (name.getPhysicalName(), |
JMPIProvider::OpProviderHolder ph = providerManager.getProvider( |
|
name.getPhysicalName(), |
name.getLogicalName(), | name.getLogicalName(), |
String::EMPTY); | String::EMPTY); |
| |
// forward request | // forward request |
JMPIProvider &pr = ph.GetProvider(); | JMPIProvider &pr = ph.GetProvider(); |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,"Calling provider.setPropertyValue: " + pr.getName()); |
PEG_TRACE_STRING( |
|
TRC_PROVIDERMANAGER, |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleSetPropertyRequest: Calling provider setPropertyValue: "<<pr.getName()<<PEGASUS_STD(endl)); |
Tracer::LEVEL4, |
|
"Calling provider.setPropertyValue: " + pr.getName()); |
|
|
|
DDD(cout<<"--- JMPIProviderManager::handleSetPropertyRequest: " |
|
"Calling provider setPropertyValue: " |
|
<<pr.getName()<<endl); |
| |
JvmVector *jv = 0; | JvmVector *jv = 0; |
| |
|
|
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED", |
CIM_ERR_FAILED, |
"Could not initialize the JVM (Java Virtual Machine) runtime environment.")); |
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); |
|
|
String interfaceType; | String interfaceType; |
String interfaceVersion; | String interfaceVersion; |
| |
getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME), |
getInterfaceType( |
|
request->operationContext.get(ProviderIdContainer::NAME), |
interfaceType, | interfaceType, |
interfaceVersion); | interfaceVersion); |
| |
if (interfaceType == "JMPI") | if (interfaceType == "JMPI") |
{ | { |
// public abstract void setPropertyValue (org.pegasus.jmpi.CIMObjectPath cop, |
id = env->GetMethodID( |
// java.lang.String oclass, |
(jclass)pr.jProviderClass, |
// java.lang.String pName, |
|
// org.pegasus.jmpi.CIMValue val) |
|
// throws org.pegasus.jmpi.CIMException |
|
// |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"setPropertyValue", | "setPropertyValue", |
"(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Lorg/pegasus/jmpi/CIMValue;)V"); |
"(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;" |
|
"Ljava/lang/String;Lorg/pegasus/jmpi/CIMValue;)V"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_PROPERTYPROVIDER; | eMethodFound = METHOD_PROPERTYPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleSetPropertyRequest: found METHOD_PROPERTYPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleSetPropertyRequest: " |
|
"found METHOD_PROPERTYPROVIDER."<<endl); |
} | } |
} | } |
else if (interfaceType == "JMPIExperimental") | else if (interfaceType == "JMPIExperimental") |
{ | { |
// public abstract void setPropertyValue (org.pegasus.jmpi.OperationContext oc, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath cop, |
(jclass)pr.jProviderClass, |
// 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", | "setPropertyValue", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/lang/String;Lorg/pegasus/jmpi/CIMValue;)V"); |
"(Lorg/pegasus/jmpi/OperationContext;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;" |
|
"Ljava/lang/String;Lorg/pegasus/jmpi/CIMValue;)V"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_PROPERTYPROVIDER2; | eMethodFound = METHOD_PROPERTYPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleSetPropertyRequest: found METHOD_PROPERTYPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleSetPropertyRequest: " |
|
"found METHOD_PROPERTYPROVIDER2."<<endl); |
} | } |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleSetPropertyRequest: found no method!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleSetPropertyRequest: " |
|
"found no method!"<<endl); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND", |
CIM_ERR_FAILED, |
"Could not find a method for the provider based on InterfaceType.")); |
MessageLoaderParms( |
|
"ProviderManager.JMPI.METHOD_NOT_FOUND", |
|
"Could not find a method for the provider based on " |
|
"InterfaceType.")); |
} | } |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
|
|
{ | { |
case METHOD_PROPERTYPROVIDER: | case METHOD_PROPERTYPROVIDER: |
{ | { |
jlong jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jcopref = DEBUG_ConvertCToJava( |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewJ, jcopref); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopref); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring joclass = env->NewStringUTF(request->instanceName.getClassName().getString().getCString()); |
jstring joclass = |
|
env->NewStringUTF( |
|
request->instanceName.getClassName().getString().getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jpName = env->NewStringUTF(request->propertyName.getString().getCString()); |
jstring jpName = |
|
env->NewStringUTF( |
|
request->propertyName.getString().getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jvalref = DEBUG_ConvertCToJava (CIMValue*, jlong, val); | jlong jvalref = DEBUG_ConvertCToJava (CIMValue*, jlong, val); |
jobject jval = env->NewObject(jv->CIMValueClassRef, jv->CIMValueNewJ, jvalref); |
jobject jval = env->NewObject( |
|
jv->CIMValueClassRef, |
|
jv->CIMValueNewJ, |
|
jvalref); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_PROPERTYPROVIDER2: | case METHOD_PROPERTYPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jcopref = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
&request->operationContext); |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef, jv->CIMObjectPathNewJ, jcopref); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jcopref = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopref); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring joclass = env->NewStringUTF(request->instanceName.getClassName().getString().getCString()); |
jstring joclass = |
|
env->NewStringUTF( |
|
request->instanceName.getClassName().getString().getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jpName = env->NewStringUTF(request->propertyName.getString().getCString()); |
jstring jpName = |
|
env->NewStringUTF( |
|
request->propertyName.getString().getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jvalref = DEBUG_ConvertCToJava (CIMValue*, jlong, val); | jlong jvalref = DEBUG_ConvertCToJava (CIMValue*, jlong, val); |
jobject jval = env->NewObject(jv->CIMValueClassRef, jv->CIMValueNewJ, jvalref); |
jobject jval = env->NewObject( |
|
jv->CIMValueClassRef, |
|
jv->CIMValueNewJ, |
|
jvalref); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_UNKNOWN: | case METHOD_UNKNOWN: |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleSetPropertyRequest: should not be here!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleSetPropertyRequest: " |
|
"should not be here!"<<endl); |
break; | break; |
} | } |
} | } |
|
|
return(response); | return(response); |
} | } |
| |
Message * JMPIProviderManager::handleInvokeMethodRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleInvokeMethodRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleInvokeMethodRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleInvokeMethodRequest"); |
| |
HandlerIntro(InvokeMethod,message,request,response,handler); | HandlerIntro(InvokeMethod,message,request,response,handler); |
| |
|
|
JNIEnv *env = NULL; | JNIEnv *env = NULL; |
| |
try { | try { |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
Logger::put( |
"JMPIProviderManager::handleInvokeMethodRequest - Host name: $0 Name space: $1 Class name: $2", |
Logger::STANDARD_LOG, |
|
System::CIMSERVER, |
|
Logger::TRACE, |
|
"JMPIProviderManager::handleInvokeMethodRequest - Host name: $0 " |
|
"Name space: $1 Class name: $2", |
System::getHostName(), | System::getHostName(), |
request->nameSpace.getString(), | request->nameSpace.getString(), |
request->instanceName.getClassName().getString()); | request->instanceName.getClassName().getString()); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleInvokeMethodRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", classname = "<<request->instanceName.getClassName().getString()<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleInvokeMethodRequest: " |
|
"hostname = "<<System::getHostName()<<", namespace = " |
|
<<request->nameSpace.getString()<<", classname = " |
|
<<request->instanceName.getClassName().getString()<<endl); |
| |
// make target object path | // make target object path |
CIMObjectPath *objectPath = new CIMObjectPath (System::getHostName(), |
CIMObjectPath *objectPath = new CIMObjectPath( |
|
System::getHostName(), |
request->nameSpace, | request->nameSpace, |
request->instanceName.getClassName(), | request->instanceName.getClassName(), |
request->instanceName.getKeyBindings()); | request->instanceName.getKeyBindings()); |
|
|
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 = providerManager.getProvider (name.getPhysicalName(), |
JMPIProvider::OpProviderHolder ph = providerManager.getProvider( |
|
name.getPhysicalName(), |
name.getLogicalName(), | name.getLogicalName(), |
String::EMPTY); | String::EMPTY); |
| |
JMPIProvider &pr=ph.GetProvider(); | JMPIProvider &pr=ph.GetProvider(); |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.invokeMethod: " + pr.getName()); |
PEG_TRACE_STRING( |
|
TRC_PROVIDERMANAGER, |
|
Tracer::LEVEL4, |
|
"Calling provider.invokeMethod: " + pr.getName()); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleInvokeMethodRequest: Calling provider invokeMethod: "<<pr.getName()<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleInvokeMethodRequest: " |
|
"Calling provider invokeMethod: "<<pr.getName()<<endl); |
| |
JvmVector *jv = 0; | JvmVector *jv = 0; |
| |
|
|
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED", |
CIM_ERR_FAILED, |
"Could not initialize the JVM (Java Virtual Machine) runtime environment.")); |
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); |
|
|
String interfaceType; | String interfaceType; |
String interfaceVersion; | String interfaceVersion; |
| |
getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME), |
getInterfaceType( |
|
request->operationContext.get(ProviderIdContainer::NAME), |
interfaceType, | interfaceType, |
interfaceVersion); | interfaceVersion); |
| |
if (interfaceType == "JMPI") | if (interfaceType == "JMPI") |
{ | { |
// public abstract org.pegasus.jmpi.CIMValue invokeMethod (org.pegasus.jmpi.CIMObjectPath cop, |
id = env->GetMethodID( |
// java.lang.String name, |
(jclass)pr.jProviderClass, |
// java.util.Vector in, |
|
// java.util.Vector out) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"invokeMethod", | "invokeMethod", |
"(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/util/Vector;Ljava/util/Vector;)Lorg/pegasus/jmpi/CIMValue;"); |
"(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;" |
|
"Ljava/util/Vector;Ljava/util/Vector;)" |
|
"Lorg/pegasus/jmpi/CIMValue;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_METHODPROVIDER; | eMethodFound = METHOD_METHODPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleInvokeMethodRequest: found METHOD_METHODPROVIDER."<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::handleInvokeMethodRequest: " |
|
"found METHOD_METHODPROVIDER."<<endl); |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
|
id = env->GetMethodID( |
// public org.pegasus.jmpi.CIMValue invokeMethod (org.pegasus.jmpi.CIMObjectPath op, |
(jclass)pr.jProviderClass, |
// 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", | "invokeMethod", |
"(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;[Lorg/pegasus/jmpi/CIMArgument;[Lorg/pegasus/jmpi/CIMArgument;)Lorg/pegasus/jmpi/CIMValue;"); |
"(Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;" |
|
"[Lorg/pegasus/jmpi/CIMArgument;" |
|
"[Lorg/pegasus/jmpi/CIMArgument;)" |
|
"Lorg/pegasus/jmpi/CIMValue;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_CIMMETHODPROVIDER; | eMethodFound = METHOD_CIMMETHODPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleInvokeMethodRequest: found METHOD_CIMMETHODPROVIDER."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleInvokeMethod" |
|
"Request: found METHOD_CIMMETHODPROVIDER." |
|
<<endl); |
} | } |
} | } |
} | } |
else if (interfaceType == "JMPIExperimental") | else if (interfaceType == "JMPIExperimental") |
{ | { |
// public abstract org.pegasus.jmpi.CIMValue invokeMethod (org.pegasus.jmpi.OperationContext oc, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath cop, |
(jclass)pr.jProviderClass, |
// java.lang.String name, |
|
// java.util.Vector in, |
|
// java.util.Vector out) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"invokeMethod", | "invokeMethod", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;Ljava/util/Vector;Ljava/util/Vector;)Lorg/pegasus/jmpi/CIMValue;"); |
"(Lorg/pegasus/jmpi/OperationContext;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;" |
|
"Ljava/util/Vector;Ljava/util/Vector;)" |
|
"Lorg/pegasus/jmpi/CIMValue;"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_METHODPROVIDER2; | eMethodFound = METHOD_METHODPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleInvokeMethodRequest: found METHOD_METHODPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleInvokeMethodRequest: " |
|
"found METHOD_METHODPROVIDER2."<<endl); |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
| |
// public org.pegasus.jmpi.CIMValue invokeMethod (org.pegasus.jmpi.OperationContext oc, |
id = env->GetMethodID( |
// org.pegasus.jmpi.CIMObjectPath op, |
(jclass)pr.jProviderClass, |
// 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", | "invokeMethod", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/CIMObjectPath;Ljava/lang/String;[Lorg/pegasus/jmpi/CIMArgument;[Lorg/pegasus/jmpi/CIMArgument;)Lorg/pegasus/jmpi/CIMValue;"); |
"(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) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_CIMMETHODPROVIDER2; | eMethodFound = METHOD_CIMMETHODPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleInvokeMethodRequest: found METHOD_CIMMETHODPROVIDER2."<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleInvokeMethod" |
|
"Request: found METHOD_CIMMETHODPROVIDER2." |
|
<<endl); |
} | } |
} | } |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleInvokeMethodRequest: No method found!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleInvokeMethodRequest:" |
|
" No method found!"<<endl); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND", |
CIM_ERR_FAILED, |
"Could not find a method for the provider based on InterfaceType.")); |
MessageLoaderParms( |
|
"ProviderManager.JMPI.METHOD_NOT_FOUND", |
|
"Could not find a method for the provider based on " |
|
"InterfaceType.")); |
} | } |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
|
|
{ | { |
case METHOD_CIMMETHODPROVIDER: | case METHOD_CIMMETHODPROVIDER: |
{ | { |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jcopRef = DEBUG_ConvertCToJava( |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jMethod = env->NewStringUTF(request->methodName.getString().getCString()); |
jstring jMethod = |
|
env->NewStringUTF( |
|
request->methodName.getString().getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
Uint32 m=request->inParameters.size(); | Uint32 m=request->inParameters.size(); |
| |
jobjectArray jArIn=(jobjectArray)env->NewObjectArray(m,jv->CIMArgumentClassRef,NULL); |
jobjectArray jArIn=(jobjectArray)env->NewObjectArray( |
|
m, |
|
jv->CIMArgumentClassRef, |
|
NULL); |
| |
for (Uint32 i=0; i<m; i++) { | for (Uint32 i=0; i<m; i++) { |
CIMParamValue *parm = new CIMParamValue(request->inParameters[i]); | CIMParamValue *parm = new CIMParamValue(request->inParameters[i]); |
jlong jArgRef = DEBUG_ConvertCToJava (CIMParamValue*, jlong, parm); | jlong jArgRef = DEBUG_ConvertCToJava (CIMParamValue*, jlong, parm); |
jobject jArg = env->NewObject(jv->CIMArgumentClassRef,jv->CIMArgumentNewJ,jArgRef); |
jobject jArg = env->NewObject( |
|
jv->CIMArgumentClassRef, |
|
jv->CIMArgumentNewJ, |
|
jArgRef); |
| |
env->SetObjectArrayElement(jArIn,i,jArg); | env->SetObjectArrayElement(jArIn,i,jArg); |
} | } |
| |
jobjectArray jArOut=(jobjectArray)env->NewObjectArray(24,jv->CIMArgumentClassRef,NULL); |
jobjectArray jArOut=(jobjectArray)env->NewObjectArray( |
|
24, |
|
jv->CIMArgumentClassRef, |
|
NULL); |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
|
|
| |
handler.processing(); | handler.processing(); |
| |
jlong jValueRetRef = env->CallLongMethod(jValueRet,JMPIjvm::jv.CIMValueCInst); |
jlong jValueRetRef = env->CallLongMethod( |
CIMValue *valueRet = DEBUG_ConvertJavaToC (jlong, CIMValue*, jValueRetRef); |
jValueRet, |
|
JMPIjvm::jv.CIMValueCInst); |
|
CIMValue *valueRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMValue*, |
|
jValueRetRef); |
| |
handler.deliver(*valueRet); | handler.deliver(*valueRet); |
| |
|
|
if (jArg==NULL) | if (jArg==NULL) |
break; | break; |
| |
jlong jpRef = env->CallLongMethod(jArg,JMPIjvm::jv.CIMArgumentCInst); |
jlong jpRef = env->CallLongMethod( |
CIMParamValue *p = DEBUG_ConvertJavaToC (jlong, CIMParamValue*, jpRef); |
jArg, |
|
JMPIjvm::jv.CIMArgumentCInst); |
|
CIMParamValue *p = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMParamValue*, |
|
jpRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_CIMMETHODPROVIDER2: | case METHOD_CIMMETHODPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
&request->operationContext); |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jcopRef = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jMethod = env->NewStringUTF(request->methodName.getString().getCString()); |
jstring jMethod = |
|
env->NewStringUTF(request->methodName.getString().getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
Uint32 m=request->inParameters.size(); | Uint32 m=request->inParameters.size(); |
| |
jobjectArray jArIn=(jobjectArray)env->NewObjectArray(m,jv->CIMArgumentClassRef,NULL); |
jobjectArray jArIn=(jobjectArray)env->NewObjectArray( |
|
m, |
|
jv->CIMArgumentClassRef, |
|
NULL); |
| |
for (Uint32 i=0; i<m; i++) { | for (Uint32 i=0; i<m; i++) { |
CIMParamValue *parm = new CIMParamValue(request->inParameters[i]); | CIMParamValue *parm = new CIMParamValue(request->inParameters[i]); |
jlong jArgRef = DEBUG_ConvertCToJava (CIMParamValue*, jlong, parm); | jlong jArgRef = DEBUG_ConvertCToJava (CIMParamValue*, jlong, parm); |
jobject jArg = env->NewObject(jv->CIMArgumentClassRef,jv->CIMArgumentNewJ,jArgRef); |
jobject jArg = env->NewObject( |
|
jv->CIMArgumentClassRef, |
|
jv->CIMArgumentNewJ, |
|
jArgRef); |
| |
env->SetObjectArrayElement(jArIn,i,jArg); | env->SetObjectArrayElement(jArIn,i,jArg); |
} | } |
| |
jobjectArray jArOut=(jobjectArray)env->NewObjectArray(24,jv->CIMArgumentClassRef,NULL); |
jobjectArray jArOut=(jobjectArray)env->NewObjectArray( |
|
24, |
|
jv->CIMArgumentClassRef, |
|
NULL); |
| |
StatProviderTimeMeasurement providerTime(response); | StatProviderTimeMeasurement providerTime(response); |
| |
|
|
| |
handler.processing(); | handler.processing(); |
| |
jlong jValueRetRef = env->CallLongMethod(jValueRet,JMPIjvm::jv.CIMValueCInst); |
jlong jValueRetRef = env->CallLongMethod( |
CIMValue *valueRet = DEBUG_ConvertJavaToC (jlong, CIMValue*, jValueRetRef); |
jValueRet, |
|
JMPIjvm::jv.CIMValueCInst); |
|
CIMValue *valueRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMValue*, |
|
jValueRetRef); |
| |
handler.deliver(*valueRet); | handler.deliver(*valueRet); |
| |
|
|
if (jArg==NULL) | if (jArg==NULL) |
break; | break; |
| |
jlong jpRef = env->CallLongMethod(jArg,JMPIjvm::jv.CIMArgumentCInst); |
jlong jpRef = env->CallLongMethod( |
CIMParamValue *p = DEBUG_ConvertJavaToC (jlong, CIMParamValue*, jpRef); |
jArg, |
|
JMPIjvm::jv.CIMArgumentCInst); |
|
CIMParamValue *p = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMParamValue*, |
|
jpRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_METHODPROVIDER: | case METHOD_METHODPROVIDER: |
{ | { |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
jlong jcopRef = DEBUG_ConvertCToJava( |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jMethod = env->NewStringUTF(request->methodName.getString().getCString()); |
jstring jMethod = env->NewStringUTF( |
|
request->methodName.getString().getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
{ | { |
const CIMParamValue &parm = request->inParameters[i]; | const CIMParamValue &parm = request->inParameters[i]; |
const CIMValue v = parm.getValue(); | const CIMValue v = parm.getValue(); |
CIMProperty *p = new CIMProperty(parm.getParameterName(),v,v.getArraySize()); |
CIMProperty *p = new CIMProperty( |
|
parm.getParameterName(), |
|
v, |
|
v.getArraySize()); |
jlong jpRef = DEBUG_ConvertCToJava (CIMProperty*, jlong, p); | jlong jpRef = DEBUG_ConvertCToJava (CIMProperty*, jlong, p); |
jobject jp = env->NewObject(jv->CIMPropertyClassRef,jv->CIMPropertyNewJ,jpRef); |
jobject jp = env->NewObject( |
|
jv->CIMPropertyClassRef, |
|
jv->CIMPropertyNewJ, |
|
jpRef); |
| |
env->CallVoidMethod(jVecIn,jv->VectorAddElement,jp); | env->CallVoidMethod(jVecIn,jv->VectorAddElement,jp); |
} | } |
|
|
| |
handler.processing(); | handler.processing(); |
| |
jlong jValueRetRef = env->CallLongMethod(jValueRet,JMPIjvm::jv.CIMValueCInst); |
jlong jValueRetRef = env->CallLongMethod( |
CIMValue *valueRet = DEBUG_ConvertJavaToC (jlong, CIMValue*, jValueRetRef); |
jValueRet, |
|
JMPIjvm::jv.CIMValueCInst); |
|
CIMValue *valueRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMValue*, |
|
jValueRetRef); |
| |
handler.deliver(*valueRet); | handler.deliver(*valueRet); |
| |
for (int i=0,m=env->CallIntMethod(jVecOut,JMPIjvm::jv.VectorSize); i<m; i++) |
for (int i=0,m=env->CallIntMethod(jVecOut,JMPIjvm::jv.VectorSize); |
|
i<m; |
|
i++) |
{ | { |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jProp = env->CallObjectMethod(jVecOut,JMPIjvm::jv.VectorElementAt,i); |
jobject jProp = env->CallObjectMethod( |
|
jVecOut, |
|
JMPIjvm::jv.VectorElementAt, |
|
i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jpRef = env->CallLongMethod(jProp,JMPIjvm::jv.CIMPropertyCInst); |
jlong jpRef = env->CallLongMethod( |
CIMProperty *p = DEBUG_ConvertJavaToC (jlong, CIMProperty*, jpRef); |
jProp, |
|
JMPIjvm::jv.CIMPropertyCInst); |
|
CIMProperty *p = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMProperty*, |
|
jpRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
handler.deliverParamValue(CIMParamValue(p->getName().getString(),p->getValue())); |
handler.deliverParamValue( |
|
CIMParamValue(p->getName().getString(), |
|
p->getValue())); |
} | } |
| |
handler.complete(); | handler.complete(); |
|
|
| |
case METHOD_METHODPROVIDER2: | case METHOD_METHODPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, objectPath); |
&request->operationContext); |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ, |
|
jocRef); |
|
|
|
jlong jcopRef = DEBUG_ConvertCToJava( |
|
CIMObjectPath*, |
|
jlong, |
|
objectPath); |
|
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ, |
|
jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jMethod = env->NewStringUTF(request->methodName.getString().getCString()); |
jstring jMethod = env->NewStringUTF( |
|
request->methodName.getString().getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
{ | { |
const CIMParamValue &parm = request->inParameters[i]; | const CIMParamValue &parm = request->inParameters[i]; |
const CIMValue v = parm.getValue(); | const CIMValue v = parm.getValue(); |
CIMProperty *p = new CIMProperty(parm.getParameterName(),v,v.getArraySize()); |
CIMProperty *p = new CIMProperty( |
|
parm.getParameterName(), |
|
v, |
|
v.getArraySize()); |
jlong jpRef = DEBUG_ConvertCToJava (CIMProperty*, jlong, p); | jlong jpRef = DEBUG_ConvertCToJava (CIMProperty*, jlong, p); |
jobject jp = env->NewObject(jv->CIMPropertyClassRef,jv->CIMPropertyNewJ,jpRef); |
jobject jp = env->NewObject( |
|
jv->CIMPropertyClassRef, |
|
jv->CIMPropertyNewJ, |
|
jpRef); |
| |
env->CallVoidMethod(jVecIn,jv->VectorAddElement,jp); | env->CallVoidMethod(jVecIn,jv->VectorAddElement,jp); |
} | } |
|
|
| |
handler.processing(); | handler.processing(); |
| |
jlong jValueRetRef = env->CallLongMethod(jValueRet,JMPIjvm::jv.CIMValueCInst); |
jlong jValueRetRef = env->CallLongMethod( |
CIMValue *valueRet = DEBUG_ConvertJavaToC (jlong, CIMValue*, jValueRetRef); |
jValueRet, |
|
JMPIjvm::jv.CIMValueCInst); |
|
CIMValue *valueRet = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMValue*, |
|
jValueRetRef); |
| |
handler.deliver(*valueRet); | handler.deliver(*valueRet); |
| |
for (int i=0,m=env->CallIntMethod(jVecOut,JMPIjvm::jv.VectorSize); i<m; i++) |
for (int i=0,m=env->CallIntMethod(jVecOut,JMPIjvm::jv.VectorSize); |
|
i<m; |
|
i++) |
{ | { |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jProp = env->CallObjectMethod(jVecOut,JMPIjvm::jv.VectorElementAt,i); |
jobject jProp = env->CallObjectMethod( |
|
jVecOut, |
|
JMPIjvm::jv.VectorElementAt, |
|
i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jlong jpRef = env->CallLongMethod(jProp,JMPIjvm::jv.CIMPropertyCInst); |
jlong jpRef = env->CallLongMethod( |
CIMProperty *p = DEBUG_ConvertJavaToC (jlong, CIMProperty*, jpRef); |
jProp, |
|
JMPIjvm::jv.CIMPropertyCInst); |
|
CIMProperty *p = DEBUG_ConvertJavaToC( |
|
jlong, |
|
CIMProperty*, |
|
jpRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
handler.deliverParamValue(CIMParamValue(p->getName().getString(),p->getValue())); |
handler.deliverParamValue( |
|
CIMParamValue(p->getName().getString(), |
|
p->getValue())); |
} | } |
| |
handler.complete(); | handler.complete(); |
|
|
| |
case METHOD_UNKNOWN: | case METHOD_UNKNOWN: |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleInvokeMethodRequest: should not be here!"<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::handleInvokeMethodRequest: " |
|
"should not be here!"<<endl); |
break; | break; |
} | } |
} | } |
|
|
return(response); | return(response); |
} | } |
| |
int LocateIndicationProviderNames(const CIMInstance& pInstance, const CIMInstance& pmInstance, |
int LocateIndicationProviderNames( |
String& providerName, String& location) |
const CIMInstance& pInstance, |
|
const CIMInstance& pmInstance, |
|
String& providerName, |
|
String& location) |
{ | { |
Uint32 pos = pInstance.findProperty(CIMName ("Name")); | Uint32 pos = pInstance.findProperty(CIMName ("Name")); |
pInstance.getProperty(pos).getValue().get(providerName); | pInstance.getProperty(pos).getValue().get(providerName); |
|
|
return stmt; | return stmt; |
} | } |
| |
Message * JMPIProviderManager::handleCreateSubscriptionRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleCreateSubscriptionRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "JMPIProviderManager::handleCreateSubscriptionRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleCreateSubscriptionRequest"); |
| |
HandlerIntroInd(CreateSubscription,message,request,response,handler); | HandlerIntroInd(CreateSubscription,message,request,response,handler); |
| |
|
|
providerLocation; | providerLocation; |
CIMInstance req_provider, | CIMInstance req_provider, |
req_providerModule; | req_providerModule; |
ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME); |
ProviderIdContainer pidc = |
|
(ProviderIdContainer) request->operationContext.get( |
|
ProviderIdContainer::NAME); |
| |
req_provider = pidc.getProvider (); | req_provider = pidc.getProvider (); |
req_providerModule = pidc.getModule (); | req_providerModule = pidc.getModule (); |
| |
LocateIndicationProviderNames (req_provider, |
LocateIndicationProviderNames( |
|
req_provider, |
req_providerModule, | req_providerModule, |
providerName, | providerName, |
providerLocation); | providerLocation); |
|
|
Logger::put (Logger::STANDARD_LOG, | Logger::put (Logger::STANDARD_LOG, |
System::CIMSERVER, | System::CIMSERVER, |
Logger::TRACE, | Logger::TRACE, |
"JMPIProviderManager::handleCreateSubscriptionRequest - Host name: $0 Name space: $1 Provider name(s): $2", |
"JMPIProviderManager::handleCreateSubscriptionRequest - " |
|
"Host name: $0 Name space: $1 Provider name(s): $2", |
System::getHostName(), | System::getHostName(), |
request->nameSpace.getString(), | request->nameSpace.getString(), |
providerName); | providerName); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: hostname = " |
DDD(cout<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: " |
|
"hostname = " |
<<System::getHostName() | <<System::getHostName() |
<<", namespace = " | <<", namespace = " |
<<request->nameSpace.getString() | <<request->nameSpace.getString() |
|
|
<<providerName | <<providerName |
<<", fileName = " | <<", fileName = " |
<<fileName | <<fileName |
<<PEGASUS_STD(endl)); |
<<endl); |
| |
// get cached or load new provider module | // get cached or load new provider module |
JMPIProvider::OpProviderHolder ph = providerManager.getProvider (fileName, |
JMPIProvider::OpProviderHolder ph = |
|
providerManager.getProvider( |
|
fileName, |
providerName, | providerName, |
String::EMPTY); | String::EMPTY); |
| |
|
|
// | // |
pr.testIfZeroAndIncrementSubscriptions (); | pr.testIfZeroAndIncrementSubscriptions (); |
| |
SubscriptionFilterConditionContainer sub_cntr = request->operationContext.get (SubscriptionFilterConditionContainer::NAME); |
SubscriptionFilterConditionContainer sub_cntr = |
|
request->operationContext.get( |
|
SubscriptionFilterConditionContainer::NAME); |
indProvRecord *prec = NULL; | indProvRecord *prec = NULL; |
bool fNewPrec = false; | bool fNewPrec = false; |
| |
|
|
// convert arguments | // convert arguments |
prec->ctx = new OperationContext (); | prec->ctx = new OperationContext (); |
| |
prec->ctx->insert (request->operationContext.get (IdentityContainer::NAME)); |
prec->ctx->insert( |
prec->ctx->insert (request->operationContext.get (AcceptLanguageListContainer::NAME)); |
request->operationContext.get( |
prec->ctx->insert (request->operationContext.get (ContentLanguageListContainer::NAME)); |
IdentityContainer::NAME)); |
prec->ctx->insert (request->operationContext.get (SubscriptionInstanceContainer::NAME)); |
prec->ctx->insert( |
prec->ctx->insert (request->operationContext.get (SubscriptionFilterConditionContainer::NAME)); |
request->operationContext.get( |
|
AcceptLanguageListContainer::NAME)); |
|
prec->ctx->insert( |
|
request->operationContext.get( |
|
ContentLanguageListContainer::NAME)); |
|
prec->ctx->insert( |
|
request->operationContext.get( |
|
SubscriptionInstanceContainer::NAME)); |
|
prec->ctx->insert( |
|
request->operationContext.get( |
|
SubscriptionFilterConditionContainer::NAME)); |
| |
prec->enabled = true; | prec->enabled = true; |
| |
prec->handler = new EnableIndicationsResponseHandler (0, |
prec->handler = new EnableIndicationsResponseHandler( |
|
0, |
0, | 0, |
req_provider, | req_provider, |
_indicationCallback, | _indicationCallback, |
_responseChunkCallback); | _responseChunkCallback); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: Adding to provTab "<<providerName<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::" |
|
"handleCreateSubscriptionRequest: " |
|
"Adding to provTab " |
|
<<providerName<<endl); |
| |
provTab.insert (providerName, prec); | provTab.insert (providerName, prec); |
} | } |
|
|
srec->queryLanguage = sub_cntr.getQueryLanguage (); | srec->queryLanguage = sub_cntr.getQueryLanguage (); |
srec->propertyList = request->propertyList; | srec->propertyList = request->propertyList; |
| |
CIMOMHandleQueryContext *qContext = new CIMOMHandleQueryContext (CIMNamespaceName (request->nameSpace.getString ()), |
CIMOMHandleQueryContext *qContext = |
|
new CIMOMHandleQueryContext( |
|
CIMNamespaceName( |
|
request->nameSpace.getString()), |
*pr._cimom_handle); | *pr._cimom_handle); |
srec->qContext = qContext; | srec->qContext = qContext; |
| |
|
|
| |
AutoMutex lock (mutexSelxTab); | AutoMutex lock (mutexSelxTab); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: Adding to selxTab "<<sPath.toString ()<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleCreateSubscriptionRequest:" |
|
" Adding to selxTab " |
|
<<sPath.toString ()<<endl); |
| |
selxTab.insert (sPath.toString (), srec); | selxTab.insert (sPath.toString (), srec); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: For selxTab "<<sPath.toString ()<<", srec = "<<PEGASUS_STD(hex)<<(long)srec<<PEGASUS_STD(dec)<<", qContext = "<<PEGASUS_STD(hex)<<(long)qContext<<PEGASUS_STD(dec)<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleCreateSubscriptionRequest:" |
|
" For selxTab "<<sPath.toString ()<<", srec = "<<hex |
|
<<(long)srec<<dec<<", qContext = "<<hex<<(long)qContext |
|
<<dec<<endl); |
} | } |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.createSubscriptionRequest: " + pr.getName()); |
PEG_TRACE_STRING( |
|
TRC_PROVIDERMANAGER, |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: Calling provider createSubscriptionRequest: "<<pr.getName()<<PEGASUS_STD(endl)); |
Tracer::LEVEL4, |
|
"Calling provider.createSubscriptionRequest: " + pr.getName()); |
|
|
|
DDD(cout<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: " |
|
"Calling provider createSubscriptionRequest: " |
|
<<pr.getName()<<endl); |
| |
JvmVector *jv = 0; | JvmVector *jv = 0; |
| |
|
|
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED", |
CIM_ERR_FAILED, |
"Could not initialize the JVM (Java Virtual Machine) runtime environment.")); |
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); |
|
|
| |
if (interfaceType == "JMPI") | if (interfaceType == "JMPI") |
{ | { |
// public void activateFilter (org.pegasus.jmpi.SelectExp filter, |
id = env->GetMethodID( |
// java.lang.String eventType, |
(jclass)pr.jProviderClass, |
// org.pegasus.jmpi.CIMObjectPath classPath, |
|
// boolean firstActivation) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID ((jclass)pr.jProviderClass, |
|
"activateFilter", | "activateFilter", |
"(Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;Lorg/pegasus/jmpi/CIMObjectPath;Z)V"); |
"(Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;Z)V"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_EVENTPROVIDER; | eMethodFound = METHOD_EVENTPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: found METHOD_EVENTPROVIDER."<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::" |
|
"handleCreateSubscriptionRequest: found " |
|
"METHOD_EVENTPROVIDER."<<endl); |
} | } |
} | } |
else if (interfaceType == "JMPIExperimental") | else if (interfaceType == "JMPIExperimental") |
{ | { |
// public void activateFilter (org.pegasus.jmpi.OperationContext oc, |
id = env->GetMethodID( |
// org.pegasus.jmpi.SelectExp filter, |
(jclass)pr.jProviderClass, |
// java.lang.String eventType, |
|
// org.pegasus.jmpi.CIMObjectPath classPath, |
|
// boolean firstActivation) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID ((jclass)pr.jProviderClass, |
|
"activateFilter", | "activateFilter", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;Lorg/pegasus/jmpi/CIMObjectPath;Z)V"); |
"(Lorg/pegasus/jmpi/OperationContext;" |
|
"Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;Z)V"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_EVENTPROVIDER2; | eMethodFound = METHOD_EVENTPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: found METHOD_EVENTPROVIDER2."<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::" |
|
"handleCreateSubscriptionRequest: found " |
|
"METHOD_EVENTPROVIDER2." |
|
<<endl); |
} | } |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: No method found!"<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::handleCreateSubscriptionRequest" |
|
": No method found!"<<endl); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND", |
CIM_ERR_FAILED, |
"Could not find a method for the provider based on InterfaceType.")); |
MessageLoaderParms( |
|
"ProviderManager.JMPI.METHOD_NOT_FOUND", |
|
"Could not find a method for the provider based on" |
|
" InterfaceType.")); |
} | } |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
|
|
{ | { |
case METHOD_EVENTPROVIDER: | case METHOD_EVENTPROVIDER: |
{ | { |
WQLSelectStatement *stmt = newSelectExp (srec->query, |
WQLSelectStatement *stmt = newSelectExp( |
|
srec->query, |
srec->queryLanguage); | srec->queryLanguage); |
jlong jStmtRef = DEBUG_ConvertCToJava (WQLSelectStatement *, jlong, stmt); |
jlong jStmtRef = DEBUG_ConvertCToJava( |
jobject jSelectExp = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewJ,jStmtRef); |
WQLSelectStatement *, |
|
jlong, |
|
stmt); |
|
jobject jSelectExp = env->NewObject( |
|
jv->SelectExpClassRef, |
|
jv->SelectExpNewJ, |
|
jStmtRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString()); |
jstring jType = env->NewStringUTF( |
|
request->nameSpace.getString().getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
request->nameSpace, | request->nameSpace, |
request->classNames[0]); | request->classNames[0]); |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, cop); | jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, cop); |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ,jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_EVENTPROVIDER2: | case METHOD_EVENTPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
|
&request->operationContext); |
|
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ,jocRef); |
| |
WQLSelectStatement *stmt = newSelectExp (srec->query, | WQLSelectStatement *stmt = newSelectExp (srec->query, |
srec->queryLanguage); | srec->queryLanguage); |
jlong jStmtRef = DEBUG_ConvertCToJava (WQLSelectStatement *, jlong, stmt); |
jlong jStmtRef = DEBUG_ConvertCToJava( |
jobject jSelectExp = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewJ,jStmtRef); |
WQLSelectStatement *, |
|
jlong, |
|
stmt); |
|
jobject jSelectExp = env->NewObject( |
|
jv->SelectExpClassRef, |
|
jv->SelectExpNewJ, |
|
jStmtRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString()); |
jstring jType = env->NewStringUTF( |
|
request->nameSpace.getString().getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
request->nameSpace, | request->nameSpace, |
request->classNames[0]); | request->classNames[0]); |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, cop); | jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, cop); |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ,jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_UNKNOWN: | case METHOD_UNKNOWN: |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: should not be here!"<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleCreateSubscriptionRequest" |
|
": should not be here!"<<endl); |
break; | break; |
} | } |
} | } |
|
|
return(response); | return(response); |
} | } |
| |
Message * JMPIProviderManager::handleDeleteSubscriptionRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleDeleteSubscriptionRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "JMPIProviderManager::handleDeleteSubscriptionRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleDeleteSubscriptionRequest"); |
| |
HandlerIntroInd(DeleteSubscription,message,request,response,handler); | HandlerIntroInd(DeleteSubscription,message,request,response,handler); |
| |
|
|
providerLocation; | providerLocation; |
CIMInstance req_provider, | CIMInstance req_provider, |
req_providerModule; | req_providerModule; |
ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME); |
ProviderIdContainer pidc = (ProviderIdContainer) |
|
request->operationContext.get( |
|
ProviderIdContainer::NAME); |
| |
req_provider = pidc.getProvider (); | req_provider = pidc.getProvider (); |
req_providerModule = pidc.getModule (); | req_providerModule = pidc.getModule (); |
|
|
Logger::put (Logger::STANDARD_LOG, | Logger::put (Logger::STANDARD_LOG, |
System::CIMSERVER, | System::CIMSERVER, |
Logger::TRACE, | Logger::TRACE, |
"JMPIProviderManager::handleDeleteSubscriptionRequest - Host name: $0 Name space: $1 Provider name(s): $2", |
"JMPIProviderManager::handleDeleteSubscriptionRequest - " |
|
"Host name: $0 Name space: $1 Provider name(s): $2", |
System::getHostName(), | System::getHostName(), |
request->nameSpace.getString(), | request->nameSpace.getString(), |
providerName); | providerName); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: hostname = " |
DDD(cout<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: " |
|
"hostname = " |
<<System::getHostName() | <<System::getHostName() |
<<", namespace = " | <<", namespace = " |
<<request->nameSpace.getString() | <<request->nameSpace.getString() |
|
|
<<providerName | <<providerName |
<<", fileName = " | <<", fileName = " |
<<fileName | <<fileName |
<<PEGASUS_STD(endl)); |
<<endl); |
| |
// get cached or load new provider module | // get cached or load new provider module |
JMPIProvider::OpProviderHolder ph = providerManager.getProvider (fileName, |
JMPIProvider::OpProviderHolder ph = providerManager.getProvider( |
|
fileName, |
providerName, | providerName, |
String::EMPTY); | String::EMPTY); |
| |
|
|
| |
if (--prec->count <= 0) | if (--prec->count <= 0) |
{ | { |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: Removing provTab "<<providerName<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::" |
|
"handleDeleteSubscriptionRequest: Removing provTab " |
|
<<providerName<<endl); |
| |
provTab.remove (providerName); | provTab.remove (providerName); |
| |
|
|
| |
AutoMutex lock (mutexSelxTab); | AutoMutex lock (mutexSelxTab); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: Removing selxTab "<<sPathString<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest:" |
|
" Removing selxTab "<<sPathString<<endl); |
| |
if (!selxTab.lookup (sPathString, srec)) | if (!selxTab.lookup (sPathString, srec)) |
{ | { |
PEGASUS_ASSERT(0); | PEGASUS_ASSERT(0); |
} | } |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: For selxTab "<<sPathString<<", srec = "<<PEGASUS_STD(hex)<<(long)srec<<PEGASUS_STD(dec)<<", qContext = "<<PEGASUS_STD(hex)<<(long)srec->qContext<<PEGASUS_STD(dec)<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest:" |
|
" For selxTab "<<sPathString<<", srec = " |
|
<<hex<<(long)srec<<dec<<", qContext = "<<hex |
|
<<(long)srec->qContext<<dec<<endl); |
| |
selxTab.remove (sPathString); | selxTab.remove (sPathString); |
} | } |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.deleteSubscriptionRequest: " + pr.getName()); |
PEG_TRACE_STRING( |
|
TRC_PROVIDERMANAGER, |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: Calling provider deleteSubscriptionRequest: "<<pr.getName()<<PEGASUS_STD(endl)); |
Tracer::LEVEL4, |
|
"Calling provider.deleteSubscriptionRequest: " + pr.getName()); |
|
|
|
DDD(cout<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: " |
|
"Calling provider deleteSubscriptionRequest: " |
|
<<pr.getName()<<endl); |
| |
JvmVector *jv = 0; | JvmVector *jv = 0; |
| |
|
|
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms("ProviderManager.JMPI.INIT_JVM_FAILED", |
CIM_ERR_FAILED, |
"Could not initialize the JVM (Java Virtual Machine) runtime environment.")); |
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); |
|
|
String interfaceType; | String interfaceType; |
String interfaceVersion; | String interfaceVersion; |
| |
getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME), |
getInterfaceType( |
|
request->operationContext.get(ProviderIdContainer::NAME), |
interfaceType, | interfaceType, |
interfaceVersion); | interfaceVersion); |
| |
if (interfaceType == "JMPI") | if (interfaceType == "JMPI") |
{ | { |
// public void deActivateFilter (org.pegasus.jmpi.SelectExp filter, |
id = env->GetMethodID( |
// java.lang.String eventType, |
(jclass)pr.jProviderClass, |
// org.pegasus.jmpi.CIMObjectPath classPath, |
|
// boolean lastActivation) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"deActivateFilter", | "deActivateFilter", |
"(Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;Lorg/pegasus/jmpi/CIMObjectPath;Z)V"); |
"(Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;Z)V"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_EVENTPROVIDER; | eMethodFound = METHOD_EVENTPROVIDER; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: found METHOD_EVENTPROVIDER."<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::" |
|
"handleDeleteSubscriptionRequest: found " |
|
"METHOD_EVENTPROVIDER."<<endl); |
} | } |
} | } |
else if (interfaceType == "JMPIExperimental") | else if (interfaceType == "JMPIExperimental") |
{ | { |
// public void deActivateFilter (org.pegasus.jmpi.OperationContext oc, |
id = env->GetMethodID( |
// org.pegasus.jmpi.SelectExp filter, |
(jclass)pr.jProviderClass, |
// java.lang.String eventType, |
|
// org.pegasus.jmpi.CIMObjectPath classPath, |
|
// boolean lastActivation) |
|
// throws org.pegasus.jmpi.CIMException |
|
id = env->GetMethodID((jclass)pr.jProviderClass, |
|
"deActivateFilter", | "deActivateFilter", |
"(Lorg/pegasus/jmpi/OperationContext;Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;Lorg/pegasus/jmpi/CIMObjectPath;Z)V"); |
"(Lorg/pegasus/jmpi/OperationContext;" |
|
"Lorg/pegasus/jmpi/SelectExp;Ljava/lang/String;" |
|
"Lorg/pegasus/jmpi/CIMObjectPath;Z)V"); |
| |
if (id != NULL) | if (id != NULL) |
{ | { |
eMethodFound = METHOD_EVENTPROVIDER2; | eMethodFound = METHOD_EVENTPROVIDER2; |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: found METHOD_EVENTPROVIDER2."<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::" |
|
"handleDeleteSubscriptionRequest: found " |
|
"METHOD_EVENTPROVIDER2."<<endl); |
} | } |
} | } |
| |
if (id == NULL) | if (id == NULL) |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: No method found!"<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest" |
|
": No method found!"<<endl); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms ("ProviderManager.JMPI.METHOD_NOT_FOUND", |
CIM_ERR_FAILED, |
"Could not find a method for the provider based on InterfaceType.")); |
MessageLoaderParms( |
|
"ProviderManager.JMPI.METHOD_NOT_FOUND", |
|
"Could not find a method for the provider based on" |
|
" InterfaceType.")); |
} | } |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
|
|
{ | { |
case METHOD_EVENTPROVIDER: | case METHOD_EVENTPROVIDER: |
{ | { |
WQLSelectStatement *stmt = newSelectExp (srec->query, |
WQLSelectStatement *stmt = newSelectExp( |
|
srec->query, |
srec->queryLanguage); | srec->queryLanguage); |
jlong jStmtRef = DEBUG_ConvertCToJava (WQLSelectStatement *, jlong, stmt); |
jlong jStmtRef = DEBUG_ConvertCToJava( |
jobject jSelectExp = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewJ,jStmtRef); |
WQLSelectStatement *, |
|
jlong, |
|
stmt); |
|
jobject jSelectExp = env->NewObject( |
|
jv->SelectExpClassRef, |
|
jv->SelectExpNewJ,jStmtRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString()); |
jstring jType = env->NewStringUTF( |
|
request->nameSpace.getString().getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
CIMObjectPath *cop = new CIMObjectPath (System::getHostName(), |
CIMObjectPath *cop = new CIMObjectPath( |
|
System::getHostName(), |
request->nameSpace, | request->nameSpace, |
request->classNames[0]); | request->classNames[0]); |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, cop); | jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, cop); |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ,jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
case METHOD_EVENTPROVIDER2: | case METHOD_EVENTPROVIDER2: |
{ | { |
jlong jocRef = DEBUG_ConvertCToJava (OperationContext*, jlong, &request->operationContext); |
jlong jocRef = DEBUG_ConvertCToJava( |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewJ,jocRef); |
OperationContext*, |
|
jlong, |
|
&request->operationContext); |
|
jobject joc = env->NewObject( |
|
jv->OperationContextClassRef, |
|
jv->OperationContextNewJ,jocRef); |
| |
WQLSelectStatement *stmt = newSelectExp (srec->query, | WQLSelectStatement *stmt = newSelectExp (srec->query, |
srec->queryLanguage); | srec->queryLanguage); |
jlong jStmtRef = DEBUG_ConvertCToJava (WQLSelectStatement *, jlong, stmt); |
jlong jStmtRef = DEBUG_ConvertCToJava( |
jobject jSelectExp = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewJ,jStmtRef); |
WQLSelectStatement *, |
|
jlong, |
|
stmt); |
|
jobject jSelectExp = env->NewObject( |
|
jv->SelectExpClassRef, |
|
jv->SelectExpNewJ, |
|
jStmtRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString()); |
jstring jType = env->NewStringUTF( |
|
request->nameSpace.getString().getCString()); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
request->nameSpace, | request->nameSpace, |
request->classNames[0]); | request->classNames[0]); |
jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, cop); | jlong jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jlong, cop); |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewJ,jcopRef); |
jobject jcop = env->NewObject( |
|
jv->CIMObjectPathClassRef, |
|
jv->CIMObjectPathNewJ,jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
if (joc) | if (joc) |
{ | { |
env->CallVoidMethod (joc, JMPIjvm::jv.OperationContextUnassociate); |
env->CallVoidMethod( |
|
joc, |
|
JMPIjvm::jv.OperationContextUnassociate); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
} | } |
|
|
| |
case METHOD_UNKNOWN: | case METHOD_UNKNOWN: |
{ | { |
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: should not be here!"<<PEGASUS_STD(endl)); |
DDD (cout<<"--- JMPIProviderManager::" |
|
"handleDeleteSubscriptionRequest: should not be here!" |
|
<<endl); |
break; | break; |
} | } |
} | } |
|
|
return(response); | return(response); |
} | } |
| |
Message * JMPIProviderManager::handleDisableModuleRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleDisableModuleRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "JMPIProviderManager::handleDisableModuleRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleDisableModuleRequest"); |
| |
CIMDisableModuleRequestMessage * request = | CIMDisableModuleRequestMessage * request = |
dynamic_cast<CIMDisableModuleRequestMessage *>(const_cast<Message *>(message)); |
dynamic_cast<CIMDisableModuleRequestMessage *> |
|
(const_cast<Message *>(message)); |
| |
PEGASUS_ASSERT(request != 0); | PEGASUS_ASSERT(request != 0); |
| |
|
|
Array<CIMInstance> _pInstances = request->providers; | Array<CIMInstance> _pInstances = request->providers; |
| |
CIMDisableModuleResponseMessage * response = | CIMDisableModuleResponseMessage * response = |
new CIMDisableModuleResponseMessage( |
dynamic_cast<CIMDisableModuleResponseMessage*>( |
request->messageId, |
request->buildResponse()); |
CIMException(), |
|
request->queueIds.copyAndPop(), |
|
operationalStatus); |
|
|
|
PEGASUS_ASSERT(response != 0); | PEGASUS_ASSERT(response != 0); |
|
response->operationalStatus = operationalStatus; |
// |
|
// Set HTTP method in response from request |
|
// |
|
response->setHttpMethod (request->getHttpMethod ()); |
|
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
return(response); | return(response); |
} | } |
| |
Message * JMPIProviderManager::handleEnableModuleRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleEnableModuleRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "JMPIProviderManager::handleEnableModuleRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleEnableModuleRequest"); |
| |
CIMEnableModuleRequestMessage * request = | CIMEnableModuleRequestMessage * request = |
dynamic_cast<CIMEnableModuleRequestMessage *>(const_cast<Message *>(message)); |
dynamic_cast<CIMEnableModuleRequestMessage *> |
|
(const_cast<Message *>(message)); |
| |
PEGASUS_ASSERT(request != 0); | PEGASUS_ASSERT(request != 0); |
| |
Array<Uint16> operationalStatus; | Array<Uint16> operationalStatus; |
operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_OK); |
operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_STOPPED); |
| |
CIMEnableModuleResponseMessage * response = | CIMEnableModuleResponseMessage * response = |
new CIMEnableModuleResponseMessage( |
dynamic_cast<CIMEnableModuleResponseMessage*>( |
request->messageId, |
request->buildResponse()); |
CIMException(), |
|
request->queueIds.copyAndPop(), |
|
operationalStatus); |
|
|
|
PEGASUS_ASSERT(response != 0); | PEGASUS_ASSERT(response != 0); |
|
response->operationalStatus = operationalStatus; |
// Set HTTP method in response from request |
|
response->setHttpMethod (request->getHttpMethod ()); |
|
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
return(response); | return(response); |
} | } |
| |
Message * JMPIProviderManager::handleStopAllProvidersRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleStopAllProvidersRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "JMPIProviderManager::handleStopAllProvidersRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleStopAllProvidersRequest"); |
| |
CIMStopAllProvidersRequestMessage * request = | CIMStopAllProvidersRequestMessage * request = |
dynamic_cast<CIMStopAllProvidersRequestMessage *>(const_cast<Message *>(message)); |
dynamic_cast<CIMStopAllProvidersRequestMessage *> |
|
(const_cast<Message *>(message)); |
| |
PEGASUS_ASSERT(request != 0); | PEGASUS_ASSERT(request != 0); |
| |
CIMStopAllProvidersResponseMessage * response = | CIMStopAllProvidersResponseMessage * response = |
new CIMStopAllProvidersResponseMessage( |
dynamic_cast<CIMStopAllProvidersResponseMessage*>( |
request->messageId, |
request->buildResponse()); |
CIMException(), |
|
request->queueIds.copyAndPop()); |
|
|
|
PEGASUS_ASSERT(response != 0); | PEGASUS_ASSERT(response != 0); |
| |
// Set HTTP method in response from request |
|
response->setHttpMethod (request->getHttpMethod ()); |
|
|
|
// tell the provider manager to shutdown all the providers | // tell the provider manager to shutdown all the providers |
providerManager.shutdownAllProviders(); | providerManager.shutdownAllProviders(); |
| |
|
|
return(response); | return(response); |
} | } |
| |
Message * JMPIProviderManager::handleInitializeProviderRequest(const Message * message) |
Message * JMPIProviderManager::handleSubscriptionInitCompleteRequest( |
{ |
const Message * message) |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "JMPIProviderManager::handleInitializeProviderRequest"); |
|
|
|
HandlerIntroInit(InitializeProvider,message,request,response,handler); |
|
|
|
try |
|
{ |
|
// 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); |
|
|
|
} |
|
HandlerCatch(handler); |
|
|
|
PEG_METHOD_EXIT(); |
|
|
|
return(response); |
|
} |
|
|
|
Message * JMPIProviderManager::handleSubscriptionInitCompleteRequest (const Message * message) |
|
{ | { |
PEG_METHOD_ENTER (TRC_PROVIDERMANAGER, | PEG_METHOD_ENTER (TRC_PROVIDERMANAGER, |
"JMPIProviderManager::handleSubscriptionInitCompleteRequest"); | "JMPIProviderManager::handleSubscriptionInitCompleteRequest"); |
|
|
| |
Uint32 numProviders = enableProviders.size (); | Uint32 numProviders = enableProviders.size (); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleSubscriptionInitCompleteRequest: numProviders = "<<numProviders<<PEGASUS_STD(endl)); |
DDD(cout<<"--- JMPIProviderManager::handleSubscriptionInitCompleteRequest: " |
|
"numProviders = "<<numProviders<<endl); |
#if 0 |
|
for (Uint32 i = 0; i < numProviders; i++) |
|
{ |
|
try |
|
{ |
|
CIMInstance provider; |
|
|
|
provider = enableProviders[i]->getProviderInstance (); |
|
|
|
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleSubscriptionInitCompleteRequest: name = "<<enableProviders[i]->getName ()<<PEGASUS_STD(endl)); |
|
|
|
// |
|
// Get cached or load new provider module |
|
// |
|
JMPIProvider::OpProviderHolder ph = providerManager.getProvider (enableProviders[i]->getModule ()->getFileName (), |
|
enableProviders[i]->getName ()); |
|
indProvRecord *prec = NULL; |
|
|
|
{ |
|
AutoMutex lock (mutexProvTab); |
|
|
|
provTab.lookup (enableProviders[i]->getName (), prec); |
|
} |
|
} |
|
catch (CIMException & e) |
|
{ |
|
PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL2, |
|
"CIMException: " + e.getMessage ()); |
|
} |
|
catch (Exception & e) |
|
{ |
|
PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL2, |
|
"Exception: " + e.getMessage ()); |
|
} |
|
catch(...) |
|
{ |
|
PEG_TRACE_CSTRING (TRC_PROVIDERMANAGER, Tracer::LEVEL2, |
|
"Unknown error in handleSubscriptionInitCompleteRequest"); |
|
} |
|
} |
|
#endif |
|
| |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
return (response); | return (response); |
} | } |
| |
Message * JMPIProviderManager::handleUnsupportedRequest(const Message * message) throw() |
Message * JMPIProviderManager::handleUnsupportedRequest( |
|
const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,"JMPIProviderManager::handleUnsupportedRequest"); |
PEG_METHOD_ENTER( |
|
TRC_PROVIDERMANAGER, |
|
"JMPIProviderManager::handleUnsupportedRequest"); |
| |
CIMRequestMessage* request = | CIMRequestMessage* request = |
dynamic_cast<CIMRequestMessage *>(const_cast<Message *>(message)); | dynamic_cast<CIMRequestMessage *>(const_cast<Message *>(message)); |
|
|
{ | { |
String providerName; | String providerName; |
String fileName; | String fileName; |
String interfaceName; |
String moduleName; |
CIMValue genericValue; | CIMValue genericValue; |
| |
|
genericValue = providerId.getModule().getProperty( |
|
providerId.getModule().findProperty("Name")).getValue(); |
|
genericValue.get(moduleName); |
|
|
genericValue = providerId.getProvider().getProperty( | genericValue = providerId.getProvider().getProperty( |
providerId.getProvider().findProperty("Name")).getValue(); | providerId.getProvider().findProperty("Name")).getValue(); |
genericValue.get(providerName); | genericValue.get(providerName); |
|
|
genericValue.get(fileName); | genericValue.get(fileName); |
fileName = resolveFileName(fileName); | fileName = resolveFileName(fileName); |
| |
// ATTN: This attribute is probably not required |
return ProviderName(moduleName, providerName, fileName); |
genericValue = providerId.getModule().getProperty( |
|
providerId.getModule().findProperty("InterfaceType")).getValue(); |
|
genericValue.get(interfaceName); |
|
|
|
return ProviderName(providerName, fileName, interfaceName, 0); |
|
} | } |
| |
String JMPIProviderManager::resolveFileName(String fileName) | String JMPIProviderManager::resolveFileName(String fileName) |
{ | { |
String name = ConfigManager::getHomedPath(ConfigManager::getInstance()->getCurrentValue("providerDir")); |
String name = ConfigManager::getHomedPath( |
|
ConfigManager::getInstance()->getCurrentValue("providerDir")); |
// physfilename = everything up to the delimiter pointing at class start | // physfilename = everything up to the delimiter pointing at class start |
// in case there is no delimiter anymore, it takes the entire filename | // in case there is no delimiter anymore, it takes the entire filename |
String physfilename = fileName.subString(0, fileName.find(":")); | String physfilename = fileName.subString(0, fileName.find(":")); |