8 jclass Exception = env->FindClass(
"java/lang/Exception");
9 env->ThrowNew(Exception, msg);
14 JNIEXPORT
void JNICALL
16 const char* data = env->GetStringUTFChars(jdata, NULL);
22 std::cout <<
"watcher: " << oid <<
"->" <<
object << std::endl;
25 }
catch(std::exception& ex) {
35 std::cout <<
"watcher: " << oid <<
"->" <<
object << std::endl;
41 std::cout <<
"error in remove" << std::endl;
50 std::cout <<
"watcher: " << oid <<
"->" <<
object << std::endl;
55 ss << std::cout.rdbuf();
56 std::string str = ss.str();
57 return env->NewStringUTF(str.c_str());
67 std::cout <<
"watcher: " << oid <<
"->" <<
object << std::endl;
76 const char* argv_str = env->GetStringUTFChars(jargv, NULL);
79 char* argv_copy = strdup(argv_str);
83 for(
char* p = strtok(argv_copy,
" "); p; p = strtok(NULL,
" ")) {
96 }
catch(std::exception& ex) {
static IObjectStoreService & getObjectStoreService(int argc, char **argv, const ObjectWatcher &ow={})
virtual std::tuple< version_t, uint64_t > bio_put(const Object &object, const bool &force_client=false)=0
virtual std::tuple< version_t, uint64_t > bio_remove(const OID &oid, const bool &force_client=false)=0
static void initialize(int argc, char *argv[], const char *conf_file=nullptr)
JNIEXPORT void JNICALL Java_com_derecho_objectstore_ObjectStoreService_put(JNIEnv *env, jobject obj, jlong oid, jstring jdata)
void throwJavaException(JNIEnv *env, const char *msg)
JNIEXPORT void JNICALL Java_com_derecho_objectstore_ObjectStoreService_leave(JNIEnv *env, jobject obj)
JNIEXPORT jboolean JNICALL Java_com_derecho_objectstore_ObjectStoreService_remove(JNIEnv *env, jobject obj, jlong oid)
virtual void leave(bool group_shutdown=false)=0
JNIEXPORT jstring JNICALL Java_com_derecho_objectstore_ObjectStoreService_get(JNIEnv *env, jobject obj, jlong oid)
JNIEXPORT void JNICALL Java_com_derecho_objectstore_ObjectStoreService_initialize(JNIEnv *env, jobject obj, jstring jargv)