<?xml version="1.0" encoding="UTF-8"?>

<!-- ===================================================================== -->
<!--                                                                       -->
<!--  JBoss Server Configuration                                           -->
<!--                                                                       -->
<!-- ===================================================================== -->

<!-- $Id: hsqldb-default-service.xml,v 1.9 2002/01/20 15:14:43 mnf999 Exp $ -->

<server>


  <classpath archives="jbosscx.sar"/>

  <!-- ==================================================================== -->
  <!-- JDBC - Initialize the databases                                      -->
  <!-- to ConnectionFactoryLoader                                           -->
  <!-- ==================================================================== -->

  <mbean code="org.jboss.resource.ConnectionFactoryLoader" 
	 name="jboss:service=ConnectionFactoryLoader,name=DefaultDS">
    <attribute name="ManagedConnectionFactoryProperties">
        ConnectionURL=jdbc:hsqldb:hsql://localhost:1476
        DriverClass=org.hsqldb.jdbcDriver
        UserName=sa
    </attribute>
    <attribute name="JndiName">DefaultDS</attribute>
    <attribute name="TransactionManagerName">java:/TransactionManager</attribute>

    <!--Anonymous depends to database being started -->
    <!--WARNING: DO NOT COPY BLINDLY! This is useful only if the database is
        started by an mbean in the jboss jmx framework! The only example of this 
        we have right now is hsqldb! Do not use a line like this for external 
        databases. -->
    <depends>jboss:service=Hypersonic</depends>

    <depends optional-attribute-name="ResourceAdapterName">jboss.jca:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter</depends>
    <depends optional-attribute-name="ConnectionManagerFactoryLoaderName">jboss.jca:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory</depends>
    <attribute name="ConnectionManagerProperties">
      MinSize=0
      MaxSize=10
      BlockingTimeoutMillis=5000
      IdleTimeoutMinutes=30
      CleanupIntervalMinutes=10
      MaxIdleTimeoutPercent=1.0
    </attribute>
    <attribute name="PrincipalMappingClass">
      org.jboss.resource.security.ManyToOnePrincipalMapping
   </attribute>
    <attribute name="PrincipalMappingProperties">UserName=sa</attribute>
  </mbean>

  <mbean code="org.jboss.resource.ConnectionFactoryLoader" 
	 name="jboss:service=ConnectionFactoryLoader,name=NoTransDS">
    <attribute name="ManagedConnectionFactoryProperties">
        ConnectionURL=jdbc:hsqldb:hsql://localhost:1476
        DriverClass=org.hsqldb.jdbcDriver
        UserName=sa
        AutoCommit=true
    </attribute>
    <attribute name="JndiName">NoTransDS</attribute>
    <attribute name="TransactionManagerName">java:/TransactionManager</attribute>

    <!--Anonymous depends to database being started -->
    <depends>jboss:service=Hypersonic</depends>

    <depends optional-attribute-name="ResourceAdapterName">jboss.jca:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter</depends>
    <depends optional-attribute-name="ConnectionManagerFactoryLoaderName">jboss.jca:service=ConnectionManagerFactoryLoader,name=MinervaNoTransCMFactory</depends>
    <attribute name="ConnectionManagerProperties">
      MinSize=0
      MaxSize=10
      BlockingTimeoutMillis=5000
      IdleTimeoutMinutes=30
      CleanupIntervalMinutes=10
      MaxIdleTimeoutPercent=1.0
    </attribute>
    <attribute name="PrincipalMappingClass">
      org.jboss.resource.security.ManyToOnePrincipalMapping
   </attribute>
    <attribute name="PrincipalMappingProperties">UserName=sa</attribute>
  </mbean>

  <!-- Moved to end to test anonymous depends -->

  <mbean code="org.jboss.jdbc.HypersonicDatabase" 
	 name="jboss:service=Hypersonic">
    <attribute name="Port">1476</attribute>
    <attribute name="Silent">true</attribute>
    <attribute name="Database">default</attribute>
    <attribute name="Trace">false</attribute>
  </mbean>

</server>
