<?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-2009 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>

<!-- ResourceAdapterModule =========================================================== -->

  <mbean name="ResourceAdapterModule"
         description="ResourceAdapterModule J2EEModule (which is a J2EEDeployedObject)"
         domain="JOnAS"
         group="J2EEDeployed"
         type="org.ow2.jonas.resource.internal.mbean.ResourceAdapterModule">

    <!-- JSR77 J2EEManagedObject -->
    <attribute name="objectName"
               description="JMX name of this 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"/>

  <!-- JSR77 J2EEDeployedObject -->
    <attribute name="deploymentDescriptor"
               description="The standard deployment descriptor of the rar"
               type="java.lang.String"
               writeable="false"/>

    <attribute name="server"
               description="The J2EE Server this module is deployed on"
               type="java.lang.String"/>

  <!-- JSR77 J2EEModule -->
    <attribute name="javaVMs"
               description="The Java virtual machines on which this module is running"
               type="[Ljava.lang.String;"
               writeable="false"/>

  <!-- JSR77 ResourceAdapterModule -->
    <attribute name="resourceAdapters"
               description="OBJECT_NAME list corresponding to the ResourceAdapters contained in this module"
               type="[Ljava.lang.String;"
               writeable="false"/>

  <!-- JOnAS specific -->
    <attribute name="earURL"
               description="URL of the EAR containing this module"
               type="java.net.URL"
               writeable="false"/>

    <attribute name="earON"
               description="OBJECT_NAME of the parent J2EEApplication MBean"
               type="java.lang.String"
               writeable="false"/>

    <attribute name="rarURL"
               description="URL of the file containing the RAR"
               type="java.net.URL"
               writeable="false"/>

    <attribute name="fileName"
               description="Name of the file containing the RAR"
               type="java.lang.String"
               writeable="false"/>

    <attribute name="inEarCase"
               description="True if the RA Module is included in a J2EE Application"
               type="boolean"
               writeable="false"/>

    <attribute name="jonasDeploymentDescriptor"
               description="The JOnAS deployment descriptor of the rar"
               type="java.lang.String"
               writeable="false"/>
  </mbean>

  <mbean name="ResourceAdapter"
         description="ResourceAdapter J2EEManagedObject"
         domain="JOnAS"
         group="J2EEManaged"
         type="org.ow2.jonas.resource.internal.mbean.ResourceAdapter">

    <!-- JSR77 J2EEManagedObject -->
    <attribute name="objectName"
               description="JMX name of this 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"/>

    <!-- JSR77 ResourceAdapter -->
    <attribute name="jcaResource"
               description="OBJECT_NAME for the JCA connector resource implemented by this ResourceAdapter"
               type="String"
               writeable="false"/>

  <!-- JOnAS specific -->
    <attribute name="properties"
               description="Resource Adapter Properties"
               type="java.util.Properties"
               writeable="false"/>

    <attribute name="jndiName"
               description="Resource Adapter JNDI name"
               type="String"
               writeable="false"/>

    <attribute name="rarLink"
               description="rarLink"
               type="String"
               writeable="false"/>
       
    <attribute name="specVersion"
               description="Connector Architecture Specification version"
               type="String"
               writeable="false"/>

    <attribute name="resourceAdapterClassname"
               description="Resource Adapter classname (only for 1.5 connector)"
               type="java.lang.String"
               writeable="false"/>
  </mbean>

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

   <!-- 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"/>
   <!-- JSR77 JCAResource -->
    <attribute name="connectionFactories"
               description="OBJECT_NAME list corresponding to the JCA ConnectionFactories managed by this resource"
               type="[Ljava.lang.String;"
               writeable="false"/>

  <!-- JOnAS specific -->
    <attribute name="activationSpecs"
               description="OBJECT_NAME list corresponding to the JCA Messagelisteners managed by this resource"
               type="[Ljava.lang.String;"
               writeable="false"/>

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

  </mbean>

  <mbean name="JCAConnectionFactory"
     className="org.ow2.jonas.resource.internal.mbean.JCAConnectionFactoryMBean"
         description="JCA ConnectionFactory"
         domain="JOnAS"
         group="J2EEManaged"
         type="org.ow2.jonas.resource.internal.mbean.JCAConnectionFactory">

   <!-- 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"/>

  <!-- JSR77 JCAConnectionFactory -->
    <attribute name="managedConnectionFactory"
               description="OBJECT_NAME of the JCA Managed ConnectionFactory associated with this ConnectionFactory"
               type="String"
               writeable="false"/>

    <attribute name="properties"
               description="ConnectionFactory Properties"
               type="java.util.Properties"
               writeable="false"/>

    <attribute name="jndiName"
               description="ConnectionFactory JNDI name"
               type="String"
               writeable="false"/>

    <attribute name="description"
               description="ConnectionFactory description"
               type="String"
               writeable="false"/>

    <attribute name="fileName"
               description="RAR file name"
               type="String"
               writeable="false"/>
               
  <!-- JOnAS pooling/statistics specific -->
    <attribute name="jdbcConnSetUp"
               description="True if there is a JDBC connection to manage"
               type="boolean"
               writeable="false"
               is="true" />
    
    <attribute name="jdbcConnCheckLevel"
               description="JDBC connection checking level: 0 (no check), 1 (check connection), 2 (call the test statement), 3 (keep alive sending test statement each sampling period)"
               type="java.lang.Integer"
               writeable="true"/>
               
    <attribute name="jdbcTestStatement"
               description="JDBC connection test statement"
               type="java.lang.String"
               writeable="true"/>

    <attribute name="pstmtMax"
               description="Max size of prepared statements cache"
               type="java.lang.Integer"
               writeable="true"/>

    <attribute name="connMaxAge"
               description="Connection maximum age"
               type="java.lang.Integer"
               writeable="true"/>

    <attribute name="maxSize"
               description="Connection pool maximum size"
               type="java.lang.Integer"
               writeable="true"/>

    <attribute name="maxOpentime"
               description="Connection maximum open time"
               type="java.lang.Integer"
               writeable="true"/>

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

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

    <attribute name="initSize"
               description="Connection pool initial capacity"
               type="java.lang.Integer"
               writeable="false"/>

    <attribute name="minSize"
               description="Connection pool minimum size"
               type="java.lang.Integer"
               writeable="true"/>

    <attribute name="samplingPeriod"
               description="Pool sampling period for refreshing statistics"
               type="java.lang.Integer"
               writeable="true"/>

    <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 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" />

    <!-- 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="JCAManagedConnectionFactory"
         description="JCA Managed ConnectionFactory"
         domain="JOnAS"
         group="J2EEManaged"
         type="org.ow2.jonas.resource.internal.mbean.JCAManagedConnectionFactory">

   <!-- 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"/>

    <!-- JSR77 JCAManagedConnectionFactory -->

  </mbean>

  <mbean name="JCAAdminObject"
         description="JCA Admin Object"
         domain="JOnAS"
         group="J2EEManaged"
         type="org.ow2.jonas.resource.internal.mbean.JCAAdminObject">

    <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"/>
  <!-- JOnAS specific -->
    <attribute name="description"
               description="AdminObject Description"
               type="String"
               writeable="false"/>

    <attribute name="jndiName"
               description="AdminObject JNDI name"
               type="String"
               writeable="false"/>

    <attribute name="properties"
               description="AdminObject Properties"
               type="java.util.Properties"
               writeable="false"/>

  </mbean>

  <mbean name="JCAActivationSpec"
         description="JCA ActivationSpec"
         domain="JOnAS"
         group="J2EEManaged"
         type="org.ow2.jonas.resource.internal.mbean.JCAActivationSpec">

    <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"/>
  <!-- JOnAS specific -->
    <attribute name="description"
               description="ActivationSpec Description"
               type="String"
               writeable="false"/>

    <attribute name="jndiName"
               description="ActivationSpec JNDI name"
               type="String"
               writeable="false"/>

    <attribute name="propertiesList"
               description="ActivationSpec Required Properties List"
               type="java.util.List"
               writeable="false"/>

  </mbean>

  <!-- ArchiveConfigMBean ======================================== -->

  <mbean name="ArchiveConfigMBean"
         description="Archive config Component"
         domain="JOnAS"
         group="J2EEManaged"
         type="org.ow2.jonas.resource.internal.mbean.ArchiveConfigMBean">

     <operation name="extractXML"
        description="Extract an XML file from an archive and return a string representation of the xml"
        impact="ACTION"
        returnType="java.lang.String">

       <parameter name="archiveName"
           description="The name of the archive"
           type="java.lang.String"/>

       <parameter name="xmlFilePath"
           description="The path of the XML file within the archive."
           type="java.lang.String"/>
    </operation>

    <operation name="extractDocument"
        description="Extract an XML file from an archive and return a DOM object of that xml"
        impact="ACTION"
        returnType="org.w3c.dom.Document">

       <parameter name="archiveName"
            description="The name of the archive"
            type="java.lang.String"/>

       <parameter name="xmlFilePath"
            description="The path of the XML file within the archive."
            type="java.lang.String"/>
   </operation>


   <operation name="saveXML"
            description="Save the XML file back into the archive."
            impact="ACTION"
            returnType="void">

       <parameter name="archiveName"
             description="The name of the archive"
             type="java.lang.String"/>

       <parameter name="xmlFilePath"
             description="The path of the XML file within the archive."
             type="java.lang.String"/>

       <parameter name="doc"
             description="The document to repack into the archive."
             type="org.w3c.dom.Document"/>
   </operation>

   <operation name="createArchiveWithXmlFile"
         description="Create a new Archive with a single XML file in it."
         impact="ACTION"
         returnType="void">

       <parameter name="archiveName"
             description="The name of the archive"
             type="java.lang.String"/>

       <parameter name="xmlFilePath"
             description="The path of the XML file within the archive."
             type="java.lang.String"/>

       <parameter name="doc"
             description="The document to repack into the archive."
             type="java.lang.String"/>
   </operation>

   <operation name="addXML"
       description="Add a new xml file to an existing archive."
       impact="ACTION"
       returnType="void">

         <parameter name="archiveName"
             description="The name of the archive"
             type="java.lang.String"/>

         <parameter name="xmlFilePath"
             description="The path of the XML file within the archive."
             type="java.lang.String"/>

        <parameter name="doc"
             description="The document to repack into the archive."
             type="java.lang.String"/>
   </operation>


   <operation name="verifyDocument"
        description="Verifies that the document is valid against its schema."
        impact="ACTION"
        returnType="void">

        <parameter name="doc"
             description="The document to validate"
             type="org.w3c.dom.Document"/>
    </operation>
  </mbean>


  <!-- RarConfigMBean ======================================== -->

  <mbean name="RarConfigMBean"
         description="RAR config Component"
         domain="JOnAS"
         group="J2EEManaged"
         type="org.ow2.jonas.resource.internal.mbean.RarConfigMBean">

     <operation name="extractXML"
        description="Extract an XML file from an archive and return a string representation of the xml"
        impact="ACTION"
        returnType="java.lang.String">

      <parameter name="archiveName"
            description="The name of the archive"
            type="java.lang.String"/>
      <parameter name="xmlFilePath"
            description="The path of the XML file within the archive."
            type="java.lang.String"/>
    </operation>

    <operation name="extractDocument"
        description="Extract an XML file from an archive and return a DOM object of that xml"
        impact="ACTION"
        returnType="org.w3c.dom.Document">

       <parameter name="archiveName"
            description="The name of the archive"
            type="java.lang.String"/>

       <parameter name="xmlFilePath"
            description="The path of the XML file within the archive."
            type="java.lang.String"/>
    </operation>

    <operation name="saveXML"
       description="Save the XML file back into the archive."
       impact="ACTION"
       returnType="void">

      <parameter name="archiveName"
            description="The name of the archive"
            type="java.lang.String"/>
      <parameter name="xmlFilePath"
            description="The path of the XML file within the archive."
            type="java.lang.String"/>
      <parameter name="doc"
            description="The document to repack into the archive."
            type="org.w3c.dom.Document"/>
    </operation>

    <operation name="verifyDocument"
        description="Verifies that the document is valid against its schema."
        impact="ACTION"
        returnType="void">

      <parameter name="doc"
            description="The document to validate"
            type="org.w3c.dom.Document"/>
    </operation>

    <operation name="updateXML"
        description="Updates the jonas-ra.xml file within a RAR file with values given by a map."
        impact="ACTION"
        returnType="void">

      <parameter name="archiveName"
             description="The path to the archive to update."
             type="java.lang.String"/>
      <parameter name="map"
             description="The map of key/value pairs with values to update within the XML file."
             type="java.util.Map"/>
    </operation>

    <operation name="getEntityResolver"
        description="Returns an EntityResolver to use in parsing RAR deployment descriptors."
        impact="ACTION"
        returnType="org.xml.sax.EntityResolver">
    </operation>

    <operation name="createArchiveWithXmlFile"
        description="Create a new Archive with a single XML file in it."
        impact="ACTION"
        returnType="void">

      <parameter name="archiveName"
             description="The name of the archive"
             type="java.lang.String"/>
      <parameter name="xmlFilePath"
             description="The path of the XML file within the archive."
             type="java.lang.String"/>
      <parameter name="doc"
             description="The document to repack into the archive."
             type="java.lang.String"/>
    </operation>

  </mbean>

</mbeans-descriptors>
