summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ee7a974)
raw | patch | inline | side by side (parent: ee7a974)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 22 Feb 2009 17:55:27 +0000 (18:55 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 22 Feb 2009 18:03:15 +0000 (19:03 +0100) |
diff --git a/bindings/java/org/collectd/api/CollectdAPI.java b/bindings/java/org/collectd/api/CollectdAPI.java
index 2b6e06cf9ea58f2a2840795710eed5f55d81f1ec..3d713bac2555add049b53ec9f53a0dab1831d45b 100644 (file)
/**
* Java representation of collectd/src/plugin.h:plugin_register_config
*/
- native public static int RegisterConfig (String name,
- CollectdConfigInterface obj);
+ native public static int registerConfig (String name,
+ CollectdConfigInterface object);
/**
* Java representation of collectd/src/plugin.h:plugin_register_init
*/
- native public static int RegisterInit (String name,
- CollectdInitInterface obj);
+ native public static int registerInit (String name,
+ CollectdInitInterface object);
/**
* Java representation of collectd/src/plugin.h:plugin_register_read
*/
- native public static int RegisterRead (String name,
- CollectdReadInterface obj);
+ native public static int registerRead (String name,
+ CollectdReadInterface object);
/**
* Java representation of collectd/src/plugin.h:plugin_register_write
*/
- native public static int RegisterWrite (String name,
- CollectdWriteInterface obj);
+ native public static int registerWrite (String name,
+ CollectdWriteInterface object);
/**
* Java representation of collectd/src/plugin.h:plugin_register_shutdown
*/
- native public static int RegisterShutdown (String name,
- CollectdShutdownInterface obj);
+ native public static int registerShutdown (String name,
+ CollectdShutdownInterface object);
/**
* Java representation of collectd/src/plugin.h:plugin_dispatch_values
*/
- native public static int DispatchValues (ValueList vl);
+ native public static int dispatchValues (ValueList vl);
/**
* Java representation of collectd/src/plugin.h:plugin_get_ds
*/
- native public static DataSet GetDS (String type);
+ native public static DataSet getDS (String type);
/**
* Java representation of collectd/src/plugin.h:plugin_log
*/
- native private static void Log (int severity, String message);
+ native private static void log (int severity, String message);
- public static void LogError (String message)
+ public static void logError (String message)
{
- Log (LOG_ERR, message);
- } /* void LogError */
+ log (LOG_ERR, message);
+ } /* void logError */
- public static void LogWarning (String message)
+ public static void logWarning (String message)
{
- Log (LOG_WARNING, message);
- } /* void LogWarning */
+ log (LOG_WARNING, message);
+ } /* void logWarning */
- public static void LogNotice (String message)
+ public static void logNotice (String message)
{
- Log (LOG_NOTICE, message);
- } /* void LogNotice */
+ log (LOG_NOTICE, message);
+ } /* void logNotice */
- public static void LogInfo (String message)
+ public static void logInfo (String message)
{
- Log (LOG_INFO, message);
- } /* void LogInfo */
+ log (LOG_INFO, message);
+ } /* void logInfo */
- public static void LogDebug (String message)
+ public static void logDebug (String message)
{
- Log (LOG_DEBUG, message);
- } /* void LogDebug */
+ log (LOG_DEBUG, message);
+ } /* void logDebug */
} /* class CollectdAPI */
diff --git a/bindings/java/org/collectd/api/CollectdConfigInterface.java b/bindings/java/org/collectd/api/CollectdConfigInterface.java
index 87530729e642ab01a545405153909bfeb9016091..fc6d9bdcdbf29d3db0fd42c9d646d08cd8a35e5f 100644 (file)
public interface CollectdConfigInterface
{
- public int Config (OConfigItem ci);
+ public int config (OConfigItem ci);
}
diff --git a/bindings/java/org/collectd/api/CollectdInitInterface.java b/bindings/java/org/collectd/api/CollectdInitInterface.java
index 09a2ab756257f451c7fa52840771bcd44dd2b849..6997a2f8eedbfaa539ee8b1488e6aeef03b71c7f 100644 (file)
public interface CollectdInitInterface
{
- public int Init ();
+ public int init ();
}
diff --git a/bindings/java/org/collectd/api/CollectdReadInterface.java b/bindings/java/org/collectd/api/CollectdReadInterface.java
index d5b924b24945dc93551c2c62446a56770ab95d31..ac6060b8b94039e8ef5733cb7df16e80418f9887 100644 (file)
public interface CollectdReadInterface
{
- public int Read ();
+ public int read ();
}
diff --git a/bindings/java/org/collectd/api/CollectdShutdownInterface.java b/bindings/java/org/collectd/api/CollectdShutdownInterface.java
index f0ccba0c8cd014a85b67c1fd39fea9a1fbdca76d..4181a10fce6736ea3b079feebe9589059ad69713 100644 (file)
public interface CollectdShutdownInterface
{
- public int Shutdown ();
+ public int shutdown ();
}
diff --git a/bindings/java/org/collectd/api/CollectdWriteInterface.java b/bindings/java/org/collectd/api/CollectdWriteInterface.java
index dd76f2c09ef2fd059d43db314580fabfaeb0a83a..13315a6d77b484160ab15cfe94686e3c93397f17 100644 (file)
public interface CollectdWriteInterface
{
- public int Write (ValueList vl);
+ public int write (ValueList vl);
}
diff --git a/src/collectd-java.pod b/src/collectd-java.pod
index 97204bc44eb0e8d1e8c95e938ea3d08e93d01d70..02feff6eb1aebdb78c854e7c38866243fc0341b4 100644 (file)
--- a/src/collectd-java.pod
+++ b/src/collectd-java.pod
Each callback method is now explained in more detail:
-=head2 Config callback
+=head2 config callback
Interface: B<org.collectd.api.CollectdConfigInterface>
-Signature: I<int> B<Config> (I<OConfigItem>)
+Signature: I<int> B<config> (I<OConfigItem>)
This method is passed a B<OConfigItem> object, if both, method and
configuration, are available. B<OConfigItem> is the root of a tree representing
To signal success, this method has to return zero. Anything else will be
considered an error condition and the plugin will be disabled entirely.
-=head2 Init callback
+=head2 init callback
Interface: B<org.collectd.api.CollectdInitInterface>
-Signature: I<int> B<Init> ()
+Signature: I<int> B<init> ()
This method is called after the configuration has been handled. It is
supposed to set up the plugin. e.E<nbsp>g. start threads, open connections, or
To signal success, this method has to return zero. Anything else will be
considered an error condition and the plugin will be disabled entirely.
-=head2 Read callback
+=head2 read callback
Interface: B<org.collectd.api.CollectdReadInterface>
-Signature: I<int> B<Read> ()
+Signature: I<int> B<read> ()
This method is called periodically and is supposed to gather statistics in
whatever fashion. These statistics are represented as a B<ValueList> object and
-sent to the daemon using B<DispatchValues>, see L<"CALLING API FUNCTIONS">
+sent to the daemon using B<dispatchValues>, see L<"CALLING API FUNCTIONS">
below.
To signal success, this method has to return zero. Anything else will be
Java "read"-methods are not suspended for increasing intervals like C
"read"-functions.
-=head2 Write callback
+=head2 write callback
Interface: B<org.collectd.api.CollectdWriteInterface>
-Signature: I<int> B<Write> (I<ValueList>)
+Signature: I<int> B<write> (I<ValueList>)
This method is called whenever a value is dispatched to the daemon. The
corresponding C "write"-functions are passed a C<data_set_t>, so they can
To signal success, this method has to return zero. Anything else will be
considered an error condition and cause an appropriate message to be logged.
-=head2 Shutdown callback
+=head2 shutdown callback
Interface: B<org.collectd.api.CollectdShutdownInterface>
-Signature: I<int> B<Shutdown> ()
+Signature: I<int> B<shutdown> ()
This method is called when the daemon is shutting down. You should not rely on
the destructor to clean up behind the object but use this function instead.
{
public Foobar ()
{
- CollectdAPI.RegisterRead ("Foobar", this);
+ CollectdAPI.registerRead ("Foobar", this);
}
- public int Read ()
+ public int read ()
{
ValueList vl;
/* Do something... */
- CollectdAPI.DispatchValues (vl);
+ CollectdAPI.dispatchValues (vl);
}
}
The currently exported functions are:
-=head2 RegisterRead
+=head2 registerRead
-Signature: I<int> B<RegisterRead> (I<String> name,
+Signature: I<int> B<registerRead> (I<String> name,
I<CollectdReadInterface> object)
-Registers the B<Read> function of I<object> with the daemon.
+Registers the B<read> function of I<object> with the daemon.
For a description of the B<CollectdReadInterface> interface, see
L<"REGISTERING CALLBACKS"> above.
Returns zero upon success and non-zero when an error occurred.
-=head2 RegisterWrite
+=head2 registerWrite
-Signature: I<int> B<RegisterWrite> (I<String> name,
+Signature: I<int> B<registerWrite> (I<String> name,
I<CollectdWriteInterface> object)
-Registers the B<Write> function of I<object> with the daemon.
+Registers the B<write> function of I<object> with the daemon.
For a description of the B<CollectdWriteInterface> interface, see
L<"REGISTERING CALLBACKS"> above.
Returns zero upon success and non-zero when an error occurred.
-=head2 DispatchValues
+=head2 dispatchValues
-Signature: I<int> B<DispatchValues> (I<ValueList>)
+Signature: I<int> B<dispatchValues> (I<ValueList>)
Passes the values represented by the B<ValueList> object to the
C<plugin_dispatch_values> function of the daemon. The "data set" (or list of
Returns zero upon success or non-zero upon failure.
-=head2 GetDS
+=head2 getDS
-Signature: I<DataSet> B<GetDS> (I<String>)
+Signature: I<DataSet> B<getDS> (I<String>)
Returns the approrpate I<type> or B<null> if the type is not defined.
diff --git a/src/java.c b/src/java.c
index 5538270668911f56dacf05f73acbf747a7c05fd5..d4acdab9c429a3d9330949c94e2e05df41033437 100644 (file)
--- a/src/java.c
+++ b/src/java.c
* Java. */
static JNINativeMethod jni_api_functions[] = /* {{{ */
{
- { "DispatchValues",
+ { "dispatchValues",
"(Lorg/collectd/api/ValueList;)I",
cjni_api_dispatch_values },
- { "GetDS",
+ { "getDS",
"(Ljava/lang/String;)Lorg/collectd/api/DataSet;",
cjni_api_get_ds },
- { "RegisterConfig",
+ { "registerConfig",
"(Ljava/lang/String;Lorg/collectd/api/CollectdConfigInterface;)I",
cjni_api_register_config },
- { "RegisterInit",
+ { "registerInit",
"(Ljava/lang/String;Lorg/collectd/api/CollectdInitInterface;)I",
cjni_api_register_init },
- { "RegisterRead",
+ { "registerRead",
"(Ljava/lang/String;Lorg/collectd/api/CollectdReadInterface;)I",
cjni_api_register_read },
- { "RegisterWrite",
+ { "registerWrite",
"(Ljava/lang/String;Lorg/collectd/api/CollectdWriteInterface;)I",
cjni_api_register_write },
- { "RegisterShutdown",
+ { "registerShutdown",
"(Ljava/lang/String;Lorg/collectd/api/CollectdShutdownInterface;)I",
cjni_api_register_shutdown },
- { "Log",
+ { "log",
"(ILjava/lang/String;)V",
cjni_api_log },
};
@@ -1332,27 +1332,27 @@ static cjni_callback_info_t *cjni_callback_info_create (JNIEnv *jvm_env, /* {{{
switch (type)
{
case CB_TYPE_CONFIG:
- method_name = "Config";
+ method_name = "config";
method_signature = "(Lorg/collectd/api/OConfigItem;)I";
break;
case CB_TYPE_INIT:
- method_name = "Init";
+ method_name = "init";
method_signature = "()I";
break;
case CB_TYPE_READ:
- method_name = "Read";
+ method_name = "read";
method_signature = "()I";
break;
case CB_TYPE_WRITE:
- method_name = "Write";
+ method_name = "write";
method_signature = "(Lorg/collectd/api/ValueList;)I";
break;
case CB_TYPE_SHUTDOWN:
- method_name = "Shutdown";
+ method_name = "shutdown";
method_signature = "()I";
break;