source: trunk/zoo-project/zoo-api/java/zoo-api.c @ 894

Last change on this file since 894 was 771, checked in by djay, 8 years ago

Remove the default java.library.path definition and use an optional [java] section instead (where the key java.library.path, amongst other, may be defined). Change _ function name to translate in the Java ZOO-API. Use a ogr.zoo_project package containing the ZOO class. Fix the hello-java service and update doc consequently

  • Property svn:keywords set to Id
File size: 1.2 KB
Line 
1#include "org_zoo_project_ZOO.h"
2#include "service.h"
3#include "service_internal.h"
4#include "service_internal_java.h"
5
6JNIEXPORT jstring JNICALL Java_org_zoo_1project_ZOO_translate
7  (JNIEnv *env, jclass _class, jstring msg){
8  const char *message = 
9#ifdef JAVA7
10    (*env).GetStringUTFChars(msg,0);
11  return (*env).NewStringUTF(_(message));
12#else
13    (*env)->GetStringUTFChars(env,msg, 0);
14  return (*env)->NewStringUTF(env, _(message));
15#endif
16
17}
18
19JNIEXPORT jobject JNICALL Java_org_zoo_1project_ZOO_updateStatus
20  (JNIEnv *env, jclass _class, jobject conf, jstring pourc, jstring msg){
21
22  jclass scHashMapClass,scHashMap_class;
23#ifdef JAVA7
24  scHashMapClass = (*env).FindClass("java/util/HashMap");
25  const char *pourcent = (*env).GetStringUTFChars(pourc,0);
26  const char *message = (*env).GetStringUTFChars(msg,0);
27#else
28  scHashMapClass = (*env)->FindClass(env, "java/util/HashMap");
29  const char *pourcent = (*env)->GetStringUTFChars(env,pourc, 0);
30  const char *message = (*env)->GetStringUTFChars(env,msg, 0);
31#endif
32  maps* m = mapsFromHashMap(env,conf,scHashMapClass);
33  setMapInMaps(m,"lenv","status",pourcent);
34  setMapInMaps(m,"lenv","message",message);
35  _updateStatus(m);
36  freeMaps(&m);
37  free(m);
38  return (jint)0;
39}
Note: See TracBrowser for help on using the repository browser.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png