summaryrefslogtreecommitdiff
path: root/jvmaccess
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2004-11-09 10:50:10 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2004-11-09 10:50:10 +0000
commit6abd4383c1a70b9c4693819a8dd98a5282cde06c (patch)
treeac621240c6c7bbb833cbb921ddb0e0c193854e2d /jvmaccess
parent7e94defad99735d66b71baf5c7d061dbcdc48a3d (diff)
INTEGRATION: CWS nojava1 (1.3.42); FILE MERGED
2004/08/16 15:20:48 cmc 1.3.42.2: #i33045# use normal -DSOLAR_JAVA 2004/08/16 14:21:41 cmc 1.3.42.1: #i33045# build jvmaccess even without java, just default to failure on javarelated stuff
Diffstat (limited to 'jvmaccess')
-rw-r--r--jvmaccess/source/virtualmachine.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/jvmaccess/source/virtualmachine.cxx b/jvmaccess/source/virtualmachine.cxx
index b372da784..6f1a9c1f0 100644
--- a/jvmaccess/source/virtualmachine.cxx
+++ b/jvmaccess/source/virtualmachine.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: virtualmachine.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: obo $ $Date: 2003-09-04 11:40:56 $
+ * last change: $Author: hr $ $Date: 2004-11-09 11:50:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -125,6 +125,7 @@ VirtualMachine::~VirtualMachine()
void VirtualMachine::acquireInitialContextClassLoader(JNIEnv * pEnv)
{
+#ifdef SOLAR_JAVA
jclass aClass = pEnv->FindClass("java/lang/Thread");
jmethodID aMethod1 = pEnv->GetStaticMethodID(aClass, "currentThread",
"()Ljava/lang/Thread;");
@@ -142,10 +143,12 @@ void VirtualMachine::acquireInitialContextClassLoader(JNIEnv * pEnv)
OSL_ENSURE(m_aInitialContextClassLoader != 0,
"JNI: NewGlobalRef failed");
}
+#endif
}
void VirtualMachine::releaseInitialContextClassLoader() const
{
+#ifdef SOLAR_JAVA
if (m_aInitialContextClassLoader != 0)
{
JNIEnv * pEnv;
@@ -159,10 +162,14 @@ void VirtualMachine::releaseInitialContextClassLoader() const
OSL_ENSURE(n == JNI_OK, "JNI: DetachCurrentThread failed");
}
}
+#endif
}
JNIEnv * VirtualMachine::attachThread(bool * pAttached) const
{
+#ifndef SOLAR_JAVA
+ return 0;
+#else
OSL_ENSURE(pAttached != 0, "bad parameter");
JNIEnv * pEnv;
jint n = m_pVm->GetEnv(reinterpret_cast< void ** >(&pEnv), m_nVersion);
@@ -190,10 +197,13 @@ JNIEnv * VirtualMachine::attachThread(bool * pAttached) const
else
*pAttached = false;
return pEnv;
+#endif
}
void VirtualMachine::detachThread() const
{
+#ifdef SOLAR_JAVA
jint n = m_pVm->DetachCurrentThread();
OSL_ENSURE(n == JNI_OK, "JNI: DetachCurrentThread failed");
+#endif
}