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

<!--
     Hypersonic persistence deployment descriptor.

     DO NOT USE HYPERSONIC IN PRODUCTION or in a clustered environment- Hypersonic does not have transaction isolation

     This clustered example is provided for test purposes and integration with JBAS only. Do not use it in real situations!

     $Id: clustered-hsqldb-persistence-service.xml 4698 2008-07-21 15:29:14Z jhowell@redhat.com $
 -->

<server>

   <!-- Persistence Manager MBean configuration
       ======================================= -->

   <mbean code="org.jboss.messaging.core.jmx.JDBCPersistenceManagerService"
      name="jboss.messaging:service=PersistenceManager"
      xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml">

      <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>

      <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>

      <!-- The datasource to use for the persistence manager -->

      <attribute name="DataSource">java:/DefaultDS</attribute>

      <!-- If true will attempt to create tables and indexes on every start-up -->

      <attribute name="CreateTablesOnStartup">true</attribute>

      <!-- If true then will use JDBC batch updates -->

      <attribute name="UsingBatchUpdates">false</attribute>

      <!-- The maximum number of parameters to include in a prepared statement -->

      <attribute name="MaxParams">500</attribute>
   </mbean>

   <!-- Messaging Post Office MBean configuration
        ========================================= -->

   <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
      name="jboss.messaging:service=PostOffice"
      xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml">

      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>

      <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>

      <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>

      <!-- The name of the post office -->

      <attribute name="PostOfficeName">JMS post office</attribute>

      <!-- The datasource used by the post office to access it's binding information -->

      <attribute name="DataSource">java:/DefaultDS</attribute>

      <!-- If true will attempt to create tables and indexes on every start-up -->

      <attribute name="CreateTablesOnStartup">true</attribute>

      <!-- This config was not meant to be used in production. For a clustered setup you need a shared database -->

      <attribute name="Clustered">true</attribute>

      <!-- All the remaining properties only have to be specified if the post office is clustered.
           You can safely comment them out if your post office is non clustered -->

      <!-- The JGroups group name that the post office will use -->

      <attribute name="GroupName">${jboss.messaging.groupname:MessagingPostOffice}</attribute>

      <!-- Max time to wait for state to arrive when the post office joins the cluster -->

      <attribute name="StateTimeout">5000</attribute>

      <!-- Max time to wait for a synchronous call to node members using the MessageDispatcher -->

      <attribute name="CastTimeout">50000</attribute>
      
      <!-- Set this to true if you want failover of connections to occur when a node is shut down -->
      
      <attribute name="FailoverOnNodeLeave">false</attribute>
      
      <depends optional-attribute-name="ChannelFactoryName">jboss.jgroups:service=ChannelFactory</depends>
      <attribute name="ControlChannelName">jbm-control</attribute>
      <attribute name="DataChannelName">jbm-data</attribute>
      <attribute name="ChannelPartitionName">${jboss.partition.name:DefaultPartition}-JMS</attribute>
   </mbean>

   <!-- Messaging JMS User Manager MBean config
        ======================================= -->

   <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
      name="jboss.messaging:service=JMSUserManager"
      xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">

      <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>

      <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>

      <attribute name="DataSource">java:/DefaultDS</attribute>

      <attribute name="CreateTablesOnStartup">true</attribute>

      <attribute name="SqlProperties"><![CDATA[
POPULATE.TABLES.1  = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('guest', 'guest')
POPULATE.TABLES.2  = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('j2ee', 'j2ee')
POPULATE.TABLES.3  = INSERT INTO JBM_USER (USER_ID, PASSWD, CLIENTID) VALUES ('john', 'needle', 'DurableSubscriberExample')
POPULATE.TABLES.4  = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('nobody', 'nobody')
POPULATE.TABLES.5  = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('dynsub', 'dynsub')
POPULATE.TABLES.6  = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('guest','guest')
POPULATE.TABLES.7  = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('j2ee','guest')
POPULATE.TABLES.8  = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('john','guest')
POPULATE.TABLES.9  = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('subscriber','john')
POPULATE.TABLES.10 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('publisher','john')
POPULATE.TABLES.11 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('publisher','dynsub')
POPULATE.TABLES.12 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('durpublisher','john')
POPULATE.TABLES.13 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('durpublisher','dynsub')
POPULATE.TABLES.14 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('noacc','nobody')
      ]]></attribute>
   </mbean>

</server>