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

Last change on this file since 724 was 525, checked in by djay, 10 years ago

Add the Java ZOO-API.

  • Property svn:keywords set to Id
File size: 950 bytes
RevLine 
[525]1#include "ZOO.h"
2#include "service.h"
3#include "service_internal.h"
4#include "service_internal_java.h"
5
6JNIEXPORT jstring JNICALL Java_ZOO__1
7  (JNIEnv *env, jclass class, jstring msg){
8  const char *message = (*env)->GetStringUTFChars(env,msg, 0);
9  return (*env)->NewStringUTF(env, _(message));
10
11}
12
13JNIEXPORT jobject JNICALL Java_ZOO_updateStatus
14  (JNIEnv *env, jclass class, jobject conf, jstring pourc, jstring msg){
15
16  jclass scHashMapClass,scHashMap_class;
17#ifdef JAVA7
18  scHashMapClass = (*env).FindClass("java/util/HashMap");
19#else
20  scHashMapClass = (*env)->FindClass(env, "java/util/HashMap");
21#endif
22  const char *pourcent = (*env)->GetStringUTFChars(env,pourc, 0);
23  const char *message = (*env)->GetStringUTFChars(env,msg, 0);
24  maps* m = mapsFromHashMap(env,conf,scHashMapClass);
25  setMapInMaps(m,"lenv","status",pourcent);
26  setMapInMaps(m,"lenv","message",message);
27  _updateStatus(m);
28  freeMaps(&m);
29  free(m);
30  return (jint)0;
31}
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