From d3733caf0686008ac5130e2f81fa30d60993c63c Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sun, 22 Feb 2009 19:10:56 +0100 Subject: [PATCH] java plugin: Rename `CollectdAPI' to `Collectd'. --- .../org/collectd/api/{CollectdAPI.java => Collectd.java} | 6 +++--- src/collectd-java.pod | 14 +++++++------- src/java.c | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) rename bindings/java/org/collectd/api/{CollectdAPI.java => Collectd.java} (96%) diff --git a/bindings/java/org/collectd/api/CollectdAPI.java b/bindings/java/org/collectd/api/Collectd.java similarity index 96% rename from bindings/java/org/collectd/api/CollectdAPI.java rename to bindings/java/org/collectd/api/Collectd.java index 3d713bac..70629595 100644 --- a/bindings/java/org/collectd/api/CollectdAPI.java +++ b/bindings/java/org/collectd/api/Collectd.java @@ -1,5 +1,5 @@ /* - * collectd/java - org/collectd/api/CollectdAPI.java + * collectd/java - org/collectd/api/Collectd.java * Copyright (C) 2009 Florian octo Forster * * This program is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ package org.collectd.api; * * @author Florian Forster <octo at verplant.org> */ -public class CollectdAPI +public class Collectd { private static final int LOG_ERR = 3; private static final int LOG_WARNING = 4; @@ -104,6 +104,6 @@ public class CollectdAPI log (LOG_DEBUG, message); } /* void logDebug */ -} /* class CollectdAPI */ +} /* class Collectd */ /* vim: set sw=2 sts=2 et fdm=marker : */ diff --git a/src/collectd-java.pod b/src/collectd-java.pod index 013bf893..9326cb00 100644 --- a/src/collectd-java.pod +++ b/src/collectd-java.pod @@ -68,14 +68,14 @@ example B. In order to be able to use these abbreviated names, you need to B the classes. The API functions that are available from Java are implemented as I -functions of the B class. +functions of the B class. See L<"CALLING API FUNCTIONS"> below for details. =head1 REGISTERING CALLBACKS When starting up, collectd creates an object of each configured class. The constructor of this class should then register "callbacks" with the daemon, -using the appropriate static functions in B, +using the appropriate static functions in B, see L<"CALLING API FUNCTIONS"> below. To register a callback, the object being passed to one of the register functions must implement an appropriate interface, which are all in the B namespace. @@ -165,7 +165,7 @@ considered an error condition and cause an appropriate message to be logged. This short example demonstrates how to register a read callback with the daemon: - import org.collectd.api.CollectdAPI; + import org.collectd.api.Collectd; import org.collectd.api.ValueList; import org.collectd.api.CollectdReadInterface; @@ -174,7 +174,7 @@ daemon: { public Foobar () { - CollectdAPI.registerRead ("Foobar", this); + Collectd.registerRead ("Foobar", this); } public int read () @@ -183,15 +183,15 @@ daemon: /* Do something... */ - CollectdAPI.dispatchValues (vl); + Collectd.dispatchValues (vl); } } =head1 CALLING API FUNCTIONS All collectd API functions that are available to Java plugins are implemented -as Istatic> functions of the B -class. This makes calling these functions pretty straight forward. +as Istatic> functions of the B class. +This makes calling these functions pretty straight forward. The following are the currently exported functions. For information on the interfaces used, please see L<"REGISTERING CALLBACKS"> above. diff --git a/src/java.c b/src/java.c index d4acdab9..984d29a4 100644 --- a/src/java.c +++ b/src/java.c @@ -2141,10 +2141,10 @@ static int cjni_init_native (JNIEnv *jvm_env) /* {{{ */ jclass api_class_ptr; int status; - api_class_ptr = (*jvm_env)->FindClass (jvm_env, "org.collectd.api.CollectdAPI"); + 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.CollectdAPI'."); + ERROR ("cjni_init_native: Cannot find API class `org.collectd.api.Collectd'."); return (-1); } -- 2.11.0