Difference between revisions of "Plugin:Java"

From collectd Wiki
Jump to: navigation, search
(Created initial page.)
 
m (Added DEFAULTSORT magic word.)
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{List of Plugins}}
+
{{Infobox Plugin
== Description ==
+
  | Name=Java
 +
  | Type=binding
 +
  | Callbacks={{Callback|config}}, {{Callback|flush}}, {{Callback|init}}, {{Callback|log}}, {{Callback|notification}}, {{Callback|read}}, {{Callback|shutdown}}, {{Callback|write}}
 +
  | Status={{supported}}
 +
  | FirstVersion={{Version|4.7}}
 +
  | Copyright=''2009'' Florian Forster
 +
  | License={{GPLv2}}
 +
  | Manpage=''collectd.conf(5)''<br />{{Manpage|collectd-java|5}}
 +
}}
 +
The '''Java plugin''' embeds a <em>Java virtual machine</em> (JVM) into <em>collectd</em> and exposes the <em>application programming interface</em> (API) to Java programs. This allows to write own plugins in the popular language, which are then loaded and executed by the daemon without the need to start a new process and JVM every few seconds. Java classes written for the <em>Java</em> plugin are therefore more powerful and efficient than scripts executed by the [[Plugin:Exec|Exec]] plugin.
  
The <em>Java</em> plugin embeds a <em>Java virtual machine</em> (JVM) into <em>collectd</em> and exposes the <em>application programming interface</em> (API) to Java programs. This allows to write own plugins in the popular language, which are then loaded and executed by the daemon without the need to start a new process and JVM every few seconds. Java classes written for the <em>Java</em> plugin are therefore more powerful and efficient than scripts executed by the [[Plugin:Exec|Exec]] plugin.
+
{{Generic Plugin|java}} The programming interface is documented in detail in the {{Manpage|collectd-java|5}} manual page.
  
{{Generic Plugin|perl}} The programming interface is documented in detail in the [http://collectd.org/documentation/manpages/collectd-java.5.shtml collectd-java(5) manual page].
+
The [http://collectd.org/documentation/javadoc/ ''JavaDoc'' documentation of the API] is available.  
  
 
== Synopsis ==
 
== Synopsis ==
Line 20: Line 29:
  
 
* <em>Java Native Interface</em> (JNI) / <code>libjvm</code>
 
* <em>Java Native Interface</em> (JNI) / <code>libjvm</code>
 +
 +
== See also ==
 +
 +
* [http://collectd.org/documentation/javadoc/ ''JavaDoc'' documentation of the API]
 +
* [[Plugin:GenericJMX|GenericJMX plugin]]
 +
* {{GitFile|bindings/java/org/collectd/java/JMXMemory.java}} – sample file to query memory usage via ''JMX''
 +
* [[jcollectd]]
  
 
[[Category:Plugins]]
 
[[Category:Plugins]]
 
[[Category:Development]]
 
[[Category:Development]]
 +
{{DEFAULTSORT:Java}}

Latest revision as of 11:31, 20 December 2009

Java plugin
Type: binding
Callbacks: config, flush, init, log, notification, read, shutdown, write
Status: supported
First version: 4.7
Copyright: 2009 Florian Forster
License: GPLv2
Manpage: collectd.conf(5)
collectd-java(5)
List of Plugins

The Java plugin embeds a Java virtual machine (JVM) into collectd and exposes the application programming interface (API) to Java programs. This allows to write own plugins in the popular language, which are then loaded and executed by the daemon without the need to start a new process and JVM every few seconds. Java classes written for the Java plugin are therefore more powerful and efficient than scripts executed by the Exec plugin.

This plugin is a generic plugin, i.e. it cannot work without configuration, because there is no reasonable default behavior. Please read the Plugin java section of the collectd.conf(5) manual page for an in-depth description of the plugin's configuration. The programming interface is documented in detail in the collectd-java(5) manual page.

The JavaDoc documentation of the API is available.

Synopsis

<Plugin "java">
  JVMArg "-verbose:jni"
  JVMArg "-Djava.class.path=/opt/collectd/lib/collectd/bindings/java"
  LoadPlugin "org.collectd.java.Foobar"
  <Plugin "org.collectd.java.Foobar">
    # To be parsed by the plugin
  </Plugin>
</Plugin>

Dependencies

  • Java Native Interface (JNI) / libjvm

See also