summaryrefslogtreecommitdiff
path: root/bdb/libdb_java/java_info.h
diff options
context:
space:
mode:
Diffstat (limited to 'bdb/libdb_java/java_info.h')
-rw-r--r--bdb/libdb_java/java_info.h103
1 files changed, 62 insertions, 41 deletions
diff --git a/bdb/libdb_java/java_info.h b/bdb/libdb_java/java_info.h
index 69032be80e6..bda83db420e 100644
--- a/bdb/libdb_java/java_info.h
+++ b/bdb/libdb_java/java_info.h
@@ -1,10 +1,10 @@
/*-
* See the file LICENSE for redistribution information.
*
- * Copyright (c) 1997, 1998, 1999, 2000
+ * Copyright (c) 1997-2002
* Sleepycat Software. All rights reserved.
*
- * $Id: java_info.h,v 11.17 2000/07/31 20:28:30 dda Exp $
+ * $Id: java_info.h,v 11.35 2002/08/29 14:22:23 margo Exp $
*/
#ifndef _JAVA_INFO_H_
@@ -36,16 +36,22 @@
typedef struct _dbt_javainfo
{
DBT dbt;
- DB *db_; /* associated DB */
- jobject dbtref_; /* the java Dbt object */
- jbyteArray array_;
- int offset_;
- int create_array_; /* flag to create the array as needed */
+ DB *db; /* associated DB */
+ jobject dbtref; /* the java Dbt object */
+ jbyteArray array; /* the java array object -
+ this is only valid during the API call */
+ int offset; /* offset into the Java array */
+
+#define DBT_JAVAINFO_LOCKED 0x01 /* a LOCKED_DBT has been created */
+ u_int32_t flags;
}
-DBT_JAVAINFO; /* used with all 'dbtji' functions */
+DBT_JAVAINFO; /* used with all 'dbtji' functions */
+/* create/initialize a DBT_JAVAINFO object */
extern DBT_JAVAINFO *dbjit_construct();
-extern void dbjit_release(DBT_JAVAINFO *dbjit, JNIEnv *jnienv);
+
+/* free this DBT_JAVAINFO, releasing anything allocated on its behalf */
+extern void dbjit_destroy(DBT_JAVAINFO *dbjit);
/****************************************************************
*
@@ -82,22 +88,25 @@ extern void dbjit_release(DBT_JAVAINFO *dbjit, JNIEnv *jnienv);
*/
typedef struct _db_env_javainfo
{
- JavaVM *javavm_;
- int is_dbopen_;
- char *errpfx_;
- jobject jdbref_; /* temporary reference */
- jobject jenvref_; /* temporary reference */
- jobject default_errcall_; /* global reference */
- jobject errcall_; /* global reference */
- jobject feedback_; /* global reference */
- jobject tx_recover_; /* global reference */
- jobject recovery_init_; /* global reference */
- unsigned char *conflict_;
+ JavaVM *javavm;
+ int is_dbopen;
+ char *errpfx;
+ jobject jenvref; /* global reference */
+ jobject default_errcall; /* global reference */
+ jobject errcall; /* global reference */
+ jobject feedback; /* global reference */
+ jobject rep_transport; /* global reference */
+ jobject app_dispatch; /* global reference */
+ jobject recovery_init; /* global reference */
+ u_char *conflict;
+ size_t conflict_size;
+ jint construct_flags;
}
-DB_ENV_JAVAINFO; /* used with all 'dbjie' functions */
+DB_ENV_JAVAINFO; /* used with all 'dbjie' functions */
/* create/initialize an object */
extern DB_ENV_JAVAINFO *dbjie_construct(JNIEnv *jnienv,
+ jobject jenv,
jobject default_errcall,
int is_dbopen);
@@ -115,7 +124,7 @@ extern void dbjie_set_errpfx(DB_ENV_JAVAINFO *, JNIEnv *jnienv,
extern jstring dbjie_get_errpfx(DB_ENV_JAVAINFO *, JNIEnv *jnienv);
extern void dbjie_set_errcall(DB_ENV_JAVAINFO *, JNIEnv *jnienv,
jobject new_errcall);
-extern void dbjie_set_conflict(DB_ENV_JAVAINFO *, unsigned char *v);
+extern void dbjie_set_conflict(DB_ENV_JAVAINFO *, u_char *v, size_t sz);
extern void dbjie_set_feedback_object(DB_ENV_JAVAINFO *, JNIEnv *jnienv,
DB_ENV *dbenv, jobject value);
extern void dbjie_call_feedback(DB_ENV_JAVAINFO *, DB_ENV *dbenv, jobject jenv,
@@ -124,13 +133,18 @@ extern void dbjie_set_recovery_init_object(DB_ENV_JAVAINFO *, JNIEnv *jnienv,
DB_ENV *dbenv, jobject value);
extern int dbjie_call_recovery_init(DB_ENV_JAVAINFO *, DB_ENV *dbenv,
jobject jenv);
-extern void dbjie_set_tx_recover_object(DB_ENV_JAVAINFO *, JNIEnv *jnienv,
+extern void dbjie_set_rep_transport_object(DB_ENV_JAVAINFO *, JNIEnv *jnienv,
+ DB_ENV *dbenv, int id, jobject obj);
+extern int dbjie_call_rep_transport(DB_ENV_JAVAINFO *, DB_ENV *dbenv,
+ jobject jenv, const DBT *control,
+ const DBT *rec, int envid, int flags);
+extern void dbjie_set_app_dispatch_object(DB_ENV_JAVAINFO *, JNIEnv *jnienv,
DB_ENV *dbenv, jobject value);
-extern int dbjie_call_tx_recover(DB_ENV_JAVAINFO *,
+extern int dbjie_call_app_dispatch(DB_ENV_JAVAINFO *,
DB_ENV *dbenv, jobject jenv,
DBT *dbt, DB_LSN *lsn, int recops);
extern jobject dbjie_get_errcall(DB_ENV_JAVAINFO *) ;
-extern int dbjie_is_dbopen(DB_ENV_JAVAINFO *);
+extern jint dbjie_is_dbopen(DB_ENV_JAVAINFO *);
/****************************************************************
*
@@ -147,25 +161,27 @@ extern int dbjie_is_dbopen(DB_ENV_JAVAINFO *);
*/
typedef struct _db_javainfo
{
- JavaVM *javavm_;
- jobject jdbref_; /* temporary reference during callback */
- jobject feedback_; /* global reference */
- jobject append_recno_; /* global reference */
- jobject bt_compare_; /* global reference */
- jobject bt_prefix_; /* global reference */
- jobject dup_compare_; /* global reference */
- jobject h_hash_; /* global reference */
- jmethodID feedback_method_id_;
- jmethodID append_recno_method_id_;
- jmethodID bt_compare_method_id_;
- jmethodID bt_prefix_method_id_;
- jmethodID dup_compare_method_id_;
- jmethodID h_hash_method_id_;
- jint construct_flags_;
+ JavaVM *javavm;
+ jobject jdbref; /* global reference */
+ jobject append_recno; /* global reference */
+ jobject assoc; /* global reference */
+ jobject bt_compare; /* global reference */
+ jobject bt_prefix; /* global reference */
+ jobject dup_compare; /* global reference */
+ jobject feedback; /* global reference */
+ jobject h_hash; /* global reference */
+ jmethodID append_recno_method_id;
+ jmethodID assoc_method_id;
+ jmethodID bt_compare_method_id;
+ jmethodID bt_prefix_method_id;
+ jmethodID dup_compare_method_id;
+ jmethodID feedback_method_id;
+ jmethodID h_hash_method_id;
+ jint construct_flags;
} DB_JAVAINFO;
/* create/initialize an object */
-extern DB_JAVAINFO *dbji_construct(JNIEnv *jnienv, jint flags);
+extern DB_JAVAINFO *dbji_construct(JNIEnv *jnienv, jobject jdb, jint flags);
/* release all objects held by this this one */
extern void dbji_dealloc(DB_JAVAINFO *, JNIEnv *jnienv);
@@ -184,6 +200,11 @@ extern void dbji_call_feedback(DB_JAVAINFO *, DB *db, jobject jdb,
extern void dbji_set_append_recno_object(DB_JAVAINFO *, JNIEnv *jnienv, DB *db, jobject value);
extern int dbji_call_append_recno(DB_JAVAINFO *, DB *db, jobject jdb,
DBT *dbt, jint recno);
+extern void dbji_set_assoc_object(DB_JAVAINFO *, JNIEnv *jnienv,
+ DB *db, DB_TXN *txn, DB *second,
+ jobject value, int flags);
+extern int dbji_call_assoc(DB_JAVAINFO *, DB *db, jobject jdb,
+ const DBT *key, const DBT* data, DBT *result);
extern void dbji_set_bt_compare_object(DB_JAVAINFO *, JNIEnv *jnienv, DB *db, jobject value);
extern int dbji_call_bt_compare(DB_JAVAINFO *, DB *db, jobject jdb,
const DBT *dbt1, const DBT *dbt2);