<?xml version="1.0"?>

<!DOCTYPE plugin [
  <!ENTITY process-metrics SYSTEM "/pdk/plugins/process-metrics.xml">
  <!ENTITY fuse-destination-metrics SYSTEM "/pdk/plugins/fuse-destination-metrics.xml">
  <!ENTITY fuse-messaging-services SYSTEM "/pdk/plugins/fuse-messaging-services.xml">
]>

<!--
  NOTE: This copyright does *not* cover user programs that use HQ
  program services by normal system calls through the application
  program interfaces provided as part of the Hyperic Plug-in Development
  Kit or the Hyperic Client Development Kit - this is merely considered
  normal use of the program, and does *not* fall under the heading of
  "derived work".
  
  Copyright (C) [2004, 2005, 2006], Hyperic, Inc.
  This file is part of HQ.
  
  HQ is free software; you can redistribute it and/or modify
  it under the terms version 2 of the GNU General Public License as
  published by the Free Software Foundation. This program is distributed
  in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
  even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  PARTICULAR PURPOSE. See the GNU General Public License for more
  details.
  
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  USA.
 -->

<plugin package="org.hyperic.hq.plugin.activemq" name="fuseactivemq">

  <classpath>
    <include name="pdk/lib/mx4j"/>
  </classpath>

  <filter name="messaging_domain"
          value="org.apache.activemq"/>

  <filter name="template"
          value="${OBJECT_NAME}:${alias}"/>

  &fuse-destination-metrics;

  <server name="ActiveMQ"
          version="4.x">

    <property name="VERSION_FILE"
	      value="apache-activemq-4.*.jar"/>

    <!-- derive installpath from -Dactivemq.home=... -->
    <property name="PROC_HOME_PROPERTY"
              value="activemq.home"/>

    <property name="DEFAULT_CONF"
              value="conf/activemq.xml"/>

    <property name="DEFAULT_LOG_FILE"
              value="var/activemq.log"/>

    <config include="jmx">
      <option name="process.query" description="Process Query" default="State.Name.eq=java,Args.*.ct=activemq.home"/>
    </config>

    <plugin type="autoinventory"
            class="org.hyperic.hq.product.jmx.MxServerDetector"/>

    <plugin type="measurement"
            class="org.hyperic.hq.product.jmx.MxMeasurementPlugin"/>

    <plugin type="log_track"
            class="org.hyperic.hq.product.Log4JLogTrackPlugin"/>

    <plugin type="config_track"
            class="org.hyperic.hq.product.ConfigFileTrackPlugin"/>

    <metric name="Availability"
            template="sigar:Type=ProcState,Arg=%process.query%:State"
            indicator="true"/>

    &process-metrics;
    &fuse-messaging-services;

  </server>

  <server name="ActiveMQ"
          version="5.x"
          include="4.x">

    <property name="VERSION_FILE"
              value="LICENSE.txt"/>
    <property name="DEFAULT_LOG_FILE"
              value="data/activemq.log"/>

     <plugin type="autoinventory"
             class="org.hyperic.hq.product.jmx.MxServerDetector"/>
  </server>

  <server name="ActiveMQ"
          version="5.x-fuse"
          include="5.x">

    <property name="VERSION_FILE"
              value="activemq-all-5.*-fuse.jar"/>

    <plugin type="autoinventory"
            class="org.hyperic.hq.product.jmx.MxServerDetector"/>
  </server>

  <server name="ActiveMQ"
          version="5.3.1-fuse"
          include="5.x">

    <property name="VERSION_FILE"
              value="activemq-all-5.3.1-fuse*.jar"/>

    <plugin type="autoinventory"
            class="org.hyperic.hq.product.jmx.MxServerDetector"/>
  </server>

  <server name="ActiveMQ"
          version="5.4.0-fuse"
          include="5.x">

    <property name="VERSION_FILE"
              value="activemq-all-5.4.0-fuse*.jar"/>

    <plugin type="autoinventory"
            class="org.hyperic.hq.product.jmx.MxServerDetector"/>
  </server>

  <server name="ActiveMQ"
          version="5.4.1-fuse"
          include="5.4.0-fuse">

    <property name="VERSION_FILE"
              value="activemq-all-5.4.1-fuse*.jar"/>

    <plugin type="autoinventory"
            class="org.hyperic.hq.product.jmx.MxServerDetector"/>
  </server>

  <server name="ActiveMQ"
          version="5.4.2-fuse"
          include="5.4.1-fuse">

    <property name="VERSION_FILE"
              value="activemq-all-5.4.2-fuse*.jar"/>

    <plugin type="autoinventory"
            class="org.hyperic.hq.product.jmx.MxServerDetector"/>
  </server>

  <server name="ActiveMQ"
          version="5.5.0-fuse"
          include="5.4.2-fuse">

    <property name="VERSION_FILE"
              value="activemq-all-5.5.0-fuse*.jar"/>

    <plugin type="autoinventory"
            class="org.hyperic.hq.product.jmx.MxServerDetector"/>
  </server>

</plugin>
