version 1.13, 2005/06/02 20:36:40
|
version 1.17.2.1, 2006/02/10 16:12:03
|
|
|
//%2005//////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development | // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. | // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. | // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; | // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
// EMC Corporation; VERITAS Software Corporation; The Open Group. | // EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
#include <Pegasus/Common/String.h> | #include <Pegasus/Common/String.h> |
#include <Pegasus/Common/System.h> | #include <Pegasus/Common/System.h> |
#include <Pegasus/Common/HashTable.h> | #include <Pegasus/Common/HashTable.h> |
|
#include <Pegasus/Common/Mutex.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
|
#define Catch(jEnv) \ | #define Catch(jEnv) \ |
catch(CIMException & e) { \ | catch(CIMException & e) { \ |
JMPIjvm::cacheIDs(jEnv); \ | JMPIjvm::cacheIDs(jEnv); \ |
jobject ev=jEnv->NewObject(classRefs[13],instanceMethodIDs[33],(jint)e.getCode(),jEnv->NewStringUTF(e.getMessage().getCString())); \ |
jobject ev=jEnv->NewObject(JMPIjvm::jv.CIMExceptionClassRef,JMPIjvm::jv.CIMExceptionNewISt,(jint)e.getCode(),jEnv->NewStringUTF(e.getMessage().getCString())); \ |
jEnv->Throw((jthrowable)ev); \ | jEnv->Throw((jthrowable)ev); \ |
} \ | } \ |
catch(Exception & e) { \ | catch(Exception & e) { \ |
JMPIjvm::cacheIDs(jEnv);\ | JMPIjvm::cacheIDs(jEnv);\ |
jobject ev=jEnv->NewObject(classRefs[13],instanceMethodIDs[33],(jint)1,jEnv->NewStringUTF(e.getMessage().getCString())); \ |
jobject ev=jEnv->NewObject(JMPIjvm::jv.CIMExceptionClassRef,JMPIjvm::jv.CIMExceptionNewISt,(jint)1,jEnv->NewStringUTF(e.getMessage().getCString())); \ |
jEnv->Throw((jthrowable)ev); \ | jEnv->Throw((jthrowable)ev); \ |
} \ | } \ |
catch(...) { \ | catch(...) { \ |
JMPIjvm::cacheIDs(jEnv); \ | JMPIjvm::cacheIDs(jEnv); \ |
jobject ev=jEnv->NewObject(classRefs[13],instanceMethodIDs[33],(jint)1,"Exception: Unknown"); \ |
jobject ev=jEnv->NewObject(JMPIjvm::jv.CIMExceptionClassRef,JMPIjvm::jv.CIMExceptionNewISt,(jint)1,"Exception: Unknown"); \ |
jEnv->Throw((jthrowable)ev); \ | jEnv->Throw((jthrowable)ev); \ |
} | } |
| |
|
typedef struct { |
|
int clsIndex; |
|
const char *methodName; |
|
const char *signature; |
|
} METHOD_STRUCT; |
|
|
typedef struct jvmVector { | typedef struct jvmVector { |
int initRc; | int initRc; |
JavaVM *jvm; | JavaVM *jvm; |
|
|
jclass *classRefs; | jclass *classRefs; |
jmethodID *instMethodIDs; | jmethodID *instMethodIDs; |
jmethodID *staticMethodIDs; | jmethodID *staticMethodIDs; |
|
const METHOD_STRUCT *instanceMethodNames; |
} JvmVector; | } JvmVector; |
| |
class JMPIjvm { | class JMPIjvm { |
|
|
| |
static ClassTable _classTable; | static ClassTable _classTable; |
static ObjectTable _objectTable; | static ObjectTable _objectTable; |
|
|
|
static Mutex _initMutex; |
}; | }; |
| |
class _nameSpace { | class _nameSpace { |