diff --git a/src/java.c b/src/java.c
index b69ca946b301c36a367c114e98666c7b33e69acd..5d5893c2f645dfd0694787f8771d17e0096f7e00 100644 (file)
--- a/src/java.c
+++ b/src/java.c
static jint JNICALL cjni_api_dispatch_values (JNIEnv *jvm_env, /* {{{ */
jobject this, jobject java_vl)
{
- value_list_t vl = VALUE_LIST_INIT;
+ value_list_t vl = VALUE_LIST_INIT (plugin_interval);
int status;
DEBUG ("cjni_api_dispatch_values: java_vl = %p;", (void *) java_vl);
user_data_t ud;
cjni_callback_info_t *cbi;
+ struct timespec cb_interval;
+
cbi = cjni_callback_info_create (jvm_env, o_name, o_read, CB_TYPE_READ);
if (cbi == NULL)
return (-1);
ud.data = (void *) cbi;
ud.free_func = cjni_callback_info_destroy;
- plugin_register_complex_read (/* group = */ NULL, cbi->name, cjni_read,
- /* interval = */ NULL, &ud);
+ CDTIME_T_TO_TIMESPEC (plugin_interval, &cb_interval);
+
+ plugin_register_complex_read (/* group = */ NULL,
+ /* name = */ cbi->name,
+ /* callback = */ cjni_read,
+ /* interval = */ (plugin_interval != 0) ? &cb_interval : NULL,
+ /* user_data = */ &ud);
(*jvm_env)->DeleteLocalRef (jvm_env, o_read);
return (0);
} /* }}} int cjni_init */
-void module_register (void)
+void module_register (plugin_loaddata_t *data)
{
+ PLUGIN_INIT_INTERVAL (data);
plugin_register_complex_config ("java", cjni_config_callback);
plugin_register_init ("java", cjni_init);
plugin_register_shutdown ("java", cjni_shutdown);
-} /* void module_register (void) */
+} /* void module_register (plugin_loaddata_t *data) */
/* vim: set sw=2 sts=2 et fdm=marker : */