[jboss-cvs] JBoss Messaging SVN: r6516 - in trunk: AS and 14 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Apr 21 15:34:23 EDT 2009


Author: clebert.suconic at jboss.com
Date: 2009-04-21 15:34:22 -0400 (Tue, 21 Apr 2009)
New Revision: 6516

Added:
   trunk/AS/config/default/
   trunk/AS/config/default/jbm-configuration.xml
   trunk/AS/config/independent/
   trunk/AS/config/independent/jbm-jboss-beans.xml
   trunk/AS/config/independent/jbm-jms.xml
   trunk/AS/config/independent/jbm-queues.xml
   trunk/AS/config/independent/jms-ds.xml
   trunk/AS/config/symmetric/
   trunk/AS/config/symmetric/jbm-configuration.xml
   trunk/examples/javaee/hajndi/
   trunk/examples/javaee/hajndi/build.xml
   trunk/examples/javaee/hajndi/readme.html
   trunk/examples/javaee/hajndi/src/
   trunk/examples/javaee/hajndi/src/org/
   trunk/examples/javaee/hajndi/src/org/jboss/
   trunk/examples/javaee/hajndi/src/org/jboss/javaee/
   trunk/examples/javaee/hajndi/src/org/jboss/javaee/example/
   trunk/examples/javaee/hajndi/src/org/jboss/javaee/example/HAJNDIExample.java
Removed:
   trunk/AS/config/jbm-jboss-beans.xml
   trunk/AS/config/jms-ds.xml
   trunk/examples/jms/message-counters/server0/logs/
Modified:
   trunk/.classpath
   trunk/AS/build.xml
   trunk/build-messaging.xml
   trunk/examples/javaee/mdb/
   trunk/examples/jms/clustered-topic/server1/jbm-configuration.xml
Log:
Adding HAJNDI example and implementing profiles on AS/build.xml

Modified: trunk/.classpath
===================================================================
--- trunk/.classpath	2009-04-21 18:23:06 UTC (rev 6515)
+++ trunk/.classpath	2009-04-21 19:34:22 UTC (rev 6516)
@@ -64,6 +64,7 @@
 	<classpathentry kind="src" path="examples/javaee/ejb-jms-transaction/src"/>
 	<classpathentry kind="src" path="examples/javaee/jms-bridge/src"/>
 	<classpathentry kind="src" path="examples/javaee/mdb/src"/>
+	<classpathentry kind="src" path="examples/javaee/hajndi/src"/>
 	<classpathentry kind="src" path="examples/javaee/xarecovery/src"/>
 	<classpathentry kind="lib" path="thirdparty/apache-log4j/lib/log4j.jar"/>
 	<classpathentry kind="lib" path="thirdparty/junit/lib/junit.jar"/>

Modified: trunk/AS/build.xml
===================================================================
--- trunk/AS/build.xml	2009-04-21 18:23:06 UTC (rev 6515)
+++ trunk/AS/build.xml	2009-04-21 19:34:22 UTC (rev 6516)
@@ -35,13 +35,18 @@
    <property name="lib.dir" value="../lib"/>
 
    <target name="default">
-      <antcall target="build">
-         <param name="messaging.config.source" value="default"/>
-         <param name="messaging.config.name" value="jbm2_default"/>
-      </antcall>
+    <antcall target="build">
+       <param name="messaging.config.source" value="default"/>
+       <param name="messaging.profile.name" value="default"/>
+    </antcall>
+    <antcall target="build">
+       <param name="messaging.config.source" value="all"/>
+       <param name="messaging.profile.name" value="symmetric"/>
+    </antcall>
    </target>
 
    <target name="build">
+      <property name="messaging.config.name" value="jbm2_${messaging.profile.name}"/>
       <antcall target="validate-jboss"/>
       <property name="src.dir" value="${jboss.home}/server/${messaging.config.source}"/>
       <property name="dest.dir" value="${jboss.home}/server/${messaging.config.name}"/>
@@ -73,18 +78,9 @@
       <property name="messaging.sar.dir" value="${dest.dir}/deploy/messaging.sar"/>
       <mkdir dir="${messaging.sar.dir}"/>
       <copy todir="${messaging.sar.dir}">
-         <fileset dir="${config.dir}">
-            <include name="jbm-jboss-beans.xml"/>
-            <include name="jms-ds.xml"/>
-         </fileset>
+        <fileset dir="${config.dir}/independent" includes="*"/>
+        <fileset dir="${config.dir}/${messaging.profile.name}" includes="*"/>
       </copy>
-      <copy todir="${messaging.sar.dir}">
-         <fileset dir="${main.config.dir}">
-            <include name="jbm-configuration.xml"/>
-            <include name="jbm-jms.xml"/>
-            <include name="jbm-queues.xml"/>
-         </fileset>
-      </copy>
       <copy file="jbm-ra.rar" tofile="${dest.dir}/deploy/jms-ra.rar"/>
    </target>
 

Added: trunk/AS/config/default/jbm-configuration.xml
===================================================================
--- trunk/AS/config/default/jbm-configuration.xml	                        (rev 0)
+++ trunk/AS/config/default/jbm-configuration.xml	2009-04-21 19:34:22 UTC (rev 6516)
@@ -0,0 +1,150 @@
+<deployment xmlns="urn:jboss:messaging" 
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:messaging ../schemas/jbm-configuration.xsd">
+   <configuration>
+
+      <clustered>false</clustered>
+                  
+      <!-- Maximum number of threads to use for scheduled deliveries -->
+      <scheduled-max-pool-size>30</scheduled-max-pool-size>
+
+      <security-enabled>true</security-enabled>
+      
+      <security-invalidation-interval>10000</security-invalidation-interval>
+
+      <wild-card-routing-enabled>true</wild-card-routing-enabled>
+
+      <management-address>jbm.management</management-address>
+      <management-notification-address>jbm.notifications</management-notification-address>      
+
+      <!-- true to expose JBoss Messaging resources through JMX -->
+      <jmx-management-enabled>true</jmx-management-enabled>
+
+      <!-- by default, message counter is disabled -->
+      <message-counter-enabled>false</message-counter-enabled>
+    
+      <connection-scan-period>10000</connection-scan-period>
+            
+      <!--how long before timing a transaction out-->
+      <transaction-timeout>60000</transaction-timeout>
+      <!--how often to scan for timedout transactions-->
+      <transaction-timeout-scan-period>1000</transaction-timeout-scan-period>
+
+      <!-- how often do we scan the queues for expired messages-->
+      <message-expiry-scan-period>30000</message-expiry-scan-period>
+      <!-- the priority of the thread that expires th emessages (between 1 - 10 inclusive)-->
+      <message-expiry-thread-priority>3</message-expiry-thread-priority>
+      
+      <!-- Example interceptors 
+      <remoting-interceptors>
+         <class-name>org.jboss.messaging.tests.unit.core.config.impl.TestInterceptor1</class-name>
+         <class-name>org.jboss.messaging.tests.unit.core.config.impl.TestInterceptor2</class-name>
+      </remoting-interceptors>
+      -->
+      
+      <queue-activation-timeout>30000</queue-activation-timeout>
+
+      <backup>false</backup>
+      
+      <persist-delivery-count-before-delivery>false</persist-delivery-count-before-delivery>
+          
+      <!--
+      <backup-connector-ref connector-name="netty-backup"/>
+      -->
+      
+      <!-- Connectors -->
+      <connectors>
+         <connector name="netty-connector">
+            <factory-class>org.jboss.messaging.integration.transports.netty.NettyConnectorFactory</factory-class>
+            <param key="jbm.remoting.netty.host" value="${jboss.bind.address}" type="String"/>
+            <param key="jbm.remoting.netty.port" value="${jbm.remoting.netty.port}" type="Integer"/>
+         </connector>
+      
+         <!-- <connector name="netty-connector-ssl">
+            <factory-class>org.jboss.messaging.integration.transports.netty.NettyConnectorFactory</factory-class>
+            <param key="jbm.remoting.netty.host" value="${jboss.bind.address}" type="String"/>
+            <param key="jbm.remoting.netty.port" value="${jbm.remoting.netty.ssl.port}" type="Integer"/>	                     
+            <param key="jbm.remoting.netty.sslenabled" value="true" type="Boolean"/>
+         </connector> -->
+
+         <connector name="in-vm-connector">
+            <factory-class>org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
+         </connector>
+
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <!-- In VM acceptor -->
+         <acceptor name="in-vm-acceptor">            
+            <factory-class>org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory</factory-class>
+            <param key="jbm.remoting.invm.serverid" value="0" type="Integer"/>
+         </acceptor>
+
+         <!-- Netty TCP Acceptor -->
+         <acceptor name="netty-acceptor">
+            <factory-class>org.jboss.messaging.integration.transports.netty.NettyAcceptorFactory</factory-class>
+            <param key="jbm.remoting.netty.host" value="${jboss.bind.address}" type="String"/>
+            <param key="jbm.remoting.netty.port" value="${jbm.remoting.netty.port}" type="Integer"/>
+         </acceptor>
+      
+         <!-- Netty In VM Acceptor, needed for the servlet transport-->
+         <!--
+         <acceptor name="netty-invm">
+            <factory-class>org.jboss.messaging.integration.transports.netty.NettyAcceptorFactory</factory-class>
+            <param key="jbm.remoting.netty.useinvm" value="true" type="Boolean"/>
+            <param key="jbm.remoting.netty.host" value="org.jboss.jbm" type="String"/>
+         </acceptor>
+         -->
+      </acceptors>
+      
+      <!-- Large Messages configuration -->
+      
+      <large-messages-directory>${jboss.server.data.dir}/messaging/largemessages</large-messages-directory>
+      
+      <!--  Paging configuration -->
+      
+      <paging-max-threads>10</paging-max-threads>
+      
+      <paging-directory>${jboss.server.data.dir}/messaging/paging</paging-directory>
+      
+      <paging-global-watermark-size>10485760</paging-global-watermark-size>
+      
+      <paging-max-global-size-bytes>104857600</paging-max-global-size-bytes>
+      
+      <!-- Storage configuration -->
+
+      <bindings-directory>${jboss.server.data.dir}/messaging/bindings</bindings-directory>
+
+      <create-bindings-dir>true</create-bindings-dir>
+
+      <journal-directory>${jboss.server.data.dir}/messaging/journal</journal-directory>
+
+      <create-journal-dir>true</create-journal-dir>
+
+      <journal-type>ASYNCIO</journal-type>
+
+      <!-- The journal will reuse any buffers where the size < journal-buffer-reuse-size on write operations
+           Set this to -1 to disable this feature -->
+      <journal-buffer-reuse-size>1536</journal-buffer-reuse-size>
+
+      <!-- Does the journal sync to disk on each transaction commit, prepare or rollback? -->
+      <journal-sync-transactional>true</journal-sync-transactional>
+      
+      <!-- Does the journal sync to disk for every non transactional persistent operation? -->
+      <journal-sync-non-transactional>false</journal-sync-non-transactional>
+
+      <!-- 10 MB journal file size -->
+      <journal-file-size>10485760</journal-file-size>
+
+      <journal-min-files>15</journal-min-files>
+
+      <!-- Maximum simultaneous asynchronous writes accepted by the native layer.
+      (parameter ignored on NIO)
+       You can verify the max AIO on the OS level at /proc/sys/fs/aio_max_nr. (aio-nr will give you the current max-aio being used)
+      -->
+      <journal-max-aio>10000</journal-max-aio>
+
+   </configuration>
+   
+</deployment>

Copied: trunk/AS/config/independent/jbm-jboss-beans.xml (from rev 6511, trunk/AS/config/jbm-jboss-beans.xml)
===================================================================
--- trunk/AS/config/independent/jbm-jboss-beans.xml	                        (rev 0)
+++ trunk/AS/config/independent/jbm-jboss-beans.xml	2009-04-21 19:34:22 UTC (rev 6516)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <!-- MBean server -->
+   <bean name="MBeanServer" class="javax.management.MBeanServer">
+      <constructor factoryClass="java.lang.management.ManagementFactory"
+                   factoryMethod="getPlatformMBeanServer"/>
+   </bean> 
+
+   <!-- The core configuration -->
+   <bean name="Configuration" class="org.jboss.messaging.core.config.impl.FileConfiguration"/>   
+
+	<!-- The security manager -->
+   <bean name="JBMSecurityManager" class="org.jboss.messaging.integration.security.JBossASSecurityManager">
+      <depends>JBossSecurityJNDIContextEstablishment</depends>
+      <start ignored="true"/>
+      <stop ignored="true"/>
+   </bean>
+
+	<!-- The core server -->
+   <bean name="MessagingServer" class="org.jboss.messaging.core.server.impl.MessagingServerImpl"> 
+      <constructor>
+         <parameter>
+            <inject bean="Configuration"/>
+         </parameter>
+         <parameter>
+            <inject bean="MBeanServer"/>
+         </parameter>
+         <parameter>
+            <inject bean="JBMSecurityManager"/>
+         </parameter>        
+      </constructor>         
+   </bean>
+   
+   <!-- The JMS server -->
+   <bean name="JMSServerManager" class="org.jboss.messaging.jms.server.impl.JMSServerManagerImpl">
+      <constructor>         
+         <parameter>
+            <inject bean="MessagingServer"/>
+         </parameter>         
+      </constructor>
+   </bean>
+
+</deployment>
\ No newline at end of file

Added: trunk/AS/config/independent/jbm-jms.xml
===================================================================
--- trunk/AS/config/independent/jbm-jms.xml	                        (rev 0)
+++ trunk/AS/config/independent/jbm-jms.xml	2009-04-21 19:34:22 UTC (rev 6516)
@@ -0,0 +1,194 @@
+<deployment xmlns="urn:jboss:messaging" 
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:messaging ../schemas/jbm-jms.xsd ">
+
+   <connection-factory name="testConnectionFactory">
+      <connector-ref connector-name="netty-connector"/>
+      <entries>
+          <entry name="testConnectionFactory"/>
+      </entries>
+   </connection-factory>
+
+   <connection-factory name="ConnectionFactory">
+      <connector-ref connector-name="netty-connector"/>
+      <entries>
+         <entry name="ConnectionFactory"/>
+         <entry name="/ConnectionFactory"/>
+         <entry name="/XAConnectionFactory"/>
+         <entry name="java:/ConnectionFactory"/>
+         <entry name="java:/XAConnectionFactory"/>
+      </entries>
+   </connection-factory>
+
+   <connection-factory name="ServerAckConnectionFactory">
+      <connector-ref connector-name="netty-connector"/>
+      <entries>      
+         <entry name="ServerAckConnectionFactory"/>
+         <entry name="/ServerAckConnectionFactory"/>
+         <entry name="/ServerAckXAConnectionFactory"/>
+         <entry name="java:/ServerAckConnectionFactory"/>
+         <entry name="java:/ServerAckXAConnectionFactory"/>
+      </entries>
+      <pre-acknowledge>true</pre-acknowledge>
+   </connection-factory>
+
+   <connection-factory name="ClusteredConnectionFactory">
+      <connector-ref connector-name="netty-connector" backup-connector-name="netty-backup"/>
+      <entries>
+         <entry name="/ClusteredConnectionFactory"/>
+         <entry name="/ClusteredXAConnectionFactory"/>
+         <entry name="java:/ClusteredConnectionFactory"/>
+         <entry name="java:/ClusteredXAConnectionFactory"/>
+      </entries>
+   </connection-factory>
+   
+   <connection-factory name="ClusteredConnectionFactoryWithDiscovery">
+      <discovery-group-ref discovery-group-name="dg-group1"/> 
+      <entries>
+         <entry name="/ClusteredConnectionFactory"/>
+         <entry name="/ClusteredXAConnectionFactory"/>
+         <entry name="java:/ClusteredConnectionFactory"/>
+         <entry name="java:/ClusteredXAConnectionFactory"/>
+      </entries>
+   </connection-factory>
+
+   <connection-factory name="MyExampleConnectionFactory">
+      <connector-ref connector-name="netty-connector"/>
+      <entries>
+         <entry name="/MyExampleConnectionFactory"/>
+         <entry name="/acme/MyExampleConnectionFactoryDupe"/>
+         <entry name="java:/xyz/CF1"/>
+         <entry name="java:/connectionfactories/acme/connection_factory"/>
+      </entries>
+      <ping-period>5000</ping-period>
+      <call-timeout>30000</call-timeout>
+      <!-- This is the window size in bytes to use when using consumer window based flow control -->
+      <consumer-window-size>1048576</consumer-window-size>
+      <!-- This is the maximum producer send rate that will be applied when using rate based consumer flow control -->
+      <consumer-max-rate>5000</consumer-max-rate>
+      <!-- This is the send window size in bytes -->
+      <producer-window-size>1048576</producer-window-size>
+      <!-- This is the maximum producer send rate that will be applied when using rate based producer flow control -->
+      <producer-max-rate>100</producer-max-rate>
+      <!-- When using this ConnectionFactory, messages beyond this limit are considered largeMessages and will be sent using smaller packets -->
+      <min-large-message-size>10240</min-large-message-size>
+      <!-- You can specify the default Client ID to use for connections created using this factory -->
+      <client-id>MyClientID</client-id>
+      <!-- The batch size in bytes to use when using the DUPS_OK_ACKNOWLEDGE acknowledgement mode -->
+      <dups-ok-batch-size>1048576</dups-ok-batch-size>
+      <!-- The batch size in bytes to use when using transactional sessions -->
+      <transaction-batch-size>1048576</transaction-batch-size>
+      <!--Whether or not we use a blocking call when acknowledging a message-->
+      <block-on-acknowledge>false</block-on-acknowledge>
+      <!--Whether we send non persistent messages synchronously-->
+      <send-np-messages-synchronously>true</send-np-messages-synchronously>
+      <!--Whether we send persistent messages synchronously-->
+      <send-p-messages-synchronously>true</send-p-messages-synchronously>
+      <!--If true, any connections will automatically set a unique group id (per producer) on every message sent-->
+      <auto-group-id>true</auto-group-id>
+      <!--if true then the server will pre ack any message before delivery to a consumer-->
+      <pre-acknowledge>false</pre-acknowledge>
+   </connection-factory>
+
+   <connection-factory name="TestInVMConnectionFactory">
+      <connector-ref connector-name="in-vm"/>
+      <entries>
+         <entry name="/TestInVMConnectionFactory"/>
+      </entries>
+   </connection-factory>
+
+   <connection-factory name="TestSSLConnectionFactory">
+      <connector-ref connector-name="netty-ssl"/>
+      <entries>
+         <entry name="/TestSSLConnectionFactory"/>
+      </entries>
+   </connection-factory>
+
+   <connection-factory name="TestHttpConnectionFactory">
+      <connector-ref connector-name="netty-http"/>
+      <entries>
+         <entry name="/TestHttpConnectionFactory"/>
+      </entries>
+   </connection-factory>
+
+   <connection-factory name="TestServletConnectionFactory">
+      <connector-ref connector-name="netty-servlet"/>
+      <entries>
+         <entry name="/TestServletConnectionFactory"/>
+      </entries>
+   </connection-factory>
+
+   <queue name="MyQueue">
+      <entry name="MyQueue"/>
+   </queue>
+   <queue name="DLQ">
+      <entry name="/queue/DLQ"/>
+   </queue>
+   <queue name="ExpiryQueue">
+      <entry name="/queue/ExpiryQueue"/>
+   </queue>
+   <topic name="testTopic">
+      <entry name="/topic/testTopic"/>
+   </topic>
+   <topic name="topic.A">
+      <entry name="/topic/topicA"/>
+   </topic>
+   <topic name="topic.B">
+      <entry name="/topic/topicB"/>
+   </topic>
+   <topic name="securedTopic">
+      <entry name="/topic/securedTopic"/>
+   </topic>
+   <topic name="testDurableTopic">
+      <entry name="/topic/testDurableTopic"/>
+   </topic>
+   <queue name="testQueue">
+      <entry name="/queue/testQueue"/>
+   </queue>
+   <queue name="testGroupQueue">
+      <entry name="/queue/testGroupQueue"/>
+   </queue>
+   <queue name="testPerfQueue">
+      <entry name="/queue/testPerfQueue"/>
+   </queue>
+   <queue name="A">
+      <entry name="/queue/A"/>
+   </queue>
+   <queue name="B">
+      <entry name="/queue/B"/>
+   </queue>
+   <queue name="C">
+      <entry name="/queue/C"/>
+   </queue>
+   <queue name="D">
+      <entry name="/queue/D"/>
+   </queue>
+   <queue name="ex">
+      <entry name="/queue/ex"/>
+   </queue>
+   <queue name="PrivateDLQ">
+      <entry name="/queue/PrivateDLQ"/>
+   </queue>
+   <queue name="PrivateExpiryQueue">
+      <entry name="/queue/PrivateExpiryQueue"/>
+   </queue>
+   <queue name="QueueWithOwnDLQAndExpiryQueue">
+      <entry name="/queue/QueueWithOwnDLQAndExpiryQueue"/>
+   </queue>
+   <topic name="TopicWithOwnDLQAndExpiryQueue">
+      <entry name="/topic/QueueWithOwnDLQAndExpiryQueue"/>
+   </topic>
+   <queue name="QueueWithOwnRedeliveryDelay">
+      <entry name="/queue/QueueWithOwnRedeliveryDelay"/>
+   </queue>
+   <topic name="TopicWithOwnRedeliveryDelay">
+      <entry name="/topic/TopicWithOwnRedeliveryDelay"/>
+   </topic>
+   <queue name="testDistributedQueue">
+      <entry name="/queue/testDistributedQueue"/>
+   </queue>
+   <topic name="testDistributedTopic">
+      <entry name="/topic/testDistributedTopic"/>
+   </topic>
+
+</deployment>
\ No newline at end of file

Added: trunk/AS/config/independent/jbm-queues.xml
===================================================================
--- trunk/AS/config/independent/jbm-queues.xml	                        (rev 0)
+++ trunk/AS/config/independent/jbm-queues.xml	2009-04-21 19:34:22 UTC (rev 6516)
@@ -0,0 +1,137 @@
+<settings xmlns="urn:jboss:messaging" 
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+            xsi:schemaLocation="urn:jboss:messaging ../schemas/jbm-queues.xsd ">
+
+   <!--  manangement address -->
+   <security match="jbm.management">
+      <!--  only the admin role can interact with the management address  -->
+      <permission type="consume" roles="admin"/>
+      <permission type="send" roles="admin"/>
+      <permission type="manage" roles="admin"/>
+   </security>
+   
+   <security match="jms.topic.testTopic">
+      <permission type="createDurableQueue" roles="durpublisher"/>
+      <permission type="deleteDurableQueue" roles="durpublisher"/>
+      <permission type="consume" roles="guest,publisher,durpublisher"/>
+      <permission type="send" roles="guest,publisher,durpublisher"/>
+   </security>
+
+   <security match="jms.topic.securedTopic">
+      <permission type="send" roles="publisher"/>
+      <permission type="consume" roles="publisher"/>
+   </security>
+
+   <security match="jms.topic.testDurableTopic">
+      <permission type="createDurableQueue" roles="durpublisher"/>
+      <permission type="deleteDurableQueue" roles="durpublisher"/>
+      <permission type="consume" roles="guest,publisher,durpublisher"/>
+      <permission type="send" roles="guest,publisher,durpublisher"/>
+   </security>
+
+   <security match="jms.queue.testQueue">
+      <permission type="consume" roles="guest,publisher"/>
+      <permission type="send" roles="guest,publisher"/>
+   </security>
+
+   <security match="jms.queue.NoSuchQueue">
+      <permission type="consume" roles="guest,publisher"/>
+      <permission type="send" roles="guest,publisher"/>
+   </security>
+
+   <security match="jms.topic.NoSuchTopic">
+      <permission type="consume" roles="guest,publisher"/>
+      <permission type="send" roles="guest,publisher"/>
+   </security>
+
+   <security match="jms.tempqueue.#">
+      <permission type="createTempQueue" roles="guest,def"/>
+      <permission type="deleteTempQueue" roles="guest,def"/>
+      <permission type="consume" roles="guest,def"/>
+      <permission type="send" roles="guest,def"/>
+   </security>
+
+   <security match="jms.temptopic.#">
+      <permission type="createTempQueue" roles="guest,def"/>
+      <permission type="deleteTempQueue" roles="guest,def"/>
+      <permission type="consume" roles="guest,def"/>
+      <permission type="send" roles="guest,def"/>
+   </security>
+
+   <!--this will catch any word i.e. jms.queue.anything-->
+   <!--<security match="jms.queue.#">
+      <permission type="consume" roles="guest,publisher"/>
+      <permission type="send" roles="guest,publisher"/>
+   </security>-->
+
+   <!--this will catch any word i.e. jms.queue.anything-->
+   <!--<security match="jms.topic.#">
+      <permission type="consume" roles="guest,publisher"/>
+      <permission type="send" roles="guest,publisher"/>
+   </security>-->
+
+   <!--default security to catch all-->
+   <security match="#">
+      <permission type="createDurableQueue" roles="guest,def"/>
+      <permission type="deleteDurableQueue" roles="guest,def"/>
+      <permission type="createTempQueue" roles="guest,def"/>
+      <permission type="deleteTempQueue" roles="guest,def"/>
+      <permission type="consume" roles="guest,def"/>
+      <permission type="send" roles="guest,def"/>
+   </security>
+
+   <address-settings match="jms.queue.QueueWithOwnDLQAndExpiryQueue">
+      <dead-letter-address>jms.queue.PrivateDLQ</dead-letter-address>
+      <expiry-address>jms.queue.PrivateExpiryQueue</expiry-address>
+   </address-settings>
+
+   <address-settings match="jms.topic.TopicWithOwnDLQAndExpiryQueue">
+      <dead-letter-address>jms.queue.PrivateDLQ</dead-letter-address>
+      <expiry-address>jms.queue.PrivateExpiryQueue</expiry-address>
+   </address-settings>
+
+   <address-settings match="jms.queue.QueueWithOwnRedeliveryDelay">
+      <redelivery-delay>5000</redelivery-delay>
+   </address-settings>
+
+   <address-settings match="jms.topic.TopicWithOwnRedeliveryDelay">
+      <redelivery-delay>5000</redelivery-delay>
+   </address-settings>
+
+   <address-settings match="jms.queue.testDistributedQueue">
+      <clustered>true</clustered>
+   </address-settings>
+
+   <address-settings match="jms.topic.testDistributedTopic">
+      <clustered>true</clustered>
+   </address-settings>
+
+   <address-settings match="jms.queue.testPerfQueue">
+      <clustered>false</clustered>
+   </address-settings>
+
+   <address-settings match="jms.queue.MyQueue">
+      <max-size-bytes>-1</max-size-bytes>
+      <page-size-bytes>10485760</page-size-bytes>
+      <drop-messages-when-full>false</drop-messages-when-full>
+   </address-settings>
+
+   <address-settings match="jms.queue.testGroupQueue">
+      <max-size-bytes>-1</max-size-bytes>
+      <page-size-bytes>10485760</page-size-bytes>
+      <drop-messages-when-full>false</drop-messages-when-full>
+      <distribution-policy-class>org.jboss.messaging.core.server.impl.GroupingRoundRobinDistributor</distribution-policy-class>
+   </address-settings>
+
+   <!--default for catch all-->
+   <address-settings match="#">
+      <clustered>false</clustered>
+      <dead-letter-address>jms.queue.DLQ</dead-letter-address>
+      <expiry-address>jms.queue.ExpiryQueue</expiry-address>
+      <redelivery-delay>0</redelivery-delay>
+      <max-size-bytes>-1</max-size-bytes>
+      <page-size-bytes>10485760</page-size-bytes>
+      <distribution-policy-class>org.jboss.messaging.core.server.impl.RoundRobinDistributor</distribution-policy-class>
+      <message-counter-history-day-limit>10</message-counter-history-day-limit>
+   </address-settings>
+</settings>

Copied: trunk/AS/config/independent/jms-ds.xml (from rev 6511, trunk/AS/config/jms-ds.xml)
===================================================================
--- trunk/AS/config/independent/jms-ds.xml	                        (rev 0)
+++ trunk/AS/config/independent/jms-ds.xml	2009-04-21 19:34:22 UTC (rev 6516)
@@ -0,0 +1,26 @@
+<connection-factories>
+   <!--
+    JMS Stuff
+   -->
+
+   <mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.messaging:service=JMSProviderLoader,name=JMSProvider">
+      <attribute name="ProviderName">DefaultJMSProvider</attribute>
+      <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
+      <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
+      <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
+      <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
+   </mbean>
+   <!--
+    JMS XA Resource adapter, use this to get transacted JMS in beans
+   -->
+   <tx-connection-factory>
+      <jndi-name>JmsXA</jndi-name>
+      <xa-transaction/>
+      <rar-name>jms-ra.rar</rar-name>
+      <connection-definition>org.jboss.messaging.ra.JBMConnectionFactory</connection-definition>
+      <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
+      <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
+      <max-pool-size>20</max-pool-size>
+      <security-domain-and-application>JmsXARealm</security-domain-and-application>
+   </tx-connection-factory>
+</connection-factories>
\ No newline at end of file

Deleted: trunk/AS/config/jbm-jboss-beans.xml
===================================================================
--- trunk/AS/config/jbm-jboss-beans.xml	2009-04-21 18:23:06 UTC (rev 6515)
+++ trunk/AS/config/jbm-jboss-beans.xml	2009-04-21 19:34:22 UTC (rev 6516)
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
-   <!-- MBean server -->
-   <bean name="MBeanServer" class="javax.management.MBeanServer">
-      <constructor factoryClass="java.lang.management.ManagementFactory"
-                   factoryMethod="getPlatformMBeanServer"/>
-   </bean> 
-
-   <!-- The core configuration -->
-   <bean name="Configuration" class="org.jboss.messaging.core.config.impl.FileConfiguration"/>   
-
-	<!-- The security manager -->
-   <bean name="JBMSecurityManager" class="org.jboss.messaging.integration.security.JBossASSecurityManager">
-      <depends>JBossSecurityJNDIContextEstablishment</depends>
-      <start ignored="true"/>
-      <stop ignored="true"/>
-   </bean>
-
-	<!-- The core server -->
-   <bean name="MessagingServer" class="org.jboss.messaging.core.server.impl.MessagingServerImpl"> 
-      <constructor>
-         <parameter>
-            <inject bean="Configuration"/>
-         </parameter>
-         <parameter>
-            <inject bean="MBeanServer"/>
-         </parameter>
-         <parameter>
-            <inject bean="JBMSecurityManager"/>
-         </parameter>        
-      </constructor>         
-   </bean>
-   
-   <!-- The JMS server -->
-   <bean name="JMSServerManager" class="org.jboss.messaging.jms.server.impl.JMSServerManagerImpl">
-      <constructor>         
-         <parameter>
-            <inject bean="MessagingServer"/>
-         </parameter>         
-      </constructor>
-   </bean>
-
-</deployment>
\ No newline at end of file

Deleted: trunk/AS/config/jms-ds.xml
===================================================================
--- trunk/AS/config/jms-ds.xml	2009-04-21 18:23:06 UTC (rev 6515)
+++ trunk/AS/config/jms-ds.xml	2009-04-21 19:34:22 UTC (rev 6516)
@@ -1,26 +0,0 @@
-<connection-factories>
-   <!--
-    JMS Stuff
-   -->
-
-   <mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.messaging:service=JMSProviderLoader,name=JMSProvider">
-      <attribute name="ProviderName">DefaultJMSProvider</attribute>
-      <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
-      <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
-      <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
-      <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
-   </mbean>
-   <!--
-    JMS XA Resource adapter, use this to get transacted JMS in beans
-   -->
-   <tx-connection-factory>
-      <jndi-name>JmsXA</jndi-name>
-      <xa-transaction/>
-      <rar-name>jms-ra.rar</rar-name>
-      <connection-definition>org.jboss.messaging.ra.JBMConnectionFactory</connection-definition>
-      <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
-      <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
-      <max-pool-size>20</max-pool-size>
-      <security-domain-and-application>JmsXARealm</security-domain-and-application>
-   </tx-connection-factory>
-</connection-factories>
\ No newline at end of file

Added: trunk/AS/config/symmetric/jbm-configuration.xml
===================================================================
--- trunk/AS/config/symmetric/jbm-configuration.xml	                        (rev 0)
+++ trunk/AS/config/symmetric/jbm-configuration.xml	2009-04-21 19:34:22 UTC (rev 6516)
@@ -0,0 +1,172 @@
+<deployment xmlns="urn:jboss:messaging" 
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:messaging ../schemas/jbm-configuration.xsd">
+   <configuration>
+
+      <clustered>true</clustered>
+      
+      <!-- Maximum number of threads to use for scheduled deliveries -->
+      <scheduled-max-pool-size>30</scheduled-max-pool-size>
+
+      <security-enabled>true</security-enabled>
+      
+      <security-invalidation-interval>10000</security-invalidation-interval>
+
+      <wild-card-routing-enabled>true</wild-card-routing-enabled>
+
+      <management-address>admin.management</management-address>
+      <management-notification-address>admin.notification</management-notification-address>      
+
+      <!-- true to expose JBoss Messaging resources through JMX -->
+      <jmx-management-enabled>true</jmx-management-enabled>
+
+      <!-- by default, message counter is disabled -->
+      <message-counter-enabled>false</message-counter-enabled>
+    
+      <connection-scan-period>10000</connection-scan-period>
+            
+      <!--how long before timing a transaction out-->
+      <transaction-timeout>60000</transaction-timeout>
+      <!--how often to scan for timedout transactions-->
+      <transaction-timeout-scan-period>1000</transaction-timeout-scan-period>
+
+      <!-- how often do we scan the queues for expired messages-->
+      <message-expiry-scan-period>30000</message-expiry-scan-period>
+      <!-- the priority of the thread that expires th emessages (between 1 - 10 inclusive)-->
+      <message-expiry-thread-priority>3</message-expiry-thread-priority>
+      
+      <!-- Example interceptors 
+      <remoting-interceptors>
+         <class-name>org.jboss.messaging.tests.unit.core.config.impl.TestInterceptor1</class-name>
+         <class-name>org.jboss.messaging.tests.unit.core.config.impl.TestInterceptor2</class-name>
+      </remoting-interceptors>
+      -->
+      
+      <queue-activation-timeout>30000</queue-activation-timeout>
+
+      <backup>false</backup>      
+
+      <!-- Connectors -->
+      <connectors>
+         <connector name="netty-connector">
+            <factory-class>org.jboss.messaging.integration.transports.netty.NettyConnectorFactory</factory-class>
+            <param key="jbm.remoting.netty.host" value="${jboss.bind.address}" type="String"/>
+            <param key="jbm.remoting.netty.port" value="${jbm.remoting.netty.port}" type="Integer"/>
+         </connector>
+      
+         <!-- <connector name="netty-connector-ssl">
+            <factory-class>org.jboss.messaging.integration.transports.netty.NettyConnectorFactory</factory-class>
+            <param key="jbm.remoting.netty.host" value="${jboss.bind.address}" type="String"/>
+            <param key="jbm.remoting.netty.port" value="${jbm.remoting.netty.ssl.port}" type="Integer"/>	                     
+            <param key="jbm.remoting.netty.sslenabled" value="true" type="Boolean"/>
+         </connector> -->
+
+         <connector name="in-vm-connector">
+            <factory-class>org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
+         </connector>
+
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <!-- In VM acceptor -->
+         <acceptor name="in-vm-acceptor">            
+            <factory-class>org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory</factory-class>
+            <param key="jbm.remoting.invm.serverid" value="0" type="Integer"/>
+         </acceptor>
+
+         <!-- Netty TCP Acceptor -->
+         <acceptor name="netty-acceptor">
+            <factory-class>org.jboss.messaging.integration.transports.netty.NettyAcceptorFactory</factory-class>
+            <param key="jbm.remoting.netty.host" value="${jboss.bind.address}" type="String"/>
+            <param key="jbm.remoting.netty.port" value="${jbm.remoting.netty.port}" type="Integer"/>
+         </acceptor>
+      
+         <!-- Netty In VM Acceptor, needed for the servlet transport-->
+         <!--
+         <acceptor name="netty-invm">
+            <factory-class>org.jboss.messaging.integration.transports.netty.NettyAcceptorFactory</factory-class>
+            <param key="jbm.remoting.netty.useinvm" value="true" type="Boolean"/>
+            <param key="jbm.remoting.netty.host" value="org.jboss.jbm" type="String"/>
+         </acceptor>
+         -->
+      </acceptors>
+      
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>231.7.7.7</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref connector-name="netty-connector"/>
+         </broadcast-group>
+      </broadcast-groups>
+      
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>231.7.7.7</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+      
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <forward-when-no-consumers>true</forward-when-no-consumers>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      
+      <!-- Large Messages configuration -->
+      
+      <large-messages-directory>${jboss.server.data.dir}/messaging/largemessages</large-messages-directory>
+
+      <!--  Paging configuration -->
+      
+      <paging-max-threads>10</paging-max-threads>
+      
+      <paging-directory>${jboss.server.data.dir}/messsaging/paging</paging-directory>
+      
+      <paging-max-global-size-bytes>104857600</paging-max-global-size-bytes>
+      
+      <!-- Storage configuration -->
+
+      <bindings-directory>${jboss.server.data.dir}/messaging/bindings</bindings-directory>
+
+      <create-bindings-dir>true</create-bindings-dir>
+
+      <journal-directory>${jboss.server.data.dir}/messaging/journal</journal-directory>
+
+      <create-journal-dir>true</create-journal-dir>
+
+      <journal-type>ASYNCIO</journal-type>
+
+      <!-- The journal will reuse any buffers where the size < journal-buffer-reuse-size on write operations
+           Set this to -1 to disable this feature -->
+      <journal-buffer-reuse-size>4096</journal-buffer-reuse-size>
+
+      <!-- Does the journal sync to disk on each transaction commit, prepare or rollback? -->
+      <journal-sync-transactional>true</journal-sync-transactional>
+      
+      <!-- Does the journal sync to disk for every non transactional persistent operation? -->
+      <journal-sync-non-transactional>false</journal-sync-non-transactional>
+
+      <!-- 10 MB journal file size -->
+      <journal-file-size>10485760</journal-file-size>
+
+      <journal-min-files>15</journal-min-files>
+
+      <!-- Maximum simultaneous asynchronous writes accepted by the native layer.
+      (parameter ignored on NIO)
+       You can verify the max AIO on the OS level at /proc/sys/fs/aio_max_nr. (aio-nr will give you the current max-aio being used)
+      -->
+      <journal-max-aio>10000</journal-max-aio>
+
+   </configuration>
+
+</deployment>

Modified: trunk/build-messaging.xml
===================================================================
--- trunk/build-messaging.xml	2009-04-21 18:23:06 UTC (rev 6515)
+++ trunk/build-messaging.xml	2009-04-21 19:34:22 UTC (rev 6516)
@@ -920,19 +920,8 @@
          </fileset>
       </copy>
 
-      <antcall target="userdoc"/>
-      <copy todir="${build.distro.dir}/docs/userguide">
-         <fileset dir="${doc.build.dir}">
-            <include name="**"/>
-         </fileset>
-      </copy>
-      <antcall target="javadoc"/>
-      <copy todir="${build.distro.api.dir}/">
-         <fileset dir="${build.api.dir}">
-            <include name="**"/>
-         </fileset>
-      </copy>
-
+      <antcall target="dist-doc"/>
+   	
       <copy todir="${build.distro.licenses.dir}/">
          <fileset dir="${licenses.dir}">
             <include name="**"/>
@@ -985,6 +974,22 @@
             destfile="${build.dir}/${build.artifact}.tar.gz"/>
    </target>
 
+   <target name="dist-doc" unless="no-doc">
+    <antcall target="userdoc"/>
+    <copy todir="${build.distro.dir}/docs/userguide">
+       <fileset dir="${doc.build.dir}">
+          <include name="**"/>
+       </fileset>
+    </copy>
+    <antcall target="javadoc"/>
+    <copy todir="${build.distro.api.dir}/">
+       <fileset dir="${build.api.dir}">
+          <include name="**"/>
+       </fileset>
+    </copy>
+   </target>
+
+	
    <target name="userdoc">
       <ant dir="./docs/userguide" antfile="build.xml" target="all"/>
    </target>


Property changes on: trunk/examples/javaee/hajndi
___________________________________________________________________
Name: svn:ignore
   + build


Added: trunk/examples/javaee/hajndi/build.xml
===================================================================
--- trunk/examples/javaee/hajndi/build.xml	                        (rev 0)
+++ trunk/examples/javaee/hajndi/build.xml	2009-04-21 19:34:22 UTC (rev 6516)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- =========================================================================================== -->
+<!--                                                                                             -->
+<!-- JBoss, Home of Professional Open Source                                                     -->
+<!-- Copyright 2005, JBoss Inc., and individual contributors as indicated                        -->
+<!-- by the @authors tag. See the copyright.txt in the distribution for a                        -->
+<!-- full listing of individual contributors.                                                    -->
+<!--                                                                                             -->
+<!-- This 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 (at your option) any later version.                                         -->
+<!--                                                                                             -->
+<!-- This software 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 software; if not, write to the Free                                 -->
+<!-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA                          -->
+<!-- 02110-1301 USA, or see the FSF site: http://www.fsf.org.                                    -->
+<!--                                                                                             -->
+<!-- =========================================================================================== -->
+
+
+<project default="run" name="JBoss Messaging Java EE MDB Example">
+
+   <import file="../common/build.xml"/>
+
+   <target name="run">
+      <antcall target="runExample">
+         <param name="example.classname" value="org.jboss.javaee.example.HAJNDIExample"/>
+      </antcall>
+   </target>
+
+</project>

Added: trunk/examples/javaee/hajndi/readme.html
===================================================================
--- trunk/examples/javaee/hajndi/readme.html	                        (rev 0)
+++ trunk/examples/javaee/hajndi/readme.html	2009-04-21 19:34:22 UTC (rev 6516)
@@ -0,0 +1,86 @@
+<html>
+  <head>
+    <title>JBoss Messaging Java EE HAJNDI Example</title>
+    <link rel="stylesheet" type="text/css" href="../../jms/common/common.css">
+  </head>
+  <body>
+     <h1>Java EE HAJNDI Example</h1>
+     <br>
+     <p>This example demonstrates a simple symmetric clustering configuration, and failover on JNDI (HAJNDI).</p>
+     <h2>Configuring the example:</h2>
+     <ol>
+     <li>define the property JBOSS_HOME pointing to a JBoss 5.1 distribution</li>
+     <li>Install JBossMessaging by typing <code>ant</code> under <code>/messaging-distribution/AS</code></li>
+     <li>Copy the directory $JBOSS_HOME/server/jbm2_symmetric as $JBOSS_HOME/server/jbm2_symmetric_2</li>
+     <li>Start the first server with <code>./run.sh -c jbm2_symmetric</code></li>
+     <li>Start the second server with <code>./run.sh -c jbm2_symmetric_2 -Djboss.service.binding.set=ports-01</li>
+     </ol>
+     <h1>Example step by step</h1>
+     <ol>
+        <li>Create a JNDI Context using HAJNDI Properties.
+            <p>This JNDI is performing auto-discovery of the servers, by using the default UDP properties.</p>
+            <p>You will find more information about these properties at the <a href="http://www.jboss.org/file-access/default/members/jbossas/freezone/docs/Clustering_Guide/5/html/clustering-jndi.html">JBoss Application Documentation</a></p>
+        </li>
+        <pre>
+           <code>         
+         Hashtable jndiParameters = new Hashtable();
+         jndiParameters.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
+         jndiParameters.put("java.naming.factory.url.pkgs=", "org.jboss.naming:org.jnp.interfaces");
+         
+         initialContext = new InitialContext(jndiParameters);
+         </code>
+        </pre>
+        
+        
+        <li>Perform lookups in a loop. As long as you have at least one server alive, these lookups will still work fine
+         <pre>
+         <code>
+         for (int i = 0; i < 100; i++)
+         {
+            ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");
+         </code>
+         </pre>
+        </li>
+
+        <li>Create and close a JMS Connection, just to show the downloaded Connection Factory is working
+        <pre>
+        <code>
+            connection = cf.createConnection();
+            connection.close();
+        </code>
+        </pre>
+        </li>
+        
+        
+        <li>As the example sleeps here, use this time to kill one of the servers. You will realize that lookups will still work as long as you have a live server
+        
+        <pre>
+        <code>
+            System.out.println("Connection " + i + " was created and closed. If you kill any of the servers now, the lookup operation on Step 2 will still work fine");
+            Thread.sleep(5000);
+         }
+        </code>
+        </pre>
+        </li>
+        
+        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
+
+        <pre>
+           <code>finally
+           {
+              if (initialContext != null)
+              {
+                initialContext.close();
+              }
+              if (connection != null)
+              {
+                 connection.close();
+              }
+           }</code>
+        </pre>
+
+
+
+     </ol>
+  </body>
+</html>
\ No newline at end of file

Added: trunk/examples/javaee/hajndi/src/org/jboss/javaee/example/HAJNDIExample.java
===================================================================
--- trunk/examples/javaee/hajndi/src/org/jboss/javaee/example/HAJNDIExample.java	                        (rev 0)
+++ trunk/examples/javaee/hajndi/src/org/jboss/javaee/example/HAJNDIExample.java	2009-04-21 19:34:22 UTC (rev 6516)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.javaee.example;
+
+import java.util.Hashtable;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.naming.InitialContext;
+
+/**
+ * @author <a href="mailto:csuconic at jboss.org">Clebert Suconic</a>
+ */
+public class HAJNDIExample
+{
+   public static void main(String[] args) throws Exception
+   {
+      Connection connection = null;
+      InitialContext initialContext = null;
+      try
+      {
+         
+         
+         //Step 1. Create an initial context to perform the JNDI lookup.
+         //        This JNDI is performing auto-discovery of the servers, by using the default UDP properties.
+         //        You will find more information at the JBoss Application Server Documentation:
+         //        http://www.jboss.org/file-access/default/members/jbossas/freezone/docs/Clustering_Guide/5/html/clustering-jndi.html
+         
+         Hashtable jndiParameters = new Hashtable();
+         jndiParameters.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
+         jndiParameters.put("java.naming.factory.url.pkgs=", "org.jboss.naming:org.jnp.interfaces");
+         
+         initialContext = new InitialContext(jndiParameters);
+
+         for (int i = 0; i < 100; i++)
+         {
+            //Step 2. Perform a lookup on the Connection Factory
+            ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");
+   
+            //Step 3. Create a JMS Connection
+            connection = cf.createConnection();
+            connection.close();
+            
+            //Step 4. Kill any of the servers. The Lookups will still be performed ok as long as you keep at least one server alive.
+            System.out.println("Connection " + i + " was created. If you kill any of the servers now, the lookup operation on Step 2 will still work fine");
+            Thread.sleep(5000);
+         }
+         
+         System.out.println("Done");
+
+      }
+      finally
+      {
+         //Step 5. Be sure to close our JMS resources!
+         if (initialContext != null)
+         {
+            initialContext.close();
+         }
+         if(connection != null)
+         {
+            connection.close();
+         }
+      }
+   }
+}


Property changes on: trunk/examples/javaee/mdb
___________________________________________________________________
Name: svn:ignore
   + build


Modified: trunk/examples/jms/clustered-topic/server1/jbm-configuration.xml
===================================================================
--- trunk/examples/jms/clustered-topic/server1/jbm-configuration.xml	2009-04-21 18:23:06 UTC (rev 6515)
+++ trunk/examples/jms/clustered-topic/server1/jbm-configuration.xml	2009-04-21 19:34:22 UTC (rev 6516)
@@ -23,7 +23,7 @@
       
       <!-- Clustering configuration -->
       <broadcast-groups>
-         <broadcast-group name="my-broacast-group">
+         <broadcast-group name="my-broadcast-group">
             <group-address>231.7.7.7</group-address>
             <group-port>9876</group-port>
             <broadcast-period>100</broadcast-period>




More information about the jboss-cvs-commits mailing list