[Arakhnę-Dev] [205] * Avoid to stop the JVM when a native library for the OperatingSystem class could not be loaded . |
[ Thread Index |
Date Index
| More arakhne.org/dev Archives
]
- To: dev@xxxxxxxxxxx
- Subject: [Arakhnę-Dev] [205] * Avoid to stop the JVM when a native library for the OperatingSystem class could not be loaded .
- From: subversion@xxxxxxxxxxxxx
- Date: Mon, 14 Feb 2011 18:51:20 +0100
Revision: 205
Author: galland
Date: 2011-02-14 18:51:20 +0100 (Mon, 14 Feb 2011)
Log Message:
-----------
* Avoid to stop the JVM when a native library for the OperatingSystem class could not be loaded.
Modified Paths:
--------------
trunk/arakhneVmutils/java/pom.xml
trunk/arakhneVmutils/java/src/main/java/org/arakhne/vmutil/OperatingSystemInfo.java
trunk/arakhneVmutils/native/josuuid/linux32/pom.xml
trunk/arakhneVmutils/native/josuuid/linux64/pom.xml
trunk/arakhneVmutils/native/josuuid/mingw32/pom.xml
trunk/arakhneVmutils/native/josuuid/mingw64/pom.xml
Added Paths:
-----------
trunk/arakhneVmutils/native/josuuid/src/main/native/OperatingSystemNativeWrapperJNI.c
Removed Paths:
-------------
trunk/arakhneVmutils/native/josuuid/src/main/native/OperatingSystemJNI.c
trunk/arakhneVmutils/native/josuuid/src/test/
Modified: trunk/arakhneVmutils/java/pom.xml
===================================================================
--- trunk/arakhneVmutils/java/pom.xml 2011-02-14 17:09:54 UTC (rev 204)
+++ trunk/arakhneVmutils/java/pom.xml 2011-02-14 17:51:20 UTC (rev 205)
@@ -32,19 +32,6 @@
<build>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <index>false</index>
- <manifestFile>${manifest.file}</manifestFile>
- <manifest>
- <mainClass>org.arakhne.vmutil.OperatingSystemInfo</mainClass>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- <plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.1.0</version>
@@ -63,13 +50,10 @@
<archive>
+ <manifest>
+ <mainClass>org.arakhne.vmutil.OperatingSystemInfo</mainClass>
+ </manifest>
<manifestFile>${manifest.file}</manifestFile>
- <!--
- <manifest>
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
- <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
- </manifest>
- -->
</archive>
<instructions>
Modified: trunk/arakhneVmutils/java/src/main/java/org/arakhne/vmutil/OperatingSystemInfo.java
===================================================================
--- trunk/arakhneVmutils/java/src/main/java/org/arakhne/vmutil/OperatingSystemInfo.java 2011-02-14 17:09:54 UTC (rev 204)
+++ trunk/arakhneVmutils/java/src/main/java/org/arakhne/vmutil/OperatingSystemInfo.java 2011-02-14 17:51:20 UTC (rev 205)
@@ -21,6 +21,7 @@
package org.arakhne.vmutil;
+
/**
* This class print on the standard output several informations
* about your operating system.
@@ -61,10 +62,13 @@
showPropertyValue("java.library.path"); //$NON-NLS-1$
showPropertyValue("java.home"); //$NON-NLS-1$
showPropertyValue("os.name"); //$NON-NLS-1$
+ showPropertyValue("os.version"); //$NON-NLS-1$
+ showPropertyValue("file.separator"); //$NON-NLS-1$
showPropertyValue("path.separator"); //$NON-NLS-1$
showPropertyValue("sun.arch.data.model"); //$NON-NLS-1$
showPropertyValue("user.dir"); //$NON-NLS-1$
showPropertyValue("user.name"); //$NON-NLS-1$
+ showPropertyValue("user.home"); //$NON-NLS-1$
showTitle("OperatingSystem"); //$NON-NLS-1$
Modified: trunk/arakhneVmutils/native/josuuid/linux32/pom.xml
===================================================================
--- trunk/arakhneVmutils/native/josuuid/linux32/pom.xml 2011-02-14 17:09:54 UTC (rev 204)
+++ trunk/arakhneVmutils/native/josuuid/linux32/pom.xml 2011-02-14 17:51:20 UTC (rev 205)
@@ -48,7 +48,7 @@
<directory>../src/main/native</directory>
<fileNames>
<fileName>josuuid.c</fileName>
- <fileName>OperatingSystemJNI.c</fileName>
+ <fileName>OperatingSystemNativeWrapperJNI.c</fileName>
</fileNames>
</source>
@@ -66,7 +66,7 @@
<phase>generate-sources</phase>
<configuration>
<classNames>
- <className>org.arakhne.vmutil.OperatingSystem</className>
+ <className>org.arakhne.vmutil.OperatingSystemNativeWrapper</className>
</classNames>
</configuration>
<goals>
Modified: trunk/arakhneVmutils/native/josuuid/linux64/pom.xml
===================================================================
--- trunk/arakhneVmutils/native/josuuid/linux64/pom.xml 2011-02-14 17:09:54 UTC (rev 204)
+++ trunk/arakhneVmutils/native/josuuid/linux64/pom.xml 2011-02-14 17:51:20 UTC (rev 205)
@@ -48,7 +48,7 @@
<directory>../src/main/native</directory>
<fileNames>
<fileName>josuuid.c</fileName>
- <fileName>OperatingSystemJNI.c</fileName>
+ <fileName>OperatingSystemNativeWrapperJNI.c</fileName>
</fileNames>
</source>
@@ -66,7 +66,7 @@
<phase>generate-sources</phase>
<configuration>
<classNames>
- <className>org.arakhne.vmutil.OperatingSystem</className>
+ <className>org.arakhne.vmutil.OperatingSystemNativeWrapper</className>
</classNames>
</configuration>
<goals>
Modified: trunk/arakhneVmutils/native/josuuid/mingw32/pom.xml
===================================================================
--- trunk/arakhneVmutils/native/josuuid/mingw32/pom.xml 2011-02-14 17:09:54 UTC (rev 204)
+++ trunk/arakhneVmutils/native/josuuid/mingw32/pom.xml 2011-02-14 17:51:20 UTC (rev 205)
@@ -84,7 +84,7 @@
<fileNames>
<fileName>josuuid.c</fileName>
<fileName>winos.c</fileName>
- <fileName>OperatingSystemJNI.c</fileName>
+ <fileName>OperatingSystemNativeWrapperJNI.c</fileName>
</fileNames>
</source>
</sources>
@@ -102,7 +102,7 @@
<phase>generate-sources</phase>
<configuration>
<classNames>
- <className>org.arakhne.vmutil.OperatingSystem</className>
+ <className>org.arakhne.vmutil.OperatingSystemNativeWrapper</className>
</classNames>
</configuration>
<goals>
Modified: trunk/arakhneVmutils/native/josuuid/mingw64/pom.xml
===================================================================
--- trunk/arakhneVmutils/native/josuuid/mingw64/pom.xml 2011-02-14 17:09:54 UTC (rev 204)
+++ trunk/arakhneVmutils/native/josuuid/mingw64/pom.xml 2011-02-14 17:51:20 UTC (rev 205)
@@ -84,7 +84,7 @@
<fileNames>
<fileName>josuuid.c</fileName>
<fileName>winos.c</fileName>
- <fileName>OperatingSystemJNI.c</fileName>
+ <fileName>OperatingSystemNativeWrapperJNI.c</fileName>
</fileNames>
</source>
</sources>
@@ -102,7 +102,7 @@
<phase>generate-sources</phase>
<configuration>
<classNames>
- <className>org.arakhne.vmutil.OperatingSystem</className>
+ <className>org.arakhne.vmutil.OperatingSystemNativeWrapper</className>
</classNames>
</configuration>
<goals>
Deleted: trunk/arakhneVmutils/native/josuuid/src/main/native/OperatingSystemJNI.c
===================================================================
--- trunk/arakhneVmutils/native/josuuid/src/main/native/OperatingSystemJNI.c 2011-02-14 17:09:54 UTC (rev 204)
+++ trunk/arakhneVmutils/native/josuuid/src/main/native/OperatingSystemJNI.c 2011-02-14 17:51:20 UTC (rev 205)
@@ -1,65 +0,0 @@
-/*
- * $Id$
- *
- * Copyright (C) 2005-2010 Stéphane GALLAND
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * This program is free software; you can redistribute it and/or modify
- */
-
-#ifdef DEBUG
-# warning THE LIBRARY IS COMPILED WITH DEBUG INFORMATION
-#endif
-
-#include <jni.h>
-#include <stdlib.h>
-
-#include "org_arakhne_vmutil_OperatingSystem.h"
-#include "josuuid.h"
-
-/*
- * Class: org_arakhne_vmutil_OperatingSystem
- * Method: getOSSerialNumber
- * Signature: ()Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL
-Java_org_arakhne_vmutil_OperatingSystem_getOSSerialNumber
-(JNIEnv * env, jclass clazz) {
- jstring jSerial = NULL;
- char* cSerial = getOSSerial();
- if (cSerial!=NULL) {
- jSerial = (*env)->NewStringUTF (env, cSerial);
- free(cSerial);
- }
- return jSerial;
-}
-
-
-/*
- * Class: org_arakhne_vmutil_OperatingSystem
- * Method: getOSUUID
- * Signature: ()Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL
-Java_org_arakhne_vmutil_OperatingSystem_getOSUUID
-(JNIEnv *env, jclass clazz) {
- jstring jUUID = NULL;
- char* cUUID = getOSUUID();
- if (cUUID!=NULL) {
- jUUID = (*env)->NewStringUTF (env, cUUID);
- free(cUUID);
- }
- return jUUID;
-}
Copied: trunk/arakhneVmutils/native/josuuid/src/main/native/OperatingSystemNativeWrapperJNI.c (from rev 204, trunk/arakhneVmutils/native/josuuid/src/main/native/OperatingSystemJNI.c)
===================================================================
--- trunk/arakhneVmutils/native/josuuid/src/main/native/OperatingSystemNativeWrapperJNI.c (rev 0)
+++ trunk/arakhneVmutils/native/josuuid/src/main/native/OperatingSystemNativeWrapperJNI.c 2011-02-14 17:51:20 UTC (rev 205)
@@ -0,0 +1,65 @@
+/*
+ * $Id$
+ *
+ * Copyright (C) 2005-2010 Stéphane GALLAND
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * This program is free software; you can redistribute it and/or modify
+ */
+
+#ifdef DEBUG
+# warning THE LIBRARY IS COMPILED WITH DEBUG INFORMATION
+#endif
+
+#include <jni.h>
+#include <stdlib.h>
+
+#include "org_arakhne_vmutil_OperatingSystemNativeWrapper.h"
+#include "josuuid.h"
+
+/*
+ * Class: org_arakhne_vmutil_OperatingSystemNativeWrapper
+ * Method: getOSSerialNumber
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL
+Java_org_arakhne_vmutil_OperatingSystemNativeWrapper_getOSSerialNumber
+(JNIEnv * env, jclass clazz) {
+ jstring jSerial = NULL;
+ char* cSerial = getOSSerial();
+ if (cSerial!=NULL) {
+ jSerial = (*env)->NewStringUTF (env, cSerial);
+ free(cSerial);
+ }
+ return jSerial;
+}
+
+
+/*
+ * Class: org_arakhne_vmutil_OperatingSystemNativeWrapper
+ * Method: getOSUUID
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL
+Java_org_arakhne_vmutil_OperatingSystemNativeWrapper_getOSUUID
+(JNIEnv *env, jclass clazz) {
+ jstring jUUID = NULL;
+ char* cUUID = getOSUUID();
+ if (cUUID!=NULL) {
+ jUUID = (*env)->NewStringUTF (env, cUUID);
+ free(cUUID);
+ }
+ return jUUID;
+}