summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 992895b)
raw | patch | inline | side by side (parent: 992895b)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 29 Mar 2009 11:54:31 +0000 (13:54 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 29 Mar 2009 11:54:31 +0000 (13:54 +0200) |
Dots workes for GCJ but not with Sun's Java. I haven't tested if GCJ likes
this too, but I strongly suspect it.
this too, but I strongly suspect it.
src/java.c | patch | blob | history |
diff --git a/src/java.c b/src/java.c
index 243e8f1e8a4c0801ec3c365942474ba1539a2af0..5d1314167fe91a900e4bc1c1de1cae9bdde8b220 100644 (file)
--- a/src/java.c
+++ b/src/java.c
return (NULL);
} /* }}} jobject ctoj_value_to_number */
-/* Convert a data_source_t to a org.collectd.api.DataSource */
+/* Convert a data_source_t to a org/collectd/api/DataSource */
static jobject ctoj_data_source (JNIEnv *jvm_env, /* {{{ */
const data_source_t *dsrc)
{
/* Look up the DataSource class */
c_datasource = (*jvm_env)->FindClass (jvm_env,
- "org.collectd.api.DataSource");
+ "org/collectd/api/DataSource");
if (c_datasource == NULL)
{
ERROR ("java plugin: ctoj_data_source: "
- "FindClass (org.collectd.api.DataSource) failed.");
+ "FindClass (org/collectd/api/DataSource) failed.");
return (NULL);
}
return (o_datasource);
} /* }}} jobject ctoj_data_source */
-/* Convert a oconfig_value_t to a org.collectd.api.OConfigValue */
+/* Convert a oconfig_value_t to a org/collectd/api/OConfigValue */
static jobject ctoj_oconfig_value (JNIEnv *jvm_env, /* {{{ */
oconfig_value_t ocvalue)
{
o_argument = NULL;
c_ocvalue = (*jvm_env)->FindClass (jvm_env,
- "org.collectd.api.OConfigValue");
+ "org/collectd/api/OConfigValue");
if (c_ocvalue == NULL)
{
ERROR ("java plugin: ctoj_oconfig_value: "
- "FindClass (org.collectd.api.OConfigValue) failed.");
+ "FindClass (org/collectd/api/OConfigValue) failed.");
return (NULL);
}
return (o_ocvalue);
} /* }}} jobject ctoj_oconfig_value */
-/* Convert a oconfig_item_t to a org.collectd.api.OConfigItem */
+/* Convert a oconfig_item_t to a org/collectd/api/OConfigItem */
static jobject ctoj_oconfig_item (JNIEnv *jvm_env, /* {{{ */
const oconfig_item_t *ci)
{
jobject o_ocitem;
int i;
- c_ocitem = (*jvm_env)->FindClass (jvm_env, "org.collectd.api.OConfigItem");
+ c_ocitem = (*jvm_env)->FindClass (jvm_env, "org/collectd/api/OConfigItem");
if (c_ocitem == NULL)
{
ERROR ("java plugin: ctoj_oconfig_item: "
- "FindClass (org.collectd.api.OConfigItem) failed.");
+ "FindClass (org/collectd/api/OConfigItem) failed.");
return (NULL);
}
return (o_ocitem);
} /* }}} jobject ctoj_oconfig_item */
-/* Convert a data_set_t to a org.collectd.api.DataSet */
+/* Convert a data_set_t to a org/collectd/api/DataSet */
static jobject ctoj_data_set (JNIEnv *jvm_env, const data_set_t *ds) /* {{{ */
{
jclass c_dataset;
@@ -597,12 +597,12 @@ static jobject ctoj_data_set (JNIEnv *jvm_env, const data_set_t *ds) /* {{{ */
jobject o_dataset;
int i;
- /* Look up the org.collectd.api.DataSet class */
- c_dataset = (*jvm_env)->FindClass (jvm_env, "org.collectd.api.DataSet");
+ /* Look up the org/collectd/api/DataSet class */
+ c_dataset = (*jvm_env)->FindClass (jvm_env, "org/collectd/api/DataSet");
if (c_dataset == NULL)
{
ERROR ("java plugin: ctoj_data_set: Looking up the "
- "org.collectd.api.DataSet class failed.");
+ "org/collectd/api/DataSet class failed.");
return (NULL);
}
/* Search for the `void addDataSource (DataSource)' method. */
m_add = (*jvm_env)->GetMethodID (jvm_env,
- c_dataset, "addDataSource", "(Lorg.collectd.api.DataSource;)V");
+ c_dataset, "addDataSource", "(Lorg/collectd/api/DataSource;)V");
if (m_add == NULL)
{
ERROR ("java plugin: ctoj_data_set: Looking up the "
/* Look for the `void setDataSource (List<DataSource> ds)' method. */
m_setdataset = (*jvm_env)->GetMethodID (jvm_env, c_valuelist,
- "setDataSet", "(Lorg.collectd.api.DataSet;)V");
+ "setDataSet", "(Lorg/collectd/api/DataSet;)V");
if (m_setdataset == NULL)
{
ERROR ("java plugin: ctoj_value_list_add_data_set: "
return (0);
} /* }}} int ctoj_value_list_add_data_set */
-/* Convert a value_list_t (and data_set_t) to a org.collectd.api.ValueList */
+/* Convert a value_list_t (and data_set_t) to a org/collectd/api/ValueList */
static jobject ctoj_value_list (JNIEnv *jvm_env, /* {{{ */
const data_set_t *ds, const value_list_t *vl)
{
/* First, create a new ValueList instance..
* Look up the class.. */
c_valuelist = (*jvm_env)->FindClass (jvm_env,
- "org.collectd.api.ValueList");
+ "org/collectd/api/ValueList");
if (c_valuelist == NULL)
{
ERROR ("java plugin: ctoj_value_list: "
- "FindClass (org.collectd.api.ValueList) failed.");
+ "FindClass (org/collectd/api/ValueList) failed.");
return (NULL);
}
return (o_valuelist);
} /* }}} jobject ctoj_value_list */
-/* Convert a notification_t to a org.collectd.api.Notification */
+/* Convert a notification_t to a org/collectd/api/Notification */
static jobject ctoj_notification (JNIEnv *jvm_env, /* {{{ */
const notification_t *n)
{
/* First, create a new Notification instance..
* Look up the class.. */
c_notification = (*jvm_env)->FindClass (jvm_env,
- "org.collectd.api.Notification");
+ "org/collectd/api/Notification");
if (c_notification == NULL)
{
ERROR ("java plugin: ctoj_notification: "
- "FindClass (org.collectd.api.Notification) failed.");
+ "FindClass (org/collectd/api/Notification) failed.");
return (NULL);
}
return (0);
} /* }}} int jtoc_values_array */
-/* Convert a org.collectd.api.ValueList to a value_list_t. */
+/* Convert a org/collectd/api/ValueList to a value_list_t. */
static int jtoc_value_list (JNIEnv *jvm_env, value_list_t *vl, /* {{{ */
jobject object_ptr)
{
return (0);
} /* }}} int jtoc_value_list */
-/* Convert a org.collectd.api.Notification to a notification_t. */
+/* Convert a org/collectd/api/Notification to a notification_t. */
static int jtoc_notification (JNIEnv *jvm_env, notification_t *n, /* {{{ */
jobject object_ptr)
{
jclass api_class_ptr;
int status;
- api_class_ptr = (*jvm_env)->FindClass (jvm_env, "org.collectd.api.Collectd");
+ api_class_ptr = (*jvm_env)->FindClass (jvm_env, "org/collectd/api/Collectd");
if (api_class_ptr == NULL)
{
- ERROR ("cjni_init_native: Cannot find API class `org.collectd.api.Collectd'.");
+ ERROR ("cjni_init_native: Cannot find API class `org/collectd/api/Collectd'.");
return (-1);
}
i, jvm_argv[i]);
vm_args.options[i].optionString = jvm_argv[i];
}
- /*
- vm_args.options[0].optionString = "-verbose:jni";
- vm_args.options[1].optionString = "-Djava.class.path=/home/octo/collectd/bindings/java";
- */
status = JNI_CreateJavaVM (&jvm, (void **) &jvm_env, (void **) &vm_args);
if (status != 0)