<?xml version="1.0"?>
<!DOCTYPE mbeans-descriptors PUBLIC
 "-//Apache Software Foundation//DTD Model MBeans Configuration File"
 "http://jakarta.apache.org/commons/dtds/mbeans-descriptors.dtd">

<!--
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 - JOnAS: Java(TM) Open Application Server
 - Copyright (C) 1999-2007 Bull S.A.S.
 - Contact: jonas-team@ow2.org
 -
 - This library is free software; you can redistribute it and/or
 - modify it under the terms of the GNU Lesser General Public
 - License as published by the Free Software Foundation; either
 - version 2.1 of the License, or any later version.
 -
 - This library 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
 - Lesser General Public License for more details.
 -
 - You should have received a copy of the GNU Lesser General Public
 - License along with this library; if not, write to the Free Software
 - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 - USA
 -
 - Initial developer(s): Michel-Ange Anton
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 - $Id$
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 -->

<mbeans-descriptors>

  <mbean name="JDBCResource"
         description="JDBCResource J2EEResource"
         domain="JOnAS"
         group="J2EEResource"
         type="org.ow2.jonas.dbm.internal.mbean.JDBCResource">

    <attribute name="jdbcDataSources"
               description="OBJECT_NAME list corresponding to the JDBCDataSources managed by this resource"
               type="[Ljava.lang.String;"
               writeable="false"/>

  <!-- JSR77 J2EEManagedObject -->
    <attribute name="objectName"
               description="Name of the object"
               type="java.lang.String"
               writeable="false"/>

    <attribute name="stateManageable"
               description="State management support for this managed object"
               is="true"
               type="boolean"
               writeable="false"/>

    <attribute name="statisticsProvider"
               description="Performance statistics support for this managed object"
               is="true"
               type="boolean"
               writeable="false"/>

    <attribute name="eventProvider"
               description="Event provider support for this managed object"
               is="true"
               type="boolean"
               writeable="false"/>
  </mbean>

  <mbean name="JDBCDataSource"
         className="org.ow2.jonas.dbm.internal.mbean.JDBCDataSourceMBean"
         description="JDBC DataSource"
         domain="JOnAS"
         group="J2EEManaged"
         type="org.ow2.jonas.dbm.internal.mbean.JDBCDataSource">

    <attribute name="name"
               description="DataSource name"
               type="java.lang.String"
               writeable="false"/>

    <attribute name="jndiName"
               description="JNDI name of the DataSource"
               type="java.lang.String"
               writeable="false"/>

    <attribute name="description"
               description="DataSource description"
               type="java.lang.String"
               writeable="false"/>

    <attribute name="url"
               description="JDBC URL for the database"
               type="java.lang.String"
               writeable="false"/>

    <attribute name="userName"
               description="User name for connection to the database"
               type="java.lang.String"
               writeable="false"/>

    <attribute name="userPassword"
               description="Password for connection to the database"
               type="java.lang.String"
               writeable="false"/>

    <attribute name="mapperName"
               description="Mapper JORM for the database"
               type="java.lang.String"
               writeable="false"/>

    <attribute name="jdbcConnCheckLevel"
               description="JDBC connection checking level: 0 (no check), 1 (check connection), higher (call the test statement)"
               type="java.lang.Integer"
               writeable="true"/>

    <attribute name="jdbcConnMaxAge"
               description="JDBC connection maximum age"
               type="java.lang.Integer"
               writeable="true"/>

    <attribute name="jdbcMaxConnPool"
               description="JDBC connection pool maximum size"
               type="java.lang.Integer"
               writeable="true"/>

    <attribute name="jdbcMaxOpenTime"
               description="JDBC connection maximum open time"
               type="java.lang.Integer"
               writeable="true"/>

    <attribute name="jdbcMaxWaiters"
               description="JDBC connection pool maximum number of waiters allowed"
               type="java.lang.Integer"
               writeable="true"/>

    <attribute name="jdbcMaxWaitTime"
               description="JDBC connection maximum time to wait for"
               type="java.lang.Integer"
               writeable="true"/>

    <attribute name="jdbcPstmtMax"
               description="JDBC PreparedStatement pool capacity per Managed Connection"
               type="java.lang.Integer"
               writeable="true"/>

    <attribute name="jdbcMinConnPool"
               description="JDBC connection pool minimum size and initial capacity"
               type="java.lang.Integer"
               writeable="true"/>

    <attribute name="jdbcSamplingPeriod"
               description="JDBC connection pool sampling period for refreshing statistics"
               type="java.lang.Integer"
               writeable="true"/>

    <attribute name="jdbcAdjustPeriod"
               description="JDBC connection pool period for adjusting number of connections"
               type="java.lang.Integer"
               writeable="true"/>

    <attribute name="jdbcTestStatement"
               description="JDBC connection test statement"
               type="java.lang.String"
               writeable="false"/>

    <attribute name="connectionFailures"
               description="number of connection failures"
               type="java.lang.Integer"
               writeable="false"/>

    <attribute name="connectionLeaks"
               description="number of connection leaks"
               type="java.lang.Integer"
               writeable="false"/>

    <attribute name="currentBusy"
               description="number of busy connections"
               type="java.lang.Integer"
               writeable="false"/>

    <attribute name="busyMax"
               description="maximum number of busy connections"
               type="java.lang.Integer"
               writeable="false"/>

    <attribute name="busyMin"
               description="minimum number of busy connections"
               type="java.lang.Integer"
               writeable="false"/>

    <attribute name="currentInTx"
               description="number of connections used in transactions"
               type="java.lang.Integer"
               writeable="false"/>

    <attribute name="currentOpened"
               description="number of opened connections"
               type="java.lang.Integer"
               writeable="false"/>

    <attribute name="currentWaiters"
               description="current number of connection waiters"
               type="java.lang.Integer"
               writeable="false"/>

    <attribute name="openedCount"
               description="number of opened physical JDBC connections"
               type="java.lang.Integer"
               writeable="false"/>

    <attribute name="rejectedFull"
               description="number of open calls that were rejected because too many waiters"
               type="java.lang.Integer"
               writeable="false"/>

    <attribute name="rejectedOpen"
               description="Total number of open calls that were rejected"
               type="java.lang.Integer"
               writeable="false"/>

    <attribute name="rejectedOther"
               description="number of open calls that were rejected by an unknown reason"
               type="java.lang.Integer"
               writeable="false"/>

    <attribute name="rejectedTimeout"
               description="number of open calls that were rejected by timeout"
               type="java.lang.Integer"
               writeable="false"/>

    <attribute name="servedOpen"
               description="number of xa connection served"
               type="java.lang.Integer"
               writeable="false"/>

    <attribute name="waiterCount"
               description="total number of waiters since datasource creation"
               type="java.lang.Integer"
               writeable="false"/>

    <attribute name="waitersHigh"
               description="maximum number of waiters since datasource creation"
               type="java.lang.Integer"
               writeable="false"/>

    <attribute name="waitersHighRecent"
               description="maximum nb of waiters in last sampling period"
               type="java.lang.Integer"
               writeable="false"/>

    <attribute name="waitingHigh"
               description="maximum waiting time (millisec) since datasource creation"
               type="java.lang.Long"
               writeable="false"/>

    <attribute name="waitingHighRecent"
               description="maximum waiting time (millisec) in last sampling period"
               type="java.lang.Long"
               writeable="false"/>

    <attribute name="waitingTime"
               description="total waiting time (millisec) since datasource creation"
               type="java.lang.Long"
               writeable="false"/>

    <attribute name="observable"
               description="Engage the DataSource's live connections observation"
               type="boolean"
               writeable="true"
               is="true" />

  <!-- JSR77 JDBCDataSource -->
    <attribute name="jdbcDriver"
               description="OBJECT_NAME of the JDBCDriver associated with this JDBCDataSource"
               type="java.lang.String"
               writeable="false"/>

    <!-- JSR77 J2EEManagedObject -->
    <attribute name="objectName"
               description="Name of the object"
               type="java.lang.String"
               writeable="false"/>

    <attribute name="stateManageable"
               description="State management support for this managed object"
               is="true"
               type="boolean"
               writeable="false"/>

    <attribute name="statisticsProvider"
               description="Performance statistics support for this managed object"
               is="true"
               type="boolean"
               writeable="false"/>

    <attribute name="eventProvider"
               description="Event provider support for this managed object"
               is="true"
               type="boolean"
               writeable="false"/>

    <operation name="setJdbcTestStatement"
               description="Set JDBC Test statement"
               impact="ACTION"
               returnType="java.lang.String">
    </operation>

    <!-- Management operation for persistent reconfiguration -->
    <operation name="saveConfig"
               description="Save last configuration update"
               impact="ACTION"
               returnType="void">
    </operation>

    <!-- Fine JDBC Connection handling operations -->
    <operation name="getOpenedConnections"
               description="Show the opened physical connections being used for more than a given amount of time (sec)."
               impact="ACTION"
               returnType="[Lint;">
      <parameter name="openDurationSec"
                 type="int"
                 description="An amount of time (in seconds) for JDBC Connection to be open." />
    </operation>

    <operation name="getOpenedConnections"
               description="Show the opened physical connections being used for more than 30 seconds."
               impact="ACTION"
               returnType="[Lint;">
      <!-- default operation: 30 seconds open time -->
    </operation>

    <operation name="getConnectionDetails"
               description="Show the details of a given JDBC Connection (may return null if the connection was closed)"
               impact="ACTION"
               returnType="java.util.Map">
      <parameter name="connectionId"
                 type="int"
                 description="A JDBC Connection ID (usually retuned by getOpenedConnections)" />
    </operation>

    <operation name="forceCloseConnection"
               description="Force an opened physical connections to be destroyed (rollback Transaction if required)"
               impact="ACTION"
               returnType="void">
      <parameter name="connectionId"
                 type="int"
                 description="The identifier of the JDBC Connection to be closed." />
    </operation>

  </mbean>

  <mbean name="JDBCDriver"
         description="JDBC Driver"
         domain="JOnAS"
         group="J2EEManaged"
         type="org.ow2.jonas.dbm.internal.mbean.JDBCDriver">

    <attribute name="driverClassName"
               description="The Java class name for the JDBC driver"
               type="java.lang.String"
               writeable="false"/>

  <!-- JSR77 J2EEManagedObject -->
    <attribute name="objectName"
               description="Name of the object"
               type="java.lang.String"
               writeable="false"/>

    <attribute name="stateManageable"
               description="State management support for this managed object"
               is="true"
               type="boolean"
               writeable="false"/>

    <attribute name="statisticsProvider"
               description="Performance statistics support for this managed object"
               is="true"
               type="boolean"
               writeable="false"/>

    <attribute name="eventProvider"
               description="Event provider support for this managed object"
               is="true"
               type="boolean"
               writeable="false"/>
  </mbean>


</mbeans-descriptors>