java update
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 12 Jun 2006 17:18:46 +0000 (17:18 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 12 Jun 2006 17:18:46 +0000 (17:18 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1924 04897980-b3bd-0310-b5e0-8ef037075253

ltt-usertrace/java/TestBrand.java
ltt-usertrace/java/ThreadBrand.java
ltt-usertrace/java/generate.sh
ltt-usertrace/java/ltt-java-thread_brand.c

index b6cb7c9179c5acfbf3bdc9fbef26395c4f07efbd..6bb7ae666b8d83bce59d809742a1a8bd8bfb0724 100644 (file)
@@ -1,11 +1,11 @@
 
-import ThreadBrand;
+import ltt.*;
 
 // The Sample.java file
 public class TestBrand
 {
   public static void main(String[] args)
   {
-    ThreadBrand.trace_java_generic_thread_brand("Brand_test");
+    ltt.ThreadBrand.trace_java_generic_thread_brand("Brand_test");
   }
 }
index 14a307907a46f7aaf9f74f2c9ad5932dcb624f0b..2b6bcdc73c2ea50c2534368c2f6987a6e3b382d9 100644 (file)
@@ -1,8 +1,11 @@
+
+package ltt;
+
 // The ThreadBrand.java file
 public class ThreadBrand
 {
   // Declaration of the Native (C) function
-  private static native void trace_java_generic_thread_brand(String arg);
+  public static native void trace_java_generic_thread_brand(String arg);
   static {
     System.loadLibrary("ltt-java-thread_brand");
   }
index 78a7b9f0d8915d07f2e5c832ac64af82a4942c25..35fcd7d1e647c2d44509cb601b89ed33f2a86eeb 100755 (executable)
@@ -1,8 +1,10 @@
 #!/bin/sh
 
+export CLASSPATH=.:/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/bin
+
 #Sample
 javac Sample.java
-CLASSPATH=.:/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/bin javah -jni Sample
+javah -jni Sample
 gcc -I /usr/lib/jvm/java-1.5.0-sun-1.5.0.06/include \
   -I /usr/lib/jvm/java-1.5.0-sun-1.5.0.06/include/linux \
   -shared -Wl,-soname,libltt-java-string \
@@ -11,11 +13,17 @@ gcc -I /usr/lib/jvm/java-1.5.0-sun-1.5.0.06/include \
 LD_LIBRARY_PATH=. java Sample
 
 #TestBrand
-javac TestBrand.java
-CLASSPATH=.:/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/bin javah -jni TestBrand
+echo javac Threadbrand
+javac -d . ThreadBrand.java
+echo javah Threadbrand
+javah -jni ltt.ThreadBrand
+echo gcc
 gcc -I /usr/lib/jvm/java-1.5.0-sun-1.5.0.06/include \
   -I /usr/lib/jvm/java-1.5.0-sun-1.5.0.06/include/linux \
   -shared -Wl,-soname,libltt-java-thread_brand \
   -o libltt-java-thread_brand.so ltt-java-thread_brand.c \
   ../ltt-facility-loader-user_generic.c
+echo javac test
+javac TestBrand.java
+echo run
 LD_LIBRARY_PATH=. java TestBrand
index aa088405d51a1e91ab60b2d7cbd07e7cdd6ee75f..87041cc105403abb5b8f667a6bc21a29a94cdbb9 100644 (file)
@@ -8,8 +8,8 @@
 #define LTT_BLOCKING 1
 #include <ltt/ltt-facility-user_generic.h>
 
-JNIEXPORT void JNICALL Java_ThreadBrand_trace_1java_1generic_1thread_brand
-  (JNIEnv *env, jobject obj, jstring jstr)
+JNIEXPORT void JNICALL Java_ltt_ThreadBrand_trace_1java_1generic_1thread_1brand
+  (JNIEnv *env, jclass jc, jstring jstr)
 {
   const char *str;
   str = (*env)->GetStringUTFChars(env, jstr, NULL);
This page took 0.025188 seconds and 4 git commands to generate.