ZOO-Project
Functions
service_internal_java.h File Reference
#include "service.h"
#include "service_internal.h"
#include <jni.h>

Go to the source code of this file.

Functions

jobject HashMap_FromMaps (JNIEnv *, maps *, jclass, jclass, jmethodID)
 Convert a maps to a JAVA HashMap<String,HashMap<String,String>> More...
 
mapsmapsFromHashMap (JNIEnv *, jobject, jclass)
 Convert a JAVA HashMap<String,HashMap<String,String>> to a maps. More...
 
void displayStack (JNIEnv *, maps *)
 Error handling: display stack trace in an ExceptionReport Document. More...
 
char * parseJVMXXOption (map *)
 Create a string containing the JVM -XX:* option for a given map Depending on the map' name: More...
 
char * parseJVMXOption (map *)
 Create a string containing the JVM -X** option for a given map. More...
 
char * parseJVMOption (map *)
 Create a string containing the JVM -D* options for a given map The result will be : -Dname=value. More...
 
int zoo_java_support (maps **, map *, service *, maps **, maps **)
 Load a JAVA class then run the static public method corresponding to the service by passing the conf, inputs and outputs parameters by reference. More...
 

Function Documentation

void displayStack ( JNIEnv *  env,
maps main_conf 
)

Error handling: display stack trace in an ExceptionReport Document.

Parameters
envthe JNI environment pointer
main_confthe conf maps containing the main.cfg settings
jobject HashMap_FromMaps ( JNIEnv *  env,
maps t,
jclass  scHashMapClass,
jclass  scHashMap_class,
jmethodID  scHashMap_constructor 
)

Convert a maps to a JAVA HashMap<String,HashMap<String,String>>

Parameters
envthe JNI environment pointer
tthe maps to convert
scHashMapClassthe HashMap class
scHashMap_classthe HashMap class
scHashMap_constructorthe pointer to the hashMap constructor method
Returns
a created JAVA HashMap containing the converted maps
Warning
make sure to free resources returned by this function
maps* mapsFromHashMap ( JNIEnv *  env,
jobject  t,
jclass  scHashMapClass 
)

Convert a JAVA HashMap<String,HashMap<String,String>> to a maps.

Parameters
envthe JNI environment pointer
tthe HashMap
scHashMapClassthe hashMap class
Returns
a created maps containing the converted HashMap
Warning
make sure to free resources returned by this function

What need to be done (in java). Set set = hm.entrySet(); Iterator i = set.iterator(); while(i.hasNext()){ Map.Entry me = (Map.Entry)i.next(); System.out.println(me.getKey() + " : " + me.getValue() ); }

char* parseJVMOption ( map m)

Create a string containing the JVM -D* options for a given map The result will be : -Dname=value.

Parameters
mthe map containing the option
Returns
a char* containing the valide JVM option (-D*)
char* parseJVMXOption ( map m)

Create a string containing the JVM -X** option for a given map.

The result will be in the following format: -Xnamevalue

Parameters
mthe map containing the option
Returns
a char* containing the valide JVM option (-X**)
char* parseJVMXXOption ( map m)

Create a string containing the JVM -XX:* option for a given map Depending on the map' name:

  • in case the value is minus then the result will be : -XX:-name
  • in case the value is plus then the result will be : -XX:+name
  • in other cases the result will be : -XX:name=value
Parameters
mthe map containing the option
Returns
a char* containing the valide JVM option (-XX:*)
int zoo_java_support ( maps **  main_conf,
map request,
service s,
maps **  real_inputs,
maps **  real_outputs 
)

Load a JAVA class then run the static public method corresponding to the service by passing the conf, inputs and outputs parameters by reference.

Parameters
main_confthe conf maps containing the main.cfg settings
requestthe map containing the HTTP request
sthe service structure
real_inputsthe maps containing the inputs
real_outputsthe maps containing the outputs

The 3 standard parameter for each services