version 1.43, 2006/03/08 23:14:30
|
version 1.51, 2006/05/24 20:42:21
|
|
|
} | } |
| |
JMPIProviderManager::IndProvTab JMPIProviderManager::provTab; | JMPIProviderManager::IndProvTab JMPIProviderManager::provTab; |
|
Mutex JMPIProviderManager::mutexProvTab; |
JMPIProviderManager::IndSelectTab JMPIProviderManager::selxTab; | JMPIProviderManager::IndSelectTab JMPIProviderManager::selxTab; |
|
Mutex JMPIProviderManager::mutexSelxTab; |
JMPIProviderManager::ProvRegistrar JMPIProviderManager::provReg; | JMPIProviderManager::ProvRegistrar JMPIProviderManager::provReg; |
|
Mutex JMPIProviderManager::mutexProvReg; |
| |
JMPIProviderManager::JMPIProviderManager(Mode m) | JMPIProviderManager::JMPIProviderManager(Mode m) |
{ | { |
|
|
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::insertProvider: "<<key<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::insertProvider: "<<key<<PEGASUS_STD(endl)); |
| |
return provReg.insert(key,name); |
Boolean ret = false; |
|
|
|
{ |
|
AutoMutex lock (mutexProvReg); |
|
|
|
ret = provReg.insert(key,name); |
|
} |
|
|
|
return ret; |
} | } |
| |
Message * JMPIProviderManager::processMessage(Message * request) throw() | Message * JMPIProviderManager::processMessage(Message * request) throw() |
|
|
{ | { |
env->ExceptionClear(); | env->ExceptionClear(); |
| |
// public org.pegasus.jmpi.CIMInstance[] enumInstances (org.pegasus.jmpi.CIMObjectPath cop, |
// public org.pegasus.jmpi.CIMInstance[] enumerateInstances (org.pegasus.jmpi.CIMObjectPath cop, |
// boolean localOnly, | // boolean localOnly, |
// boolean includeQualifiers, | // boolean includeQualifiers, |
// boolean includeClassOrigin, | // boolean includeClassOrigin, |
|
|
// org.pegasus.jmpi.CIMClass cimClass) | // org.pegasus.jmpi.CIMClass cimClass) |
// throws org.pegasus.jmpi.CIMException | // throws org.pegasus.jmpi.CIMException |
id = env->GetMethodID((jclass)pr.jProviderClass, | id = env->GetMethodID((jclass)pr.jProviderClass, |
"enumInstances", |
"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) |
|
|
// java.lang.String[] propertyList) | // java.lang.String[] propertyList) |
// throws org.pegasus.jmpi.CIMException | // throws org.pegasus.jmpi.CIMException |
id = env->GetMethodID((jclass)pr.jProviderClass, | id = env->GetMethodID((jclass)pr.jProviderClass, |
"enumInstances", |
"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) |
|
|
| |
CIMClass *pcls = new CIMClass (cls); | CIMClass *pcls = new CIMClass (cls); |
| |
JMPIjvm::checkException(env); |
|
|
|
jint jcls = DEBUG_ConvertCToJava (CIMClass*, jint, pcls); | jint jcls = DEBUG_ConvertCToJava (CIMClass*, jint, pcls); |
| |
jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcls); | jobject jCc=env->NewObject(jv->CIMClassClassRef,jv->CIMClassNewI,jcls); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobjectArray jVec = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobject jVec = env->CallObjectMethod ((jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jcop, | jcop, |
|
|
} | } |
| |
handler.processing(); | handler.processing(); |
if (jVec) { |
if (jVec) |
for (int i=0,m=env->GetArrayLength(jVec); i<m; i++) { |
{ |
|
for (int i = 0, m = env->CallIntMethod (jVec, JMPIjvm::jv.VectorSize); i < m; i++) |
|
{ |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jciRet = env->GetObjectArrayElement(jVec,i); |
jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i); |
|
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: jciRet = "<<jciRet<<PEGASUS_STD(endl)); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
handler.deliver(*ciRet); | handler.deliver(*ciRet); |
} | } |
} | } |
|
DDD (PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleExecQueryRequest: done!"<<PEGASUS_STD(endl)); |
handler.complete(); | handler.complete(); |
break; | break; |
} | } |
|
|
| |
jint jql = 0; // @BUG - how to convert? | jint jql = 0; // @BUG - how to convert? |
| |
jobjectArray jVec = (jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobject jVec = env->CallObjectMethod ((jobject)pr.jProvider, |
id, | id, |
jcop, | jcop, |
jquery, | jquery, |
|
|
| |
handler.processing(); | handler.processing(); |
if (jVec) { | if (jVec) { |
for (int i=0,m=env->GetArrayLength(jVec); i<m; i++) { |
for (int i=0,m=env->CallIntMethod(jVec,JMPIjvm::jv.VectorSize); i<m; i++) { |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jciRet = env->GetObjectArrayElement(jVec,i); |
jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: assocName = "<<assocPath->toString ()<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: assocName = "<<assocPath->toString ()<<PEGASUS_STD(endl)); |
|
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: pathName = "<<objectPath->toString ()<<PEGASUS_STD(endl)); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultClass = "<<request->resultClass<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultClass = "<<request->resultClass<<PEGASUS_STD(endl)); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: role = "<<request->role<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultRole = "<<request->resultRole<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultRole = "<<request->resultRole<<PEGASUS_STD(endl)); |
|
|
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl)); |
#endif | #endif |
| |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
id, | id, |
jAssociationName, | jAssociationName, |
jPathName, | jPathName, |
|
|
STAT_PMS_PROVIDEREND; | STAT_PMS_PROVIDEREND; |
| |
handler.processing(); | handler.processing(); |
if (jVec) { |
if (jAr) { |
for (int i=0,m=env->GetArrayLength(jVec); i<m; i++) { |
for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) { |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jciRet = env->GetObjectArrayElement(jVec,i); |
jobject jciRet = env->GetObjectArrayElement(jAr,i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: assocName = "<<assocPath->toString ()<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: assocName = "<<assocPath->toString ()<<PEGASUS_STD(endl)); |
|
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: pathName = "<<objectPath->toString ()<<PEGASUS_STD(endl)); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultClass = "<<request->resultClass<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultClass = "<<request->resultClass<<PEGASUS_STD(endl)); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: role = "<<request->role<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultRole = "<<request->resultRole<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultRole = "<<request->resultRole<<PEGASUS_STD(endl)); |
|
|
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl)); |
#endif | #endif |
| |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jAssociationName, | jAssociationName, |
|
|
} | } |
| |
handler.processing(); | handler.processing(); |
if (jVec) { |
if (jAr) { |
for (int i=0,m=env->GetArrayLength(jVec); i<m; i++) { |
for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) { |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jciRet = env->GetObjectArrayElement(jVec,i); |
jobject jciRet = env->GetObjectArrayElement(jAr,i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
| |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: assocName = "<<assocPath->toString ()<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: assocName = "<<assocPath->toString ()<<PEGASUS_STD(endl)); |
|
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: pathName = "<<objectPath->toString ()<<PEGASUS_STD(endl)); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultClass = "<<request->resultClass<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultClass = "<<request->resultClass<<PEGASUS_STD(endl)); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: role = "<<request->role<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultRole = "<<request->resultRole<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorsRequest: resultRole = "<<request->resultRole<<PEGASUS_STD(endl)); |
|
|
| |
handler.processing(); | handler.processing(); |
if (jVec) { | if (jVec) { |
for (int i=0,m=env->GetArrayLength(jVec); i<m; i++) { |
for (int i=0,m=env->CallIntMethod(jVec,JMPIjvm::jv.VectorSize); i<m; i++) { |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jciRet = env->GetObjectArrayElement(jVec,i); |
jobject jciRet = env->CallObjectMethod(jVec,JMPIjvm::jv.VectorElementAt,i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultRole = "<<request->resultRole<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultRole = "<<request->resultRole<<PEGASUS_STD(endl)); |
#endif | #endif |
| |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
id, | id, |
jAssociationName, | jAssociationName, |
jPathName, | jPathName, |
|
|
STAT_PMS_PROVIDEREND; | STAT_PMS_PROVIDEREND; |
| |
handler.processing(); | handler.processing(); |
if (jVec) { |
if (jAr) { |
for (int i=0,m=env->GetArrayLength(jVec); i<m; i++) { |
for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) { |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jcopRet = env->GetObjectArrayElement(jVec,i); |
jobject jcopRet = env->GetObjectArrayElement(jAr,i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jint jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst); | jint jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst); |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRet); |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRetRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultRole = "<<request->resultRole<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleAssociatorNamesRequest: resultRole = "<<request->resultRole<<PEGASUS_STD(endl)); |
#endif | #endif |
| |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jAssociationName, | jAssociationName, |
|
|
} | } |
| |
handler.processing(); | handler.processing(); |
if (jVec) { |
if (jAr) { |
for (int i=0,m=env->GetArrayLength(jVec); i<m; i++) { |
for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) { |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jcopRet = env->GetObjectArrayElement(jVec,i); |
jobject jcopRet = env->GetObjectArrayElement(jAr,i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jint jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst); | jint jcopRetRef = env->CallIntMethod(jcopRet,JMPIjvm::jv.CIMObjectPathCInst); |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRet); |
CIMObjectPath *copRet = DEBUG_ConvertJavaToC (jint, CIMObjectPath*, jcopRetRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl)); |
#endif | #endif |
| |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
id, | id, |
jAssociationName, | jAssociationName, |
jPathName, | jPathName, |
|
|
STAT_PMS_PROVIDEREND; | STAT_PMS_PROVIDEREND; |
| |
handler.processing(); | handler.processing(); |
if (jVec) { |
if (jAr) { |
for (int i=0,m=env->GetArrayLength(jVec); i<m; i++) { |
for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) { |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jciRet = env->GetObjectArrayElement(jVec,i); |
jobject jciRet = env->GetObjectArrayElement(jAr,i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferencesRequest: includeClassOrigin = "<<false<<PEGASUS_STD(endl)); |
#endif | #endif |
| |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jAssociationName, | jAssociationName, |
|
|
} | } |
| |
handler.processing(); | handler.processing(); |
if (jVec) { |
if (jAr) { |
for (int i=0,m=env->GetArrayLength(jVec); i<m; i++) { |
for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) { |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jciRet = env->GetObjectArrayElement(jVec,i); |
jobject jciRet = env->GetObjectArrayElement(jAr,i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: role = "<<request->role<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
#endif | #endif |
| |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
id, | id, |
jPathName, | jPathName, |
jAssociationName, | jAssociationName, |
|
|
STAT_PMS_PROVIDEREND; | STAT_PMS_PROVIDEREND; |
| |
handler.processing(); | handler.processing(); |
if (jVec) { |
if (jAr) { |
for (int i=0,m=env->GetArrayLength(jVec); i<m; i++) { |
for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) { |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jcopRet = env->GetObjectArrayElement(jVec,i); |
jobject jcopRet = env->GetObjectArrayElement(jAr,i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: role = "<<request->role<<PEGASUS_STD(endl)); | DDD(PEGASUS_STD(cerr)<<"--- JMPIProviderManager::handleReferenceNamesRequest: role = "<<request->role<<PEGASUS_STD(endl)); |
#endif | #endif |
| |
jobjectArray jVec=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
jobjectArray jAr=(jobjectArray)env->CallObjectMethod((jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jPathName, | jPathName, |
|
|
} | } |
| |
handler.processing(); | handler.processing(); |
if (jVec) { |
if (jAr) { |
for (int i=0,m=env->GetArrayLength(jVec); i<m; i++) { |
for (int i=0,m=env->GetArrayLength(jAr); i<m; i++) { |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jobject jcopRet = env->GetObjectArrayElement(jVec,i); |
jobject jcopRet = env->GetObjectArrayElement(jAr,i); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
return 0; | return 0; |
} | } |
| |
|
CMPI_SelectExp * |
|
newSelectExp (CIMOMHandleQueryContext *qContext, |
|
OperationContext *ctx, |
|
String& query, |
|
String& queryLanguage, |
|
CIMNamespaceName& nameSpace, |
|
Array<CIMName>& classNames, |
|
CIMPropertyList& propertyList) |
|
{ |
|
CMPI_SelectExp *eSelx = NULL; |
|
|
|
eSelx = new CMPI_SelectExp (*ctx, |
|
qContext, |
|
query, |
|
queryLanguage); |
|
|
|
if (!eSelx) |
|
{ |
|
return eSelx; |
|
} |
|
|
|
for (Uint32 i = 0, n = classNames.size (); i < n; i++) |
|
{ |
|
CIMObjectPath className (System::getHostName(), |
|
nameSpace, |
|
classNames[i]); |
|
|
|
eSelx->classNames.append (className); |
|
} |
|
|
|
if (!propertyList.isNull ()) |
|
{ |
|
Array<CIMName> p = propertyList.getPropertyNameArray (); |
|
int pCount = p.size (); |
|
|
|
eSelx->props = (const char**)malloc ((1 + pCount) * sizeof (char*)); |
|
|
|
for (int i = 0; i < pCount; i++) |
|
{ |
|
eSelx->props[i] = strdup (p[i].getString ().getCString ()); |
|
} |
|
|
|
eSelx->props[pCount] = NULL; |
|
} |
|
|
|
return eSelx; |
|
} |
|
|
Message * JMPIProviderManager::handleCreateSubscriptionRequest(const Message * message) throw() | Message * JMPIProviderManager::handleCreateSubscriptionRequest(const Message * message) throw() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "JMPIProviderManager::handleCreateSubscriptionRequest"); | PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "JMPIProviderManager::handleCreateSubscriptionRequest"); |
|
|
JNIEnv *env = NULL; | JNIEnv *env = NULL; |
| |
try { | try { |
String providerName, |
String fileName, |
|
providerName, |
providerLocation; | providerLocation; |
CIMInstance req_provider, | CIMInstance req_provider, |
req_providerModule; | req_providerModule; |
|
|
ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME); | ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME); |
| |
req_provider = pidc.getProvider(); | req_provider = pidc.getProvider(); |
req_providerModule = pidc.getModule(); | req_providerModule = pidc.getModule(); |
| |
LocateIndicationProviderNames(req_provider, req_providerModule,providerName,providerLocation); |
LocateIndicationProviderNames (req_provider, |
|
req_providerModule, |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
providerName, |
|
providerLocation); |
|
|
|
fileName = resolveFileName (providerLocation); |
|
|
|
Logger::put (Logger::STANDARD_LOG, |
|
System::CIMSERVER, |
|
Logger::TRACE, |
"JMPIProviderManager::handleCreateSubscriptionRequest - Host name: $0 Name space: $1 Provider name(s): $2", | "JMPIProviderManager::handleCreateSubscriptionRequest - Host name: $0 Name space: $1 Provider name(s): $2", |
System::getHostName(), | System::getHostName(), |
request->nameSpace.getString(), | request->nameSpace.getString(), |
providerName); | providerName); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", providername = "<<providerName<<PEGASUS_STD(endl)); |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: hostname = " |
|
<<System::getHostName() |
String fileName = resolveFileName(providerLocation); |
<<", namespace = " |
|
<<request->nameSpace.getString() |
|
<<", providername = " |
|
<<providerName |
|
<<", fileName = " |
|
<<fileName |
|
<<PEGASUS_STD(endl)); |
| |
// get cached or load new provider module | // get cached or load new provider module |
JMPIProvider::OpProviderHolder ph = providerManager.getProvider (fileName, providerName, |
JMPIProvider::OpProviderHolder ph = providerManager.getProvider (fileName, |
|
providerName, |
String::EMPTY); | String::EMPTY); |
| |
|
// |
|
// Save the provider instance from the request |
|
// |
|
ph.GetProvider ().setProviderInstance (req_provider); |
|
|
|
JMPIProvider &pr = ph.GetProvider (); |
|
|
|
// |
|
// Increment count of current subscriptions for this provider |
|
// |
|
pr.testIfZeroAndIncrementSubscriptions (); |
|
|
|
SubscriptionFilterConditionContainer sub_cntr = request->operationContext.get (SubscriptionFilterConditionContainer::NAME); |
indProvRecord *prec = NULL; | indProvRecord *prec = NULL; |
|
bool fNewPrec = false; |
|
|
|
{ |
|
AutoMutex lock (mutexProvTab); |
| |
provTab.lookup(providerName,prec); | provTab.lookup(providerName,prec); |
| |
if (prec) |
if (!prec) |
{ |
|
prec->count++; |
|
} |
|
else |
|
{ | { |
|
fNewPrec = true; |
|
|
prec=new indProvRecord(); | prec=new indProvRecord(); |
provTab.insert(providerName,prec); |
|
} |
|
| |
// |
// convert arguments |
// Save the provider instance from the request |
prec->ctx = new OperationContext (); |
// |
|
ph.GetProvider ().setProviderInstance (req_provider); |
|
| |
indSelectRecord *srec = new indSelectRecord(); |
prec->ctx->insert (request->operationContext.get (IdentityContainer::NAME)); |
const CIMObjectPath &sPath = request->subscriptionInstance.getPath(); |
prec->ctx->insert (request->operationContext.get (AcceptLanguageListContainer::NAME)); |
|
prec->ctx->insert (request->operationContext.get (ContentLanguageListContainer::NAME)); |
|
prec->ctx->insert (request->operationContext.get (SubscriptionInstanceContainer::NAME)); |
|
prec->ctx->insert (request->operationContext.get (SubscriptionFilterConditionContainer::NAME)); |
| |
selxTab.insert(sPath.toString(),srec); |
prec->enabled = true; |
| |
// convert arguments |
prec->handler = new EnableIndicationsResponseHandler (0, |
OperationContext *context=new OperationContext(); |
0, |
|
req_provider, |
|
_indicationCallback, |
|
_responseChunkCallback); |
| |
if (prec->ctx==NULL) |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: Adding to provTab "<<providerName<<PEGASUS_STD(endl)); |
{ |
|
prec->ctx=context; |
provTab.insert (providerName, prec); |
|
} |
} | } |
| |
context->insert(request->operationContext.get(IdentityContainer::NAME)); |
{ |
context->insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
AutoMutex lock (prec->mutex); |
context->insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
|
context->insert(request->operationContext.get(SubscriptionInstanceContainer::NAME)); |
|
context->insert(request->operationContext.get(SubscriptionFilterConditionContainer::NAME)); |
|
| |
CIMObjectPath subscriptionName = request->subscriptionInstance.getPath(); |
prec->count++; |
|
} |
| |
SubscriptionFilterConditionContainer sub_cntr = request->operationContext.get |
// Add a selection record for JNI CIMOMHandle deliverEvent calls |
(SubscriptionFilterConditionContainer::NAME); |
indSelectRecord *srec = new indSelectRecord (); |
| |
JMPIProvider &pr = ph.GetProvider(); |
{ |
|
srec->query = request->query; |
|
srec->queryLanguage = sub_cntr.getQueryLanguage (); |
|
srec->propertyList = request->propertyList; |
| |
CIMOMHandleQueryContext *qcontext=new CIMOMHandleQueryContext(CIMNamespaceName(request->nameSpace.getString()), |
CIMOMHandleQueryContext *qContext = new CIMOMHandleQueryContext (CIMNamespaceName (request->nameSpace.getString ()), |
*pr._cimom_handle); | *pr._cimom_handle); |
|
CMPI_SelectExp *eSelx = newSelectExp (qContext, |
CMPI_SelectExp *eSelx = new CMPI_SelectExp(*context, |
prec->ctx, |
qcontext, |
srec->query, |
request->query, |
srec->queryLanguage, |
sub_cntr.getQueryLanguage()); |
request->nameSpace, |
|
request->classNames, |
|
srec->propertyList); |
| |
srec->eSelx=eSelx; | srec->eSelx=eSelx; |
srec->qContext=qcontext; |
srec->qContext = qContext; |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.createSubscriptionRequest: " + pr.getName()); |
CIMObjectPath sPath (request->subscriptionInstance.getPath ().getClassName ().getString ()); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: Calling provider createSubscriptionRequest: "<<pr.getName()<<PEGASUS_STD(endl)); |
sPath.setNameSpace (request->subscriptionInstance.getPath ().getNameSpace ()); |
| |
for(Uint32 i = 0, n = request->classNames.size(); i < n; i++) { |
AutoMutex lock (mutexSelxTab); |
CIMObjectPath className( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->classNames[i]); |
|
eSelx->classNames.append(className); |
|
} |
|
|
|
CIMPropertyList propertyList = request->propertyList; |
|
| |
if (!propertyList.isNull()) |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: Adding to selxTab "<<sPath.toString ()<<PEGASUS_STD(endl)); |
{ |
|
Array<CIMName> p = propertyList.getPropertyNameArray(); |
|
int pCount = p.size(); |
|
| |
eSelx->props=(const char**)malloc((1+pCount)*sizeof(char*)); |
selxTab.insert (sPath.toString (), srec); |
| |
for (int i=0; i<pCount; i++) |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: For selxTab "<<sPath.toString ()<<", srec = "<<PEGASUS_STD(hex)<<(int)srec<<PEGASUS_STD(dec)<<", eSelx = "<<PEGASUS_STD(hex)<<(int)eSelx<<PEGASUS_STD(dec)<<", qContext = "<<PEGASUS_STD(hex)<<(int)qContext<<PEGASUS_STD(dec)<<PEGASUS_STD(endl)); |
{ |
|
eSelx->props[i]=strdup(p[i].getString().getCString()); |
|
} |
|
eSelx->props[pCount]=NULL; |
|
} | } |
| |
|
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.createSubscriptionRequest: " + pr.getName()); |
|
|
|
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: Calling provider createSubscriptionRequest: "<<pr.getName()<<PEGASUS_STD(endl)); |
|
|
JvmVector *jv = 0; | JvmVector *jv = 0; |
| |
env = JMPIjvm::attachThread(&jv); | env = JMPIjvm::attachThread(&jv); |
|
|
String interfaceType; | String interfaceType; |
String interfaceVersion; | String interfaceVersion; |
| |
getInterfaceType (request->operationContext.get (ProviderIdContainer::NAME), |
getInterfaceType (pidc, |
interfaceType, | interfaceType, |
interfaceVersion); | interfaceVersion); |
| |
|
|
{ | { |
case METHOD_EVENTPROVIDER: | case METHOD_EVENTPROVIDER: |
{ | { |
jint jSelRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx); |
CMPI_SelectExp *eSelx = newSelectExp (srec->qContext, |
jobject jSel = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jSelRef); |
prec->ctx, |
|
srec->query, |
|
srec->queryLanguage, |
|
request->nameSpace, |
|
request->classNames, |
|
srec->propertyList); |
|
jint jEselxRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx); |
|
jobject jEselx = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jEselxRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jint jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, &eSelx->classNames[0]); |
jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString()); |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef); |
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString()); |
CIMObjectPath *cop = new CIMObjectPath (System::getHostName(), |
|
request->nameSpace, |
|
request->classNames[0]); |
|
jint jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, cop); |
|
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
env->CallVoidMethod((jobject)pr.jProvider, | env->CallVoidMethod((jobject)pr.jProvider, |
id, | id, |
jSel, |
jEselx, |
jType, | jType, |
jcop, | jcop, |
(jboolean)0); |
(jboolean)fNewPrec); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
// |
|
// Increment count of current subscriptions for this provider |
|
// |
|
if (ph.GetProvider ().testIfZeroAndIncrementSubscriptions ()) |
|
{ |
|
// |
|
// If there were no current subscriptions before the increment, |
|
// the first subscription has been created |
|
// Call the provider's enableIndications method |
|
// |
|
if (_subscriptionInitComplete) |
|
{ |
|
prec->enabled = true; |
|
CIMRequestMessage * request = 0; |
|
CIMResponseMessage * response = 0; |
|
prec->handler = new EnableIndicationsResponseHandler ( |
|
request, |
|
response, |
|
req_provider, |
|
_indicationCallback, |
|
_responseChunkCallback); |
|
} |
|
} |
|
|
|
STAT_PMS_PROVIDEREND; | STAT_PMS_PROVIDEREND; |
break; | break; |
} | } |
|
|
jint jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext); | jint jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext); |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef); | jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef); |
| |
jint jSelRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx); |
CMPI_SelectExp *eSelx = newSelectExp (srec->qContext, |
jobject jSel = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jSelRef); |
prec->ctx, |
|
srec->query, |
|
srec->queryLanguage, |
|
request->nameSpace, |
|
request->classNames, |
|
srec->propertyList); |
|
jint jEselxRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx); |
|
jobject jEselx = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jEselxRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jint jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, &eSelx->classNames[0]); |
jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString()); |
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef); |
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString()); |
CIMObjectPath *cop = new CIMObjectPath (System::getHostName(), |
|
request->nameSpace, |
|
request->classNames[0]); |
|
jint jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, cop); |
|
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
env->CallVoidMethod((jobject)pr.jProvider, | env->CallVoidMethod((jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jSel, |
jEselx, |
jType, | jType, |
jcop, | jcop, |
(jboolean)0); |
(jboolean)fNewPrec); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
} | } |
| |
// |
|
// Increment count of current subscriptions for this provider |
|
// |
|
if (ph.GetProvider ().testIfZeroAndIncrementSubscriptions ()) |
|
{ |
|
// |
|
// If there were no current subscriptions before the increment, |
|
// the first subscription has been created |
|
// Call the provider's enableIndications method |
|
// |
|
if (_subscriptionInitComplete) |
|
{ |
|
prec->enabled = true; |
|
CIMRequestMessage * request = 0; |
|
CIMResponseMessage * response = 0; |
|
prec->handler = new EnableIndicationsResponseHandler( |
|
request, |
|
response, |
|
req_provider, |
|
_indicationCallback, |
|
_responseChunkCallback); |
|
} |
|
} |
|
|
|
STAT_PMS_PROVIDEREND; | STAT_PMS_PROVIDEREND; |
break; | break; |
} | } |
|
|
break; | break; |
} | } |
} | } |
|
|
} | } |
HandlerCatch(handler); | HandlerCatch(handler); |
| |
|
|
} METHOD_VERSION; | } METHOD_VERSION; |
METHOD_VERSION eMethodFound = METHOD_UNKNOWN; | METHOD_VERSION eMethodFound = METHOD_UNKNOWN; |
JNIEnv *env = NULL; | JNIEnv *env = NULL; |
|
bool fFreePrec = false; |
|
indProvRecord *prec = NULL; |
|
indSelectRecord *srec = NULL; |
| |
try { | try { |
String providerName, |
String fileName, |
|
providerName, |
providerLocation; | providerLocation; |
CIMInstance req_provider, | CIMInstance req_provider, |
req_providerModule; | req_providerModule; |
|
|
req_provider = pidc.getProvider(); | req_provider = pidc.getProvider(); |
req_providerModule = pidc.getModule(); | req_providerModule = pidc.getModule(); |
| |
LocateIndicationProviderNames(req_provider, req_providerModule, providerName,providerLocation); |
LocateIndicationProviderNames (req_provider, |
|
req_providerModule, |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
providerName, |
|
providerLocation); |
|
|
|
fileName = resolveFileName (providerLocation); |
|
|
|
Logger::put (Logger::STANDARD_LOG, |
|
System::CIMSERVER, |
|
Logger::TRACE, |
"JMPIProviderManager::handleDeleteSubscriptionRequest - Host name: $0 Name space: $1 Provider name(s): $2", | "JMPIProviderManager::handleDeleteSubscriptionRequest - Host name: $0 Name space: $1 Provider name(s): $2", |
System::getHostName(), | System::getHostName(), |
request->nameSpace.getString(), | request->nameSpace.getString(), |
providerName); | providerName); |
| |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: hostname = "<<System::getHostName()<<", namespace = "<<request->nameSpace.getString()<<", providername = "<<providerName<<PEGASUS_STD(endl)); |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: hostname = " |
|
<<System::getHostName() |
String fileName = resolveFileName(providerLocation); |
<<", namespace = " |
|
<<request->nameSpace.getString() |
|
<<", providername = " |
|
<<providerName |
|
<<", fileName = " |
|
<<fileName |
|
<<PEGASUS_STD(endl)); |
| |
// get cached or load new provider module | // get cached or load new provider module |
JMPIProvider::OpProviderHolder ph = providerManager.getProvider (fileName, providerName, |
JMPIProvider::OpProviderHolder ph = providerManager.getProvider (fileName, |
|
providerName, |
String::EMPTY); | String::EMPTY); |
| |
indProvRecord *prec = NULL; |
JMPIProvider &pr = ph.GetProvider (); |
|
|
|
{ |
|
AutoMutex lock (mutexProvTab); |
| |
provTab.lookup(providerName,prec); | provTab.lookup(providerName,prec); |
|
} |
|
|
|
{ |
|
AutoMutex lock (prec->mutex); |
|
|
if (--prec->count <= 0) | if (--prec->count <= 0) |
{ | { |
|
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: Removing provTab "<<providerName<<PEGASUS_STD(endl)); |
|
|
provTab.remove(providerName); | provTab.remove(providerName); |
prec=NULL; |
|
|
fFreePrec = true; |
|
} |
} | } |
| |
indSelectRecord *srec = NULL; |
{ |
const CIMObjectPath &sPath = request->subscriptionInstance.getPath(); |
CIMObjectPath sPath (request->subscriptionInstance.getPath ().getClassName ().getString ()); |
|
|
|
sPath.setNameSpace (request->subscriptionInstance.getPath ().getNameSpace ()); |
|
|
String sPathString = sPath.toString(); | String sPathString = sPath.toString(); |
| |
selxTab.lookup(sPathString,srec); |
AutoMutex lock (mutexSelxTab); |
| |
CMPI_SelectExp *eSelx = srec->eSelx; |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: Removing selxTab "<<sPathString<<PEGASUS_STD(endl)); |
CIMOMHandleQueryContext *qContext = srec->qContext; |
|
| |
selxTab.remove(sPathString); |
selxTab.lookup (sPathString, srec); |
| |
CIMObjectPath subscriptionName = request->subscriptionInstance.getPath(); |
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: For selxTab "<<sPathString<<", srec = "<<PEGASUS_STD(hex)<<(int)srec<<PEGASUS_STD(dec)<<", eSelx = "<<PEGASUS_STD(hex)<<(int)srec->eSelx<<PEGASUS_STD(dec)<<", qContext = "<<PEGASUS_STD(hex)<<(int)srec->qContext<<PEGASUS_STD(dec)<<PEGASUS_STD(endl)); |
| |
JMPIProvider & pr=ph.GetProvider(); |
selxTab.remove (sPathString); |
|
} |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.deleteSubscriptionRequest: " + pr.getName()); | PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.deleteSubscriptionRequest: " + pr.getName()); |
| |
|
|
// throws org.pegasus.jmpi.CIMException | // throws org.pegasus.jmpi.CIMException |
id = env->GetMethodID((jclass)pr.jProviderClass, | id = env->GetMethodID((jclass)pr.jProviderClass, |
"deActivateFilter", | "deActivateFilter", |
"(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) |
{ | { |
|
|
{ | { |
case METHOD_EVENTPROVIDER: | case METHOD_EVENTPROVIDER: |
{ | { |
jint jObj = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx); |
CMPI_SelectExp *eSelx = newSelectExp (srec->qContext, |
jobject jSel = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jObj); |
prec->ctx, |
|
srec->query, |
|
srec->queryLanguage, |
|
request->nameSpace, |
|
request->classNames, |
|
srec->propertyList); |
|
jint jEselxRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx); |
|
jobject jEselx = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jEselxRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jObj = DEBUG_ConvertCToJava (CIMObjectPath*, jint, &eSelx->classNames[0]); |
jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString()); |
|
|
jobject jRef = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jObj); |
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString()); |
CIMObjectPath *cop = new CIMObjectPath (System::getHostName(), |
|
request->nameSpace, |
|
request->classNames[0]); |
|
jint jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, cop); |
|
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
env->CallVoidMethod((jobject)pr.jProvider, | env->CallVoidMethod((jobject)pr.jProvider, |
id, | id, |
jSel, |
jEselx, |
jType, | jType, |
jRef, |
jcop, |
(jboolean)(prec==NULL)); |
(jboolean)fFreePrec); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
// |
|
// Decrement count of current subscriptions for this provider |
|
// |
|
if (ph.GetProvider ().decrementSubscriptionsAndTestIfZero ()) |
|
{ |
|
// |
|
// If there are no current subscriptions after the decrement, |
|
// the last subscription has been deleted |
|
// Call the provider's disableIndications method |
|
// |
|
if (_subscriptionInitComplete) |
|
{ |
|
prec->enabled = false; |
|
if (prec->handler) delete prec->handler; |
|
prec->handler = NULL; |
|
} |
|
} |
|
|
|
STAT_PMS_PROVIDEREND; | STAT_PMS_PROVIDEREND; |
|
|
delete eSelx; |
|
delete qContext; |
|
delete srec; |
|
break; | break; |
} | } |
| |
|
|
jint jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext); | jint jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext); |
jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef); | jobject joc = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef); |
| |
jint jObj = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx); |
CMPI_SelectExp *eSelx = newSelectExp (srec->qContext, |
jobject jSel = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jObj); |
prec->ctx, |
|
srec->query, |
|
srec->queryLanguage, |
|
request->nameSpace, |
|
request->classNames, |
|
srec->propertyList); |
|
jint jEselxRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx); |
|
jobject jEselx = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jEselxRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jObj = DEBUG_ConvertCToJava (CIMObjectPath*, jint, &eSelx->classNames[0]); |
jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString()); |
|
|
jobject jRef = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jObj); |
|
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
jstring jType = env->NewStringUTF(request->nameSpace.getString().getCString()); |
CIMObjectPath *cop = new CIMObjectPath (System::getHostName(), |
|
request->nameSpace, |
|
request->classNames[0]); |
|
jint jcopRef = DEBUG_ConvertCToJava (CIMObjectPath*, jint, cop); |
|
jobject jcop = env->NewObject(jv->CIMObjectPathClassRef,jv->CIMObjectPathNewI,jcopRef); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
env->CallVoidMethod((jobject)pr.jProvider, | env->CallVoidMethod((jobject)pr.jProvider, |
id, | id, |
joc, | joc, |
jSel, |
jEselx, |
jType, | jType, |
jRef, |
jcop, |
(jboolean)(prec==NULL)); |
(jboolean)fFreePrec); |
| |
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
| |
|
|
JMPIjvm::checkException(env); | JMPIjvm::checkException(env); |
} | } |
| |
// |
|
// Decrement count of current subscriptions for this provider |
|
// |
|
if (ph.GetProvider ().decrementSubscriptionsAndTestIfZero ()) |
|
{ |
|
// |
|
// If there are no current subscriptions after the decrement, |
|
// the last subscription has been deleted |
|
// Call the provider's disableIndications method |
|
// |
|
if (_subscriptionInitComplete) |
|
{ |
|
prec->enabled = false; |
|
if (prec->handler) delete prec->handler; |
|
prec->handler = NULL; |
|
} |
|
} |
|
|
|
STAT_PMS_PROVIDEREND; | STAT_PMS_PROVIDEREND; |
|
|
delete eSelx; |
|
delete qContext; |
|
delete srec; |
|
break; | break; |
} | } |
| |
|
|
break; | break; |
} | } |
} | } |
|
|
|
// |
|
// Decrement count of current subscriptions for this provider |
|
// |
|
pr.decrementSubscriptionsAndTestIfZero (); |
} | } |
HandlerCatch(handler); | HandlerCatch(handler); |
| |
|
if (srec) |
|
{ |
|
if ( srec->eSelx |
|
&& srec->eSelx->props |
|
) |
|
{ |
|
const char **props = srec->eSelx->props; |
|
|
|
while (*props) |
|
{ |
|
const char *prop = *props; |
|
|
|
props++; |
|
|
|
if (prop) |
|
{ |
|
free ((void *)prop); |
|
} |
|
} |
|
|
|
free ((void *)srec->eSelx->props); |
|
} |
|
delete srec->eSelx; |
|
delete srec->qContext; |
|
} |
|
delete srec; |
|
|
|
if (fFreePrec) |
|
{ |
|
delete prec->ctx; |
|
delete prec->handler; |
|
delete prec; |
|
} |
|
|
if (env) JMPIjvm::detachThread(); | if (env) JMPIjvm::detachThread(); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
|
|
// provider's enableIndications method | // provider's enableIndications method |
// | // |
Array <JMPIProvider *> enableProviders; | Array <JMPIProvider *> enableProviders; |
|
|
enableProviders = providerManager.getIndicationProvidersToEnable (); | enableProviders = providerManager.getIndicationProvidersToEnable (); |
| |
Uint32 numProviders = enableProviders.size (); | Uint32 numProviders = enableProviders.size (); |
|
|
|
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleSubscriptionInitCompleteRequest: numProviders = "<<numProviders<<PEGASUS_STD(endl)); |
|
|
|
#if 0 |
for (Uint32 i = 0; i < numProviders; i++) | for (Uint32 i = 0; i < numProviders; i++) |
{ | { |
try | try |
{ | { |
CIMInstance provider; | CIMInstance provider; |
|
|
provider = enableProviders [i]->getProviderInstance (); | provider = enableProviders [i]->getProviderInstance (); |
| |
|
DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleSubscriptionInitCompleteRequest: name = "<<enableProviders[i]->getName ()<<PEGASUS_STD(endl)); |
|
|
// | // |
// Get cached or load new provider module | // Get cached or load new provider module |
// | // |
JMPIProvider::OpProviderHolder ph = providerManager.getProvider |
JMPIProvider::OpProviderHolder ph = providerManager.getProvider (enableProviders[i]->getModule ()->getFileName (), |
(enableProviders [i]->getModule ()->getFileName (), |
|
enableProviders [i]->getName ()); | enableProviders [i]->getName ()); |
|
|
indProvRecord * prec = NULL; | indProvRecord * prec = NULL; |
provTab.lookup (enableProviders [i]->getName (), prec); |
|
if (prec) |
|
{ | { |
prec->enabled = true; |
AutoMutex lock (mutexProvTab); |
CIMRequestMessage * request = 0; |
|
CIMResponseMessage * response = 0; |
provTab.lookup (enableProviders[i]->getName (), prec); |
prec->handler = new EnableIndicationsResponseHandler( |
|
request, |
|
response, |
|
provider, |
|
_indicationCallback, |
|
_responseChunkCallback); |
|
} | } |
} | } |
catch (CIMException & e) | catch (CIMException & e) |
|
|
"Unknown error in handleSubscriptionInitCompleteRequest"); | "Unknown error in handleSubscriptionInitCompleteRequest"); |
} | } |
} | } |
|
#endif |
| |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
return (response); | return (response); |