+++ /dev/null
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class org_ocera_orte_Manager */
-
-#ifndef _Included_org_ocera_orte_Manager
-#define _Included_org_ocera_orte_Manager
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class: org_ocera_orte_Manager
- * Method: jORTEDomainDefaultMgrCreate
- * Signature: (IZ)I
- */
-JNIEXPORT jint JNICALL Java_org_ocera_orte_Manager_jORTEDomainDefaultMgrCreate
- (JNIEnv *, jclass, jint, jboolean);
-
-/*
- * Class: org_ocera_orte_Manager
- * Method: jORTEDomainMgrCreate
- * Signature: (IIIZ)I
- */
-JNIEXPORT jint JNICALL Java_org_ocera_orte_Manager_jORTEDomainMgrCreate
- (JNIEnv *, jclass, jint, jint, jint, jboolean);
-
-/*
- * Class: org_ocera_orte_Manager
- * Method: jORTEDomainMgrDestroy
- * Signature: (I)Z
- */
-JNIEXPORT jboolean JNICALL Java_org_ocera_orte_Manager_jORTEDomainMgrDestroy
- (JNIEnv *, jclass, jint);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
JNIEXPORT jlong JNICALL Java_org_ocera_orte_types_DomainProp_jORTEDomainPropDefaultGet
(JNIEnv *, jclass);
+/*
+ * Class: org_ocera_orte_types_DomainProp
+ * Method: jORTEDomainPropMgrsSet
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ocera_orte_types_DomainProp_jORTEDomainPropMgrsSet
+ (JNIEnv *, jobject);
+
#ifdef __cplusplus
}
#endif
**/
public DomainMgr()
{
+ super();
handle = jORTEDomainDefaultMgrCreate(ORTEConstant.ORTE_DEFAULT_DOMAIN,
false);
}
{
handle = jORTEDomainMgrCreate(domain,
props.handle,
- events.getHandle(),
+ events==null ? 0 : events.getHandle(),
suspend);
}
--- /dev/null
+package org.ocera.orte;
+
+import org.ocera.orte.types.*;;
+
+public class Manager {
+
+ private DomainProp dprops;
+ private DomainMgr dmgr;
+
+ public Manager(String[] mgrs) {
+ dprops = DomainProp.defaultPropsCreate();
+ dprops.setMgrs(mgrs);
+
+ dmgr = new DomainMgr(ORTEConstant.ORTE_DEFAULT_DOMAIN,
+ dprops,
+ null,
+ false);
+ }
+}
public class DomainProp {
-
-
+
/* load native library 'libjorte.so' */
static {
System.loadLibrary("jorte");
/* handler to C struct with default domain properties */
public long handle = 0;
-
-
+ private String mgrs = "";
+
+ public void setMgrs(String[] mgrs) {
+ for (String item : mgrs) {
+ this.mgrs += item + ":";
+ }
+
+ this.mgrs = this.mgrs.substring(0, this.mgrs.length()-1);
+
+ if(!jORTEDomainPropMgrsSet())
+ System.out.println(":j: Mgrs not set !!!");
+ }
+
/**
* defaultPropsCreate - create DomainProp with handle to default
* domain properties
*/
private static native
long jORTEDomainPropDefaultGet();
+
+ private native
+ boolean jORTEDomainPropMgrsSet();
}
* create user manager domain *
* *************************** */
JNIEXPORT jlong JNICALL
-Java_org_ocera_orte_DomainMg_jORTEDomainMgrCreate
+Java_org_ocera_orte_DomainMgr_jORTEDomainMgrCreate
(JNIEnv *env, jclass cls, jint jdomain, jlong propHandle,
jlong eventsHandle, jboolean susp)
{
// call ORTE function
b = ORTEDomainMgrDestroy((ORTEDomain *) dhandle);
- if(b == ORTE_OK)
+ if(b == ORTE_TRUE)
{
#ifdef TEST_STAGE
printf(":c: mgrDomain destroy successfully.. \n");
#endif
return 1;
}
- if (b == ORTE_BAD_HANDLE)
+ else
printf(":!c: mgrDomain destroy failed! [bad domain handle] \n");
return 0;
}
--- /dev/null
+#include <string.h>
+#include <stdlib.h>
+#include "orte.h"
+#include "jorte/4all.h"
+
+#include "jorte/org_ocera_orte_types_DomainProp.h"
+
+ JNIEXPORT jboolean JNICALL Java_org_ocera_orte_types_DomainProp_jORTEDomainPropMgrsSet
+ (JNIEnv *env, jobject obj)
+ {
+ jclass cls_dp = NULL;
+ jfieldID fid = NULL;
+ jobject obj_str = NULL;
+ const char *str = NULL;
+ //
+ int flag_ok = 0;
+
+ ORTEDomainProp *dp;
+
+ #ifdef TEST_STAGE
+ printf(":c: jORTEDomainPropMgrsSet() called.. \n");
+ #endif
+
+ do {
+ cls_dp = (*env)->GetObjectClass(env, obj);
+
+ if (cls_dp == 0) {
+ printf(":!c: class 'org.ocera.orte.types.DomainProp' not found! \n");
+ break;
+ }
+
+ fid = (*env)->GetFieldID(env,
+ cls_dp,
+ "handle",
+ "J");
+ if(fid == 0)
+ {
+ #ifdef TEST_STAGE
+ printf(":!c: fid = NULL \n");
+ #endif
+ break;
+ }
+ dp = (ORTEDomainProp *) (*env)->GetLongField(env, obj, fid);
+ if(dp == 0)
+ {
+ #ifdef TEST_STAGE
+ printf(":!c: *dp = NULL \n");
+ #endif
+ break;
+ }
+
+ fid = (*env)->GetFieldID(env,
+ cls_dp,
+ "mgrs",
+ "Ljava/lang/String;");
+ if(fid == 0)
+ {
+ #ifdef TEST_STAGE
+ printf(":!c: fid = NULL \n");
+ #endif
+ break;
+ }
+
+ obj_str = (*env)->GetObjectField(env, obj, fid);
+ if(obj_str == 0)
+ {
+ #ifdef TEST_STAGE
+ printf(":!c: obj_str = NULL \n");
+ #endif
+ break;
+ }
+ str = (*env)->GetStringUTFChars(env,obj_str,0);
+ dp->mgrs=str;
+
+ flag_ok = 1;
+ } while (0);
+
+ if(flag_ok) {
+ return ORTE_FALSE;
+ }
+
+ return ORTE_TRUE;
+ }
JORTEDomainMgrCreate.c \
JORTEDomainMgrDestroy.c \
JORTEDomainPropDefaultGet.c \
+JORTEDomainPropMgrsSet.c \
JORTEDomainStart.c \
JORTEInit.c \
JORTEPublicationCreate.c \