[jboss-cvs] JBossAS SVN: r75511 - in projects/docs/enterprise/4.3.2: Messaging and 147 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jul 8 18:35:09 EDT 2008


Author: irooskov at redhat.com
Date: 2008-07-08 18:35:09 -0400 (Tue, 08 Jul 2008)
New Revision: 75511

Added:
   projects/docs/enterprise/4.3.2/Messaging/
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/Makefile
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/About_This_Book.xml
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Appendix.xml
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Author_Group.xml
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Book_Info.xml
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Important_Features.xml
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/JBoss_Messaging_User_Guide.ent
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/JBoss_Messaging_User_Guide.xml
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Preface.xml
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Revision_History.xml
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/bridge.xml
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/c_configuration.xml
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/configuration.xml
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/gettingstarted.xml
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/installation.xml
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/introduction.xml
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/recoveryconfig.xml
   projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/runningexamples.xml
   projects/docs/enterprise/4.3.2/examples/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/README.html
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/build.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/etc/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/etc/jndi.properties
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/etc/log4j.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/etc/test-bridge-service.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/src/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/src/org/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/src/org/jboss/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/src/org/jboss/example/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/src/org/jboss/example/jms/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/src/org/jboss/example/jms/bridge/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/src/org/jboss/example/jms/bridge/BridgeExample.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/etc/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/etc/META-INF/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/etc/META-INF/ejb-jar.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/etc/META-INF/jboss.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/ExampleSupport.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/Util.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/bean/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/bean/Management.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/bean/ManagementBean.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/bean/ManagementHome.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/README.html
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/build.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/etc/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/etc/jndi.properties
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/etc/log4j.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/src/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/src/org/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/src/org/jboss/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/src/org/jboss/example/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/src/org/jboss/example/jms/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/DistributedQueueExample.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/ExampleListener.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/README.html
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/build.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/etc/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/etc/jndi.properties
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/etc/log4j.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/src/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/src/org/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/src/org/jboss/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/src/org/jboss/example/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/src/org/jboss/example/jms/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/src/org/jboss/example/jms/distributedtopic/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/src/org/jboss/example/jms/distributedtopic/DistributedTopicExample.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/src/org/jboss/example/jms/distributedtopic/ExampleListener.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/README.html
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/build.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/etc/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/etc/META-INF/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/etc/META-INF/ejb-jar.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/etc/META-INF/jboss.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/etc/jndi.properties
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/etc/log4j.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/src/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/src/org/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/src/org/jboss/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/src/org/jboss/example/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/src/org/jboss/example/jms/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/src/org/jboss/example/jms/ejb3mdb/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/src/org/jboss/example/jms/ejb3mdb/EJB3MDBExample.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/src/org/jboss/example/jms/ejb3mdb/Sender.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/examples.properties
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/README.html
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/build.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/etc/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/etc/jndi.properties
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/etc/log4j.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/etc/messaging-http-service.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/src/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/src/org/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/src/org/jboss/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/src/org/jboss/example/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/src/org/jboss/example/jms/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/src/org/jboss/example/jms/http/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/src/org/jboss/example/jms/http/HttpExample.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/README.html
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/build.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/etc/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/etc/META-INF/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/etc/META-INF/ejb-jar.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/etc/META-INF/jboss.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/etc/jndi.properties
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/etc/log4j.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/src/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/src/org/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/src/org/jboss/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/src/org/jboss/example/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/src/org/jboss/example/jms/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/src/org/jboss/example/jms/mdbfailure/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/src/org/jboss/example/jms/mdbfailure/MDBFailureExample.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/src/org/jboss/example/jms/mdbfailure/Sender.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/README.html
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/build.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/EAR-META-INF/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/EAR-META-INF/application.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/EAR-META-INF/jboss-app.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/META-INF/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/META-INF/ejb-jar.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/META-INF/jboss.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/jndi.properties
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/log4j.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/src/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/src/org/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/src/org/jboss/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/src/org/jboss/example/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/src/org/jboss/example/jms/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/src/org/jboss/example/jms/mdb/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/src/org/jboss/example/jms/mdb/MDBExample.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/src/org/jboss/example/jms/mdb/Sender.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/README.html
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/build.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/etc/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/etc/jndi.properties
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/etc/log4j.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/src/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/src/org/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/src/org/jboss/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/src/org/jboss/example/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/src/org/jboss/example/jms/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/src/org/jboss/example/jms/failover/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/src/org/jboss/example/jms/failover/QueueFailoverExample.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/README.html
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/build.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/etc/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/etc/jndi.properties
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/etc/log4j.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/src/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/src/org/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/src/org/jboss/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/src/org/jboss/example/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/src/org/jboss/example/jms/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/src/org/jboss/example/jms/queue/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/src/org/jboss/example/jms/queue/QueueExample.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/README.html
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/build.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/jndi.properties
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/log4j.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/messaging-secure-socket-service.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/messaging.keystore
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/messaging.truststore
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/src/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/src/org/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/src/org/jboss/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/src/org/jboss/example/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/src/org/jboss/example/jms/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/src/org/jboss/example/jms/securesocket/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/src/org/jboss/example/jms/securesocket/SecureSocketExample.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/README.html
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/build.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/META-INF/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/META-INF/ejb-jar.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/META-INF/jboss.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/destinations-farm-service.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/jndi.properties
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/log4j.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/bean/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/bean/StatelessClusteredSessionExample.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/bean/StatelessClusteredSessionExampleBean.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/bean/StatelessClusteredSessionExampleHome.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/client/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/client/Client.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/README.html
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/build.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/etc/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/etc/META-INF/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/etc/META-INF/ejb-jar.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/etc/META-INF/jboss.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/etc/jndi.properties
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/etc/log4j.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/bean/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/bean/StatelessSessionExample.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/bean/StatelessSessionExampleBean.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/bean/StatelessSessionExampleHome.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/client/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/client/Client.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/README.html
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/build.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/etc/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/etc/jndi.properties
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/etc/log4j.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/src/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/src/org/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/src/org/jboss/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/src/org/jboss/example/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/src/org/jboss/example/jms/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/src/org/jboss/example/jms/topic/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/src/org/jboss/example/jms/topic/ExampleListener.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/src/org/jboss/example/jms/topic/TopicExample.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/README.html
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/build.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/etc/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/etc/WEB-INF/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/etc/WEB-INF/web.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/etc/client-config/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/etc/client-config/client-config.xml
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/etc/jndi.properties
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src-client/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src-client/org/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src-client/org/jboss/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src-client/org/jboss/example/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src-client/org/jboss/example/jms/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src-client/org/jboss/example/jms/webservices/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src-client/org/jboss/example/jms/webservices/client/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src-client/org/jboss/example/jms/webservices/client/Client.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src/org/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src/org/jboss/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src/org/jboss/example/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src/org/jboss/example/jms/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src/org/jboss/example/jms/webservices/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src/org/jboss/example/jms/webservices/endpoint/
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src/org/jboss/example/jms/webservices/endpoint/WebServiceExample.java
   projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src/org/jboss/example/jms/webservices/endpoint/WebServiceExampleImpl.java
Log:
adding in new Messaging examples and User Guide for 4.3.2 in response to JBPAPP-723 and 920 


Added: projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/Makefile
===================================================================
--- projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/Makefile	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/Makefile	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,13 @@
+#Makefile for JBoss_Messaging_User_Guide
+
+XML_LANG	= en-US
+DOCNAME		= JBoss_Messaging_User_Guide
+PRODUCT		= JBoss_Enterprise_Application_Platform
+BRAND		= JBoss
+
+OTHER_LANGS	= de-DE es-ES fr-FR ja-JP pt-BR zh-CN
+TRANSLATIONS	= $(XML_LANG) $(OTHER_LANGS)
+
+COMMON_CONFIG  = /usr/share/publican
+include $(COMMON_CONFIG)/make/Makefile.common
+

Added: projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/About_This_Book.xml
===================================================================
--- projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/About_This_Book.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/About_This_Book.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="about_this_book">
+	<title>About this book</title>
+	<para>
+		The goal of this book is to give you an overview of JBoss Messaging. It explains the important features of JBoss Messaging and its capability to provide a high-performance and robust messaging system for Enterprise Java Applications.  
+	</para>
+	<para>
+		JBoss Messaging is the new state-of-the-art enterprise messaging system from JBoss, providing superior performance, reliability and scalability with high throughput and low latency. JBoss Messaging has replaced JBossMQ as the default JMS provider in JBoss Enterprise Application Platform 4.3. The version used is JBoss Messaging 1.4. You should use this version or later with the examples demonstrating JBoss Messaging. The book is not intended to teach you the basics of Enterprise Messaging. Use it to familiarize with JBoss Messaging features and various configurations.
+	</para>
+</chapter>

Added: projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Appendix.xml
===================================================================
--- projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Appendix.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Appendix.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,13 @@
+<?xml version='1.0'?>
+<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+
+<appendix id="JBoss_Messaging_User_Guide-Revision_History">
+	<appendixinfo>
+		<xi:include href="Revision_History.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	</appendixinfo>
+	<title>Revision History</title>
+	<para>
+	</para>
+</appendix>
+

Added: projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Author_Group.xml
===================================================================
--- projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Author_Group.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Author_Group.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,11 @@
+<?xml version='1.0'?>
+<!DOCTYPE authorgroup PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+
+<authorgroup>
+<author><firstname>Contributors: Tim Fox, Jeff Mesnil,
+   Andy Taylor, Clebert Suconic, Ovidiu Feodorov, Sergey Koshcheyev,
+   Ron Sigal, Madhu Konda, Jay Howell, Tyronne Wickramarathne, Aaron Walker,
+   Adrian Brock, Rajdeep Dua, Tom Elrod, Alex Fu, Juha Lindfors, Alexey
+   Loubyansky, Luc Texier, Scott Stark, Aslak Knutsen, Mark Little and Pete Bennett</firstname></author>
+</authorgroup>

Added: projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Book_Info.xml
===================================================================
--- projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Book_Info.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Book_Info.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,28 @@
+<?xml version='1.0'?>
+<!DOCTYPE bookinfo PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+
+<bookinfo id="JBoss_Messaging_User_Guide-Product_Name_and_Version">
+	<title>JBoss Messaging 1.4 User's Guide</title>
+	<subtitle>Enterprise Messaging from JBoss</subtitle>
+	<issuenum>1.4</issuenum>
+	<productnumber>0</productnumber>
+	<abstract><para>This book is about JBoss Messaging 1.4</para></abstract>
+	<corpauthor>
+		<inlinemediaobject>
+			<imageobject>
+				<imagedata format='SVG' fileref="Common_Content/images/title_logo.svg" />
+			</imageobject>
+			<textobject><phrase>Logo</phrase></textobject>
+		</inlinemediaobject>
+	</corpauthor>
+	<copyright>
+		<year>&YEAR;</year>
+		<holder>&HOLDER;</holder>
+	</copyright>
+	<xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</bookinfo>
+
+
+

Added: projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Important_Features.xml
===================================================================
--- projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Important_Features.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Important_Features.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="A_QUICK_TOUR">
+	<title>JBoss Messaging - A Quick Tour</title>
+	<section id="Limitations_of_JBossMQ">
+		<title>Limitations of JBossMQ</title>
+		<para>
+			JBossMQ has two fundamental limitations:
+			<itemizedlist>
+				<listitem>
+					<para>
+						JBossMQ is based on SpyderMQ (the open source project) which is a non-clustered broker.
+					</para>
+				</listitem>
+				<listitem>
+					<para>
+						The threading model and the overall design of the non-clustered broker leads to performance limitations in certain high load usage scenarios.
+					</para>
+				</listitem>
+			</itemizedlist>
+		</para>
+	</section>
+	<section id="JBoss_Messaging_Features">
+		<title>JBoss Messaging Features</title>
+		<para>
+			JBoss Messaging implements a high-performance and robust messaging core that is designed to support the largest and most heavily utilized Service Oriented Architectures(SOAs), Enterprise Service Buses (ESBs) and other integration needs ranging from the simplest to the highest demand networks. 
+		</para>
+		<para>
+			It will allow you to smoothly distribute your application load across your cluster, intelligently balancing and utilizing each node's CPU cycles. It comes with no single point of failure and no single point of bottleneck, sophisticated and fully configurable message expiration handling and XA transaction recovery. Thus providing a highly scalable and performant clustering implementation. It includes a JMS front-end to deliver messaging in a standards-based format as well as being designed to be able to support other messaging protocols in the future.
+		</para>
+		<note>
+			<para>
+				<emphasis>JMS compliance</emphasis>: A fully compatible and Sun certified JMS 1.1 implementation, that currently works with JBoss Enterprise Application Platform 4.3 or JBoss Application Server version 4.2 or later.
+			</para>
+		</note>
+		<para>
+			JBoss Messaging contains a host of other features, including: 
+      <itemizedlist>
+         <listitem>
+            <para>Publish-subscribe and point-to-point messaging models</para>
+         </listitem>
+         <listitem>
+            <para>Persistent and non-persistent messages</para>
+         </listitem>
+         <listitem>
+            <para>Guaranteed message delivery that ensures that messages
+            arrive once and only once where required</para>
+         </listitem>
+         <listitem>
+            <para>Transactional and reliable - supporting ACID
+            semantics</para>
+         </listitem>
+         <listitem>
+            <para>Customizable security framework based on JAAS</para>
+         </listitem>
+         <listitem>
+            <para>Fully integrated with JBoss Transactions (formerly known as
+            Arjuna JTA) for full transaction recoverability.</para>
+         </listitem>
+         <listitem>
+            <para>Extensive JMX management interface</para>
+         </listitem>
+         <listitem>
+            <para>Support for most major databases including Oracle, Sybase,
+            MS SQL Server, PostgreSQL and MySQL</para>
+         </listitem>
+         <listitem>
+            <para>HTTP transport to allow use through firewalls that only
+            allow HTTP traffic</para>
+         </listitem>
+         <listitem>
+            <para>SSL transport</para>
+         </listitem>
+         <listitem>
+            <para>Configurable DLQs (Dead Letter Queues) and Expiry
+            Queues</para>
+         </listitem>
+         <listitem>
+            <para>Message statistics: Gives you a rolling historical view of
+            what messages were delivered to what queues and
+            subscriptions</para>
+         </listitem>
+         <listitem>
+            <para>Automatic paging of messages to storage. Allows the use of
+            very large queues - too large to fit in memory at once</para>
+         </listitem>
+      </itemizedlist>
+		</para>
+	</section>
+	<section id="clustering">
+		<title>Clustering Features</title>
+		<formalpara>
+			<title>Fully clustered queues and topics</title>
+			<para>
+				"Logical" queues and topics are distributed across the cluster. You can send to a queue or a topic from any node, and receive from any other.
+			</para>
+		</formalpara>
+		<formalpara>
+			<title>Fully clustered durable subscriptions</title>
+			<para>
+				A particular durable subscription can be accessed from any node of the cluster - allowing you to spread processing load from that subscription across the cluster.
+			</para>
+		</formalpara>
+		<formalpara>
+			<title>Fully clustered temporary queues</title>
+			<para>
+				Send a message with a <literal>replyTo</literal> of a temp queue and it can be sent back on any node of the cluster.
+			</para>
+		</formalpara>
+		<formalpara>
+			<title>Intelligent message redistribution</title>
+			<para>
+				 Messages are automatically moved between different nodes of the cluster if consumers are faster on one node than another. This can help prevent starvation or build up of messages on particular nodes.
+			</para>
+		</formalpara>
+		<formalpara>
+			<title>Message order protection</title>
+			<para>
+				If you want to ensure that the order of messages produced by a producer is the same as is consumed by a consumer then you can set this to true. This works even in the presence of message redistribution.
+			</para>
+		</formalpara>
+		<formalpara>
+			<title>Fully transparent failover</title>
+			<para>
+				When a server fails, your sessions continue without exceptions on a new node as if nothing happened. (Fully configurable - If you don't want this you can fall back to exceptions being thrown and manually recreation of connections on another node)
+			</para>
+		</formalpara>
+		<formalpara>
+			<title>High availability and seamless fail-over</title>
+			<para>
+				If the node you are connected to fails, you will automatically fail over to another node and will not lose any persistent messages. You can carry on with your session seamlessly where you left off. Once and only once delivery of persistent messages is respected at all times.
+			</para>
+		</formalpara>
+		<formalpara>
+			<title>Message bridge</title>
+			<para>
+				JBoss Messaging contains a message bridge component which enables you to bridge messages between any two JMS1.1 destinations on the same or physical separate locations. (E.g. separated by a WAN). This allows you to connect geographically separate clusters, forming huge globally distributed logical queues and topics.
+			</para>
+		</formalpara>
+	</section>
+	<section id="compatibility_JBossMQ">
+		<title>Compatibility with JBossMQ</title>
+		<para>
+			Since JBoss Messaging is JMS 1.1 and JMS 1.0.2b compatible, the JMS code written against JBossMQ will run with JBoss Messaging without any changes.
+		</para>
+		<para>
+			JBoss Messaging does not have wire format compatibility with JBossMQ so it would be necessary to upgrade JBoss MQ clients with JBoss Messaging client jars.
+		</para>
+		<important>
+			<para>
+				Even if JBoss Messaging deployment descriptors are very similar to JBoss MQ deployment descriptors, they are  <emphasis>not</emphasis> identical, so they will require some simple adjustments to get them to work with JBoss Messaging. Also, the database data model is completely different, so don't attempt to use JBoss Messaging with a JBoss MQ data schema and vice-versa.
+			</para>
+		</important>
+		<note>
+			<para>
+				JBoss Messaging is built against the JBoss AS 4.2 libraries which are built using Java 5. Therefore JBoss Messaging only runs with Java 5 or later. 
+			</para>
+		</note>
+	</section>
+</chapter>

Added: projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/JBoss_Messaging_User_Guide.ent
===================================================================
--- projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/JBoss_Messaging_User_Guide.ent	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/JBoss_Messaging_User_Guide.ent	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,5 @@
+<!ENTITY JBEAP "JBoss Enterprise Application Platform">
+<!ENTITY JBEAPVERSION "4.3">
+<!ENTITY JBMVERSION "1.4.0.GA">
+<!ENTITY HOLDER "Red Hat, Inc">
+<!ENTITY YEAR "2008">

Added: projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/JBoss_Messaging_User_Guide.xml
===================================================================
--- projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/JBoss_Messaging_User_Guide.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/JBoss_Messaging_User_Guide.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,17 @@
+<?xml version='1.0'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+]>
+
+<book>
+	<xi:include href="Book_Info.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="About_This_Book.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="Important_Features.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<!--	<xi:include href="gettingstarted.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />-->
+<!--	<xi:include href="installation.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />-->
+	<xi:include href="runningexamples.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<!--	<xi:include href="c_configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> -->
+	<xi:include href="recoveryconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="bridge.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</book>

Added: projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Preface.xml
===================================================================
--- projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Preface.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Preface.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,15 @@
+<?xml version='1.0'?>
+<!DOCTYPE preface PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+
+<preface id="JBoss_Messaging_User_Guide-Preface">
+	<title>Preface</title>
+	<para>
+	</para>
+	<xi:include href="Common_Content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
+		<xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">
+			<xi:include href="Common_Content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+		</xi:fallback>
+	</xi:include>
+</preface>

Added: projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Revision_History.xml
===================================================================
--- projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Revision_History.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/Revision_History.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,20 @@
+<?xml version='1.0'?>
+<!DOCTYPE revhistory PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+
+<revhistory>
+	<revision>
+		<revnumber>1.0</revnumber>
+		<date></date>
+		<author>
+			<firstname></firstname>
+			<surname></surname>
+			<email></email>
+		</author>
+		<revdescription>
+			<simplelist>
+				<member></member>
+			</simplelist>
+		</revdescription>
+	</revision>
+</revhistory>

Added: projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/bridge.xml
===================================================================
--- projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/bridge.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/bridge.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,339 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="bridge">
+   <title>JBoss Messaging Message Bridge Configuration</title>
+   <section id="bridge.overview">
+      <title>Message bridge overview</title>
+      <para>JBoss Messaging includes a fully functional message bridge.</para>
+      <para>The function of the bridge is to consume messages from a source
+      queue or topic, and send them to a target queue or topic, typically on a
+      different server.</para>
+      <para>The source and target servers do not have to be in the same
+      cluster which makes bridging suitable for reliably sending messages from
+      one cluster to another, for instance across a WAN, and where the
+      connection may be unreliable.</para>
+      <para>A bridge is deployed inside a JBoss AS instance. The instance can
+      be the same instance as either the source or target server. Or could be
+      on a third, separate JBoss AS instance.</para>
+      <para>A bridge is deployed as an MBean inside JBoss AS. Deployment is
+      trivial - just drop the MBean descriptor into the deploy directory of a
+      JBoss configuration which contains JBoss Messaging.</para>
+      <para>An example in docs/example/bridge demonstrates a simple bridge
+      being deployed in JBoss AS, and moving messages from the source to the
+      target destination</para>
+      <para>The bridge can also be used to bridge messages from other non
+      JBoss Messaging JMS servers, as long as they are JMS 1.1
+      compliant.</para>
+      <para>The bridge has built in resilience to failure so if the source or
+      target server connetion is lost, e.g. due to network failure, the bridge
+      will retry connecting to the source and/or target until they come back
+      online. When it comes back online it will resume operation as
+      normal.</para>
+      <para>The bridge can be configured with an optional JMS selector, so it
+      will only consume messages matching that JMS selector</para>
+      <para>It can be configured to consume from a queue or a topic. When it
+      consumes from a topic it can be configured to consume using a non
+      durable or durable subscription</para>
+      <para>The bridge can be configured to bridge messages with one of three
+      levels of quality of service, they are:</para>
+      <para><itemizedlist>
+            <listitem>
+               <para>QOS_AT_MOST_ONCE</para>
+               <para>With this QoS mode messages will reach the destination
+               from the source at most once. The messages are consumed from
+               the source and acknowledged before sending to the destination.
+               Therefore there is a possibility that if failure occurs between
+               removing them from the source and them arriving at the
+               destination they could be lost. Hence delivery will occur at
+               most once. This mode is avilable for both persistent and non
+               persistent messages.</para>
+            </listitem>
+            <listitem>
+               <para>QOS_DUPLICATES_OK</para>
+               <para>With this QoS mode, the messages are consumed from the
+               source and then acknowledged after they have been successfully
+               sent to the destination. Therefore there is a possibility that
+               if failure occurs after sending to the destination but before
+               acknowledging them, they could be sent again when the system
+               recovers. I.e. the destination might receive duplicates after a
+               failure. This mode is available for both persistent and non
+               persistent messages.</para>
+            </listitem>
+            <listitem>
+               <para>QOS_ONCE_AND_ONLY_ONCE</para>
+               <para>This QoS mode ensures messages will reach the destination
+               from the source once and only once. (Sometimes this mode is
+               known as "exactly once"). If both the source and the
+               destination are on the same JBoss Messaging server instance
+               then this can be achieved by sending and acknowledging the
+               messages in the same local transaction. If the source and
+               destination are on different servers this is achieved by
+               enlisting the sending and consuming sessions in a JTA
+               transaction. The JTA transaction is controlled by JBoss
+               Transactions JTA implementation which is a fully recovering
+               transaction manager, thus providing a very high degree of
+               durability. If JTA is required then both supplied connection
+               factories need to be XAConnectionFactory implementations. This
+               mode is only available for persistent messages. This is likely
+               to be the slowest mode since it requires logging on both the
+               transaction manager and resource side for recovery. If you
+               require this level of QoS, please be sure to enable XA recovery
+               with JBoss Transactions.</para> <note>
+				<para>
+                      For a specific application it may possible to provide once and only once semantics without using the QOS_ONCE_AND_ONLY_ONCE QoS level. This can be done by using the QOS_DUPLICATES_OK mode and then checking for duplicates at the destination and discarding them. This may be possible to implement on the application level by maintaining a cache of received message ids on disk and comparing received messages to them. The cache would only be valid for a certain period of time so this approach is not as watertight as using QOS_ONCE_AND_ONLY_ONCE but may be a good choice depending on your specific application. </para>
+                  </note>
+            </listitem>
+         </itemizedlist></para>
+   </section>
+   <section id="bridge.deployment">
+      <title>Bridge deployment</title>
+      <para>A message bridge is easily deployed by dropping the MBean
+      descriptor in the deploy directory of your JBoss AS installation which
+      contains JBoss Messaging</para>
+   </section>
+   <section id="bridge.configuration">
+      <title>Bridge configuration</title>
+      <para>In this section we describe how to configure the message
+      bridge</para>
+      <para>Here is an example of a message bridge configuration, with all the
+      attributes shown. Note that some are commented out for this
+      configuration, since it is not appropriate to specify them all at once.
+      Which ones are specified depends on the configuration you want.</para>
+      <programlisting>
+   &lt;mbean code="org.jboss.jms.server.bridge.BridgeService"
+          name="jboss.messaging:service=Bridge,name=TestBridge"
+          xmbean-dd="xmdesc/Bridge-xmbean.xml"&gt;
+          
+      &lt;!-- The JMS provider loader that is used to lookup the source destination --&gt;   
+      &lt;depends optional-attribute-name="SourceProviderLoader"&gt;
+          jboss.messaging:service=JMSProviderLoader,name=JMSProvider&lt;/depends&gt;
+      
+      &lt;!-- The JMS provider loader that is used to lookup the target destination --&gt;
+      &lt;depends optional-attribute-name="TargetProviderLoader"&gt;
+          jboss.messaging:service=JMSProviderLoader,name=JMSProvider&lt;/depends&gt;    
+      
+      &lt;!-- The JNDI lookup for the source destination --&gt;
+      &lt;attribute name="SourceDestinationLookup"&gt;/queue/A&lt;/attribute&gt; 
+      
+      &lt;!-- The JNDI lookup for the target destination --&gt;
+      &lt;attribute name="TargetDestinationLookup"&gt;/queue/B&lt;/attribute&gt;
+      
+      &lt;!-- The username to use for the source connection 
+      &lt;attribute name="SourceUsername"&gt;bob&lt;/attribute&gt;
+      --&gt;
+      
+      &lt;!-- The password to use for the source connection
+      &lt;attribute name="SourcePassword"&gt;cheesecake&lt;/attribute&gt;
+      --&gt;
+      
+      &lt;!-- The username to use for the target connection
+      &lt;attribute name="TargetUsername"&gt;mary&lt;/attribute&gt;
+      --&gt;
+      
+      &lt;!-- The password to use for the target connection
+      &lt;attribute name="TargetPassword"&gt;hotdog&lt;/attribute&gt;
+      --&gt;
+      
+      &lt;!-- Optional: The Quality Of Service mode to use, one of:
+           QOS_AT_MOST_ONCE = 0;
+           QOS_DUPLICATES_OK = 1;
+           QOS_ONCE_AND_ONLY_ONCE = 2; --&gt;
+      &lt;attribute name="QualityOfServiceMode"&gt;0&lt;/attribute&gt;
+      
+      &lt;!-- JMS selector to use for consuming messages from the source
+      &lt;attribute name="Selector"&gt;specify jms selector here&lt;/attribute&gt;
+      --&gt;
+      
+      &lt;!-- The maximum number of messages to consume from the source
+          before sending to the target --&gt;
+      &lt;attribute name="MaxBatchSize"&gt;5&lt;/attribute&gt;     
+      
+      &lt;!-- The maximum time to wait (in ms) before sending a batch to the target
+          even if MaxBatchSize is not exceeded.
+           -1 means wait forever --&gt;   
+      &lt;attribute name="MaxBatchTime"&gt;-1&lt;/attribute&gt;
+      
+      &lt;!-- If consuming from a durable subscription this is the subscription name
+      &lt;attribute name="SubName"&gt;mysub&lt;/attribute&gt;
+      --&gt;
+      
+      &lt;!-- If consuming from a durable subscription this is the client ID to use
+      &lt;attribute name="ClientID"&gt;myClientID&lt;/attribute&gt;
+      --&gt;
+      
+      &lt;!-- The number of ms to wait between connection retrues in the event connections
+          to source or target fail --&gt;
+      &lt;attribute name="FailureRetryInterval"&gt;5000&lt;/attribute&gt;      
+      
+      &lt;!-- The maximum number of connection retries to make in case of failure,
+          before giving up -1 means try forever--&gt;
+      &lt;attribute name="MaxRetries"&gt;-1&lt;/attribute&gt;
+
+      &lt;!-- If true then the message id of the message before bridging will be added
+          as a header to the message so it is available to the receiver. Can then be
+          sent as correlation id to correlate in a distributed request-response --&gt;
+      &lt;attribute name="AddMessageIDInHeader"&gt;false&lt;/attribute&gt;
+      
+    &lt;/mbean&gt;
+      </programlisting>
+      <para>We will now discuss each attribute</para>
+      <section id="bridge.configuration.sourceproviderloader">
+         <title>SourceProviderLoader</title>
+         <para>This is the object name of the JMSProviderLoader MBean that the
+         bridge will use to lookup the source connection factory and source
+         destination.</para>
+         <para>By default JBoss AS ships with one JMSProviderLoader, deployed
+         in the file <filename>jms-ds.xml</filename> - this is the default
+         local JMSProviderLoader. (This would be in
+         <filename>hajndi-jms-ds.xml</filename> in a clustered
+         configuration)</para>
+         <para>If your source destination is on different servers or even
+         correspond to a different, non JBoss JMS provider, then you can
+         deploy another JMSProviderLoader MBean instance which references the
+         remote JMS provider, and reference that from this attribute. The
+         bridge would then use that remote JMS provider to contact the source
+         destination</para>
+         <para>Note that if you are using a remote non JBoss Messaging source
+         or target and you wish once and only once delivery then that remote
+         JMS provider must provide a fully functional JMS XA resource
+         implementation that works remotely from the server - it is known that
+         some non JBoss JMS providers do not provide such a resource</para>
+      </section>
+      <section id="bridge.configuration.targetproviderloader">
+         <title>TargetProviderLoader</title>
+         <para>This is the object name of the JMSProviderLoader MBean that the
+         bridge will use to lookup the target connection factory and target
+         destination.</para>
+         <para>By default JBoss AS ships with one JMSProviderLoader, deployed
+         in the file <filename>jms-ds.xml</filename> - this is the default
+         local JMSProviderLoader. (This would be in
+         <filename>hajndi-jms-ds.xml</filename> in a clustered
+         configuration)</para>
+         <para>If your target destination is on a different server or even
+         correspond to a different, non JBoss JMS provider, then you can
+         deploy another JMSProviderLoader MBean instance which references the
+         remote JMS provider, and reference that from this attribute. The
+         bridge would then use that remote JMS provider to contact the target
+         destination</para>
+         <para>Note that if you are using a remote non JBoss Messaging source
+         or target and you wish once and only once delivery then that remote
+         JMS provider must provide a fully functional JMS XA resource
+         implementation that works remotely from the server - it is known that
+         some non JBoss JMS providers do not provide such a resource</para>
+      </section>
+      <section id="bridge.configuration.sourcedestinationlookup">
+         <title>SourceDestinationLookup</title>
+         <para>This is the full JNDI lookup for the source destination using
+         the SourceProviderLoader</para>
+         <para>An example would be /queue/mySourceQueue</para>
+      </section>
+      <section id="bridge.configuration.targetdestinationlookup">
+         <title>TargetDestinationLookup</title>
+         <para>This is the full JNDI lookup for the target destination using
+         the TargetProviderLoader</para>
+         <para>An example would be /topic/myTargetTopic</para>
+      </section>
+      <section id="bridge.configuration.sourceusername">
+         <title>SourceUsername</title>
+         <para>This optional attribute is for when you need to specify the
+         username for creating the source connection</para>
+      </section>
+      <section id="bridge.configuration.sourcepassword">
+         <title>SourcePassword</title>
+         <para>This optional attribute is for when you need to specify the
+         password for creating the source connection</para>
+      </section>
+      <section id="bridge.configuration.targetusername">
+         <title>TargetUsername</title>
+         <para>This optional attribute is for when you need to specify the
+         username for creating the target connection</para>
+      </section>
+      <section id="bridge.configuration.targetpassword">
+         <title>TargetPassword</title>
+         <para>This optional attribute is for when you need to specify the
+         password for creating the target connection</para>
+      </section>
+      <section id="bridge.configuration.qualityofservicemode">
+         <title>QualityOfServiceMode</title>
+         <para>This integer represents the desired quality of service
+         mode</para>
+         <para>Possible values are: <itemizedlist>
+               <listitem>
+			<para>
+                   QOS_AT_MOST_ONCE = 0 
+			</para>
+               </listitem>
+               <listitem>
+			<para>
+                   QOS_DUPLICATES_OK = 1 
+			</para>
+               </listitem>
+               <listitem>
+			<para>
+                   QOS_ONCE_AND_ONLY_ONCE = 2 
+			</para>
+               </listitem>
+            </itemizedlist></para>
+         <para>Please see <xref linkend="bridge.overview" /> for an
+         explanation of what these mean.</para>
+      </section>
+      <section id="bridge.configuration.selector">
+         <title>Selector</title>
+         <para>This optional attribute can contain a JMS selector expression
+         used for consuming messages from the source destination. Only
+         messages that match the selector expression will be bridged from the
+         source to the target destination</para>
+         <para>Please note it is always more performant to apply selectors on
+         source topic subscriptions to source queue consumers.</para>
+         <para>The selector expression must follow the JMS selector syntax
+         specified here: <ulink
+         url="http://java.sun.com/j2ee/1.4/docs/api/javax/jms/Message.html"></ulink></para>
+      </section>
+      <section id="bridge.configuration.maxbatchsize">
+         <title>MaxBatchSize</title>
+         <para>This attribute specifies the maximum number of messages to
+         consume from the source destination before sending them in a batch to
+         the target destination. It's value must &gt;= 1</para>
+      </section>
+      <section id="bridge.configuration.maxbatchtime">
+         <title>MaxBatchTime</title>
+         <para>This attribute specifies the maximum number of milliseconds to
+         wait before sending a batch to target, even if the number of messages
+         consumed has not reached MaxBatchSize. It's value must can be -1 to
+         represent 'wait forever', or &gt;=1 to specify an actual time.</para>
+      </section>
+      <section id="bridge.configuration.subname">
+         <title>SubName</title>
+         <para>If the source destination represents a topic, and you want to
+         consume from the topic using a durable subscription then this
+         attribute represents the durable subscription name</para>
+      </section>
+      <section id="bridge.configuration.clientid">
+         <title>ClientID</title>
+         <para>If the source destination represents a topic, and you want to
+         consume from the topic using a durable subscription then this
+         attribute represents the the JMS client ID to use when
+         creating/looking up the durable subscription</para>
+      </section>
+      <section id="bridge.configuration.failureretryinterval">
+         <title>FailureRetryInterval</title>
+         <para>This represents the amount of time in ms to wait between trying
+         to recreate connections to the source or target servers when the
+         bridge has detected they have failed</para>
+      </section>
+      <section id="bridge.configuration.maxretries">
+         <title>MaxRetries</title>
+         <para>This represents the number of times to attempt to recreate
+         connections to the source or target servers when the bridge has
+         detected they have failed. The bridge will give up after trying this
+         number of times. -1 represents 'try forever'</para>
+      </section>
+      <section id="bridge.configuration.addmessageidinheader">
+         <title>AddMessageIDInHeader</title>
+         <para>If true, then the original message's message id will appended
+         in the message sent to the destination in the header
+         JBossMessage.JBOSS_MESSAGING_BRIDGE_MESSAGE_ID_LIST. If the message
+         is bridged more than once each message-id will be appended. This
+         enables a distributed request-response pattern to be used</para>
+      </section>
+   </section>
+</chapter>

Added: projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/c_configuration.xml
===================================================================
--- projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/c_configuration.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/c_configuration.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF8"?>
+<chapter id="c_configuration">
+   <title>JBoss Messaging Clustering Notes</title>
+  
+   <section id="c_conf.serverpeerid">
+	   <title>Unique server peer id</title>
+	   <para>JBoss Messaging clustering should work out of the box in most cases
+		 with no configuration changes. It is however crucial that every node is
+		 assigned a unique server id, as specified in the installation guide.</para>
+	   <para>Every node deployed must have a unique id, including those in a
+		 particular LAN cluster, and also those only linked by mesage
+		 bridges.</para>
+   </section>
+     
+   <section id="c_conf.clustereddests">   
+	<title>Clustered destinations</title>
+	<para>JBoss Messaging clusters JMS queues and topics transparently across
+		the cluster. Messages sent to a distributed queue or topic on one node are
+		consumable on other nodes. To designate that a particular destination is
+		clustered simply set the clustered attribute in the destination deployment
+		descriptor to true.</para>
+	<para>JBoss Messaging balances messages between nodes, catering for faster
+		or slower consumers to efficiently balance processing load across the
+		cluster.</para>
+	<para>If you do not want message redistribution between nodes, but still want to retain the other charactereristics
+	of clustered destinations. You can do this by not specifying the attribute ClusterPullConnectionFactoryName on the server peer
+        </para>
+   </section>
+   
+      <section id="c_conf.clustereddursubs">
+	   	<title>Clustered durable subs</title>
+	   	<para>JBoss Messaging durable subscriptions can also be clustered. This
+		   	means multiple subscribers can consume from the same durable subscription
+		   	from different nodes of the cluster. A durable subscription will be
+		   	clustered if it's topic is clustered</para>
+	      </section>
+      
+      <section id="c_conf.clusteredtempdest">
+	   	<title>Clustered temporary destinations</title>
+	   	<para>JBoss Messaging also supports clustered temporary topics and queues.
+		   	All temporary topics and queues will be clustered if the post office is
+		   	clustered</para>
+	      </section>
+   
+      <section id="c_conf.nonclusteredserver">  
+	   	<title>Non clustered servers</title>
+	   	<para>If you don't want your nodes to participate in a cluster, or only
+		   	have one non clustered server you can set the clustered attribute on the
+		   	postoffice to false</para>
+	      </section>
+      
+      
+      <section id="c_conf.orderingincluster">
+	   	<title>Message ordering in the cluster</title>
+	   	<para>If you wish to apply strict JMS ordering to messages, such that a
+		   	particular JMS consumer consumes messages in the same order as they were
+		   	produced by a particular producer, you can set the DefaultPreserveOrdering
+		   	attribute in the server peer to true. By default this is false. The
+		   	sideeffect of setting this to true is that messages cannot be distributed
+		   	as freely around the cluster</para>
+	      </section>
+   
+   	   
+      <section id="c_conf.idempotentops">	
+	   	<title>Idempotent operations</title>
+	   	<para>If the call to send a persistent message to a persistent destination
+		   	returns successfully with no exception, then you can be sure that the
+		   	message was persisted. However if the call doesn't return successfully e.g.
+		   	if an exception is thrown, then you *can't be sure the message wasn't
+		   	persisted*. Since the failure might have occurred after persisting the
+		   	message but before writing the response to the caller. This is a common
+		   	attribute of any RPC type call: You can't tell by the call not returning
+		   	that the call didn't actually succeed. Whether it's a web services call, an
+		   	HTTP get request, an ejb invocation the same applies. The trick is to code
+		   	your application so your operations are *idempotent*  i.e. they can be
+		   	repeated without getting the system into an inconsistent state. With a
+		   	message system you can do this on the application level, by checking for
+		   	duplicate messages, and discarding them if they arrive. Duplicate checking
+		   	is a very powerful technique that can remove the need for XA transactions
+		   	in many cases.</para>
+		<para>In the clustered case. JBM is by default configured to detect duplicate automatically messages by default</para>
+	      </section>
+      
+      
+      <section id="c_conf.clusteredcfs">
+	   	<title>Clustered connection factories</title>
+	   	<para>If the supportsLoadBalancing attribute of the connection factory is set to true then consecutive create connection attempts will round robin between available servers. The first node to try is chosen randomly</para>
+	   	<para>If the supportsFailover attribute of the connection factory is set to true then automatic failover is enabled.
+		   	This will automatically failover from one server to another, transparently to the user, in case of failure.</para>
+	           <para>If automatic failover is not required or you wish to do manual failover (JBoss MQ style) this can be set to false, and you can supply a standard JMS ExceptionListener on the connection which will be called in case of
+		   	connection failure. You would then need to manually close the connection, lookup a new connection factory from
+		   	HA JNDI and recreate the connection.</para>
+	   	
+   </section>
+   
+   
+</chapter>
\ No newline at end of file

Added: projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/configuration.xml
===================================================================
--- projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/configuration.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/configuration.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,2022 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<chapter id="configuration">
+   <title>Configuration</title>
+   <para>The JMS API specifies how a messaging client interacts with a
+   messaging server. The exact definition and implementation of messaging
+   services, such as message destinations and connection factories, are
+   specific to JMS providers. JBoss Messaging has its own configuration files
+   to configure services. If you are migrating services from JBossMQ (or other
+   JMS provider) to JBoss Messaging, you will need to understand those
+   configuration files.</para>
+   <para>In this chapter, we discuss how to configure various services inside
+   JBoss Messaging, which work together to provide JMS API level services to
+   client applications.</para>
+   <para>The JBoss Messaging service configuration is spread among several
+   configuration files. Depending on the functionality provided by the
+   services it configures, the configuration data is distributed between
+   <filename>messaging-service.xml</filename>,
+   <filename>remoting-bisocket-service.xml</filename>,
+   <filename>xxx-persistence-service.xml</filename> (where xx is the name of
+   your databse) , <filename>connection-factories-service.xml</filename> and
+   <filename>destinations-service.xml</filename>.</para>
+   <para>The AOP client-side and server-side interceptor stacks are configured
+   in <filename>aop-messaging-client.xml</filename> and
+   <filename>aop-messaging-server.xml</filename>. Normally you will not want
+   to change them, but some of the interceptors can be removed to give a small
+   performance increase, if you don't need them. Be very careful you have
+   considered the security implications before removing the security
+   interceptor.</para>
+   <section id="conf.serverpeer">
+      <title>Configuring the ServerPeer</title>
+      <para>The Server Peer is the heart of the JBoss Messaging JMS facade.
+      The server's configuration, resides in
+      <filename>messaging-service.xml</filename> configuration file.</para>
+      <para>All JBoss Messaging services are rooted at the server peer</para>
+      <para>An example of a Server Peer configuration is presented below. Note
+      that not all values for the server peer's attributes are specified in
+      the example</para>
+      <programlisting>&lt;mbean code="org.jboss.jms.server.ServerPeer"
+      name="jboss.messaging:service=ServerPeer"
+      xmbean-dd="xmdesc/ServerPeer-xmbean.xml"&gt;
+
+      &lt;!-- The unique id of the server peer - in a cluster each node MUST have a unique value - must be an integer --&gt;
+
+      &lt;attribute name="ServerPeerID"&gt;0&lt;/attribute&gt;
+      
+      &lt;!-- The default JNDI context to use for queues when they are deployed without specifying one --&gt; 
+      
+      &lt;attribute name="DefaultQueueJNDIContext"&gt;/queue&lt;/attribute&gt;
+      
+      &lt;!-- The default JNDI context to use for topics when they are deployed without specifying one --&gt; 
+      
+      &lt;attribute name="DefaultTopicJNDIContext"&gt;/topic&lt;/attribute&gt;
+
+	     &lt;attribute name="PostOffice"&gt;jboss.messaging:service=PostOffice&lt;/attribute&gt;
+	  
+	     &lt;!-- The JAAS security domain to use for JBoss Messaging --&gt;
+	  
+      &lt;attribute name="SecurityDomain"&gt;java:/jaas/messaging&lt;/attribute&gt;
+      
+      &lt;!-- The default security configuration to apply to destinations - this can be overridden on a per destination basis --&gt;
+      
+      &lt;attribute name="DefaultSecurityConfig"&gt;
+        &lt;security&gt;
+            &lt;role name="guest" read="true" write="true" create="true"/&gt;
+        &lt;/security&gt;
+      &lt;/attribute&gt;
+      
+      &lt;!-- The default Dead Letter Queue (DLQ) to use for destinations.
+           This can be overridden on a per destinatin basis --&gt;
+      
+      &lt;attribute name="DefaultDLQ"&gt;jboss.messaging.destination:service=Queue,name=DLQ&lt;/attribute&gt;
+      
+      &lt;!-- The default maximum number of times to attempt delivery of a message before sending to the DLQ (if configured).
+           This can be overridden on a per destinatin basis --&gt;
+      
+      &lt;attribute name="DefaultMaxDeliveryAttempts"&gt;10&lt;/attribute&gt;
+      
+      &lt;!-- The default Expiry Queue to use for destinations. This can be overridden on a per destinatin basis --&gt;
+      
+      &lt;attribute name="DefaultExpiryQueue"&gt;jboss.messaging.destination:service=Queue,name=ExpiryQueue&lt;/attribute&gt;
+      
+      &lt;!-- The default redelivery delay to impose. This can be overridden on a per destination basis --&gt;
+      
+      &lt;attribute name="DefaultRedeliveryDelay"&gt;0&lt;/attribute&gt;
+      
+      &lt;!-- The periodicity of the message counter manager enquiring on queues for statistics --&gt;
+      
+      &lt;attribute name="MessageCounterSamplePeriod"&gt;5000&lt;/attribute&gt;
+      
+      &lt;!-- The maximum amount of time for a client to wait for failover to start on the server side after
+           it has detected failure --&gt;
+      
+      &lt;attribute name="FailoverStartTimeout"&gt;60000&lt;/attribute&gt;
+      
+      &lt;!-- The maximum amount of time for a client to wait for failover to complete on the server side after
+           it has detected failure --&gt;
+      
+      &lt;attribute name="FailoverCompleteTimeout"&gt;300000&lt;/attribute&gt;
+      
+      &lt;!-- The maximum number of days results to maintain in the message counter history --&gt;
+      
+      &lt;attribute name="DefaultMessageCounterHistoryDayLimit"&gt;-1&lt;/attribute&gt;
+      
+      &lt;!-- The name of the connection factory to use for creating connections between nodes to pull messages --&gt;
+      
+      &lt;attribute name="ClusterPullConnectionFactoryName"&gt;jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory&lt;/attribute&gt;
+      
+      &lt;!-- When redistributing messages in the cluster. Do we need to preserve the order of messages received
+            by a particular consumer from a particular producer? --&gt;
+            
+      &lt;attribute name="DefaultPreserveOrdering"&gt;false&lt;/attribute&gt;
+      
+      &lt;!-- Max. time to hold previously delivered messages back waiting for clients to reconnect after failover --&gt;
+      
+      &lt;attribute name="RecoverDeliveriesTimeout"&gt;300000&lt;/attribute&gt;
+      
+      &lt;attribute name="EnableMessageCounters"&gt;false&lt;/attribute&gt;           
+      
+      &lt;!-- The password used by the message sucker connections to create connections.
+           THIS SHOULD ALWAYS BE CHANGED AT INSTALL TIME TO SECURE SYSTEM
+      &lt;attribute name="SuckerPassword"&gt;&lt;/attribute&gt;
+      --&gt;
+
+      &lt;depends optional-attribute-name="PersistenceManager"&gt;jboss.messaging:service=PersistenceManager&lt;/depends&gt;
+      
+      &lt;depends optional-attribute-name="JMSUserManager"&gt;jboss.messaging:service=JMSUserManager&lt;/depends&gt;
+      
+      &lt;depends&gt;jboss.messaging:service=Connector,transport=bisocket&lt;/depends&gt;
+
+   &lt;/mbean&gt;
+      </programlisting>
+      <section id="conf.serverpeer.attributes">
+         <title>ServerPeer attributes</title>
+         <para>We now discuss the MBean attributes of the ServerPeer
+         MBean.</para>
+         <formalpara>
+            <title>ServerPeerID</title>
+            <para>The unique id of the server peer. Every node you deploy MUST
+            have a unique id. This applies whether the different nodes form a
+            cluster, or are only linked via a message bridge. The id must be a
+            valid integer.</para>
+         </formalpara>
+	 <formalpara>
+            <title>DefaultQueueJNDIContext</title>
+            <para>The default JNDI context to use when binding queues.
+            Defaults to /queue.</para>
+	</formalpara>
+	<formalpara>
+            <title>DefaultTopicJNDIContext</title>
+            <para>The default JNDI context to use when binding topics.wa
+            Defaults to /topic.</para>
+	</formalpara>
+	<formalpara>
+            <title>PostOffice</title>
+            <para>This is the post office that the ServerPeer uses. You will
+            not normally need to change this attribute. The post office is
+            responsible for routing messages to queues and maintaining the
+            mapping between addresses and queues.</para>
+	</formalpara>
+	<formalpara>
+            <title>SecurityDomain</title>
+            <para>The JAAS security domain to be used by this server
+            peer</para>
+	</formalpara>
+	<formalpara>
+            <title>DefaultSecurityConfig</title>
+            <para>Default security configuration is used when the security
+            configuration for a specific queue or topic has not been
+            overridden in the destination's deployment descriptor. It has
+            exactly the same syntax and semantics as in JBossMQ.</para>
+	</formalpara>
+            <para>The <literal>DefaultSecurityConfig</literal> attribute
+            element should contain one <literal>&lt;security&gt;</literal>
+            element. The <literal>&lt;security&gt;</literal> element can
+            contain multiple <literal>&lt;role&gt;</literal> elements. Each
+            <literal>&lt;role&gt;</literal> element defines the default access
+            for that particular role.</para>
+            <para>If the <literal>read</literal> attribute is
+            <literal>true</literal> then that role will be able to read
+            (create consumers, receive messaages or browse) destinations by
+            default.</para>
+            <para>If the <literal>write</literal> attribute is
+            <literal>true</literal> then that role will be able to write
+            (create producers or send messages) to destinations by
+            default.</para>
+            <para>If the <literal>create</literal> attribute is
+            <literal>true</literal> then that role will be able to create
+            durable subscriptions on topics by default.</para>
+    	<formalpara>
+            <title>DefaultDLQ</title>
+            <para>This is the name of the default DLQ (Dead Letter Queue) the
+            server peer will use for destinations. The DLQ can be overridden
+            on a per destination basis - see the destination MBean
+            configuration for more details. A DLQ is a special destination
+            where messages are sent when the server has attempted to deliver
+            them unsuccessfully more than a certain number of times. If the
+            DLQ is not specified at all then the message will be removed after
+            the maximum number of delivery attempts. The maximum number of
+            delivery attempts can be specified using the attribute
+            DefaultMaxDeliveryAttempts for a global default or individually on
+            a per destination basis.</para>
+	</formalpara>
+	<formalpara>
+            <title>DefaultMaxDeliveryAttempts</title>
+            <para>The default for the maximum number of times delivery of a
+            message will be attempted before sending the message to the DLQ,
+            if configured.</para>
+	</formalpara>
+            <para>The default value is <literal>10</literal>.</para>
+            <para>This value can also be overridden on a per destination
+            basis.</para>
+   	<formalpara>
+            <title>DefaultExpiryQueue</title>
+            <para>This is the name of the default expiry queue the server peer
+            will use for destinations. The expiry can be overridden on a per
+            destination basis - see the destination MBean configuration for
+            more details. An expiry queue is a special destination where
+            messages are sent when they have expired. Message expiry is
+            determined by the value of Message::getJMSExpiration() If the
+            expiry queue is not specified at all then the message will be
+            removed after it is expired.</para>
+	</formalpara>
+	<formalpara>
+            <title>DefaultRedeliveryDelay</title>
+            <para>When redelivering a message after failure of previous
+            delivery it is often beneficial to introduce a delay perform
+            redelivery in order to prevent thrashing of delivery-failure,
+	    delivery-failure etc</para></formalpara>
+            <para>The default value is <literal>0</literal> which means there
+            will be no delay.</para>
+            <para>Change this if your application could benefit with a delay
+            before redelivery. This value can also be overridden on a per
+            destination basis.</para>
+	<formalpara>
+            <title>MessageCounterSamplePeriod</title>
+            <para>Periodically the server will query each queue to gets its
+            statistics. This is the period.</para>
+	</formalpara>
+            <para>The default value is <literal>10000</literal>
+            milliseconds.</para>
+   	<formalpara>
+            <title>FailoverStartTimeout</title>
+            <para>The maximum number of milliseconds the client will wait for
+            failover to start on the server side when a problem is
+            detected.</para>
+	</formalpara>
+            <para>The default value is <literal>60000</literal> (one
+            minute).</para>
+
+	<formalpara>
+            <title>FailoverCompleteTimeout</title>
+            <para>The maximum number of milliseconds the client will wait for
+            failover to complete on the server side after it has
+	    started.</para>	</formalpara>
+            <para>The default value is <literal>300000</literal> (five
+            minutes).</para>
+	<formalpara>
+            <title>DefaultMessageCounterHistoryDayLimit</title>
+            <para>JBoss Messaging provides a message counter history which
+            shows the number of messages arriving on each queue of a certain
+            number of days. This attribute represents the maxiumum number of
+            days for which to store message counter history. It can be
+            overridden on a per destination basis.</para>
+	</formalpara>
+	<formalpara>
+            <title>ClusterPullConnectionFactory</title>
+            <para>The name of the connection factory to use for pulling
+		    messages between nodes. </para>	</formalpara>
+            <para>If you wish to turn off message sucking between queues altogether, but retain failover, then you can ommit this attribute
+            altogether</para>
+	<formalpara>
+            <title>DefaultPreserveOrdering</title>
+            <para>If true, then strict JMS ordering is preserved in the
+            cluster. See the cluster configurations section for more details.
+            Default is false.</para>
+	</formalpara>
+	<formalpara>
+            <title>RecoverDeliveriesTimeout</title>
+            <para>When failover occurs, already delivered messages will be
+            kept aside, waiting for clients to reconnect. In the case that
+            clients never reconnect (e.g. the client is dead) then eventually
+            these messages will timeout and be added back to the queue. The
+            value is in ms. The default is 5 mins.</para>
+	</formalpara>
+	<formalpara>
+            <title>EnableMessageCounters</title>		 
+	    <para>Set this to true to enable message counters when the server starts</para>
+   	 </formalpara>	 
+	 
+    	<formalpara>
+            <title>SuckerPassword</title>
+            <para>JBoss Messaging internally makes connections between nodes
+            in order to redistribute messages between clustered destinations.
+            These connections are made with the user name of a special
+            reserved user. The password used by that user is specified by this
+            parameter. </para>
+	</formalpara>
+<warning>
+<para>
+                   This must be specified at install time, or the default password will be used. Any one who then knows the default password will be able to gain access to any destinations on the server. This value MUST be changed at install time. 
+</para>
+               </warning>
+	       <formalpara>
+            <title>StrictTCK</title>
+            <para>Set to true if you want strict JMS TCK semantiocs</para>
+   	 </formalpara>
+	 <formalpara>
+            <title>Destinations</title>
+            <para>Returns a list of the destinations (queues and topics)
+            currently deployed.</para>
+</formalpara>
+<formalpara>
+            <title>MessageCounters</title>
+            <para>JBoss Messaging provides a message counter for each
+            queue.</para>
+</formalpara>
+<formalpara>
+            <title>MessageCountersStatistics</title>
+            <para>JBoss Messaging provides statistics for each message counter
+            for each queue.</para>
+</formalpara>
+<formalpara>
+            <title>SupportsFailover</title>
+            <para>Set to false to prevent server side failover occurring in a
+            cluster when a node crashes.</para>
+</formalpara>
+<formalpara>
+            <title>PersistenceManager</title>
+            <para>This is the persistence manager that the ServerPeer uses.
+            You will not normally need to change this attribute.</para>
+</formalpara>
+<formalpara>
+            <title>JMSUserManager</title>
+            <para>This is the JMS user manager that the ServerPeer uses. You
+            will not normally need to change this attribute.</para>
+</formalpara>
+</section>
+         <section id="conf.serverpeer.operations">
+            <title>We now discuss the MBean operations of the ServerPeer
+            MBean.</title>
+    <formalpara>
+               <title>DeployQueue</title>
+               <para>This operation lets you programmatically deploy a
+		       queue.</para></formalpara>
+               <para>There are two overloaded versions of this
+               operation</para>
+               <para>If the queue already exists but is undeployed it is
+               deployed. Otherwise it is created and deployed.</para>
+               <para>The <literal>name</literal> parameter represents the name
+               of the destination to deploy.</para>
+               <para>The <literal>jndiName</literal> parameter (optional)
+               represents the full jndi name where to bind the destination. If
+               this is not specified then the destination will be bound in
+               &lt;DefaultQueueJNDIContext&gt;/&lt;name&gt;.</para>
+               <para>The first version of this operation deploys the
+               destination with the default paging parameters. The second
+               overloaded version deploys the destination with the specified
+               paging parameters. See the section on configuring destinations
+               for a discussion of what the paging parameters mean.</para>
+       <formalpara>
+               <title>UndeployQueue</title>
+               <para>This operation lets you programmatically undeploy a
+		       queue.</para></formalpara>
+               <para>The queue is undeployed but is NOT removed from
+               persistent storage.</para>
+               <para>This operation returns <literal>true</literal> if the
+               queue was successfull undeployed. otherwise it returns
+               <literal>false</literal>.</para>
+       <formalpara>
+               <title>DestroyQueue</title>
+               <para>This operation lets you programmatically destroy a
+		       queue.</para></formalpara>
+               <para>The queue is undeployed and then all its data is
+               destroyed from the database.</para>
+               <warning>
+			<para>
+                   Be careful when using this method since it will delete all data for the queue. 
+			</para>
+               </warning>
+               <para>This operation returns <literal>true</literal> if the
+               queue was successfully destroyed. otherwise it returns
+               <literal>false</literal>.</para>
+       <formalpara>
+               <title>DeployTopic</title>
+               <para>This operation lets you programmatically deploy a
+		       topic.</para></formalpara>
+               <para>There are two overloaded versions of this
+               operation.</para>
+               <para>If the topic already exists but is undeployed it is
+               deployed. Otherwise it is created and deployed.</para>
+               <para>The <literal>name</literal> parameter represents the name
+               of the destination to deploy.</para>
+               <para>The <literal>jndiName</literal> parameter (optional)
+               represents the full jndi name where to bind the destination. If
+               this is not specified then the destination will be bound in
+               &lt;DefaultTopicJNDIContext&gt;/&lt;name&gt;.</para>
+               <para>The first version of this operation deploys the
+               destination with the default paging parameters. The second
+               overloaded version deploys the destination with the specified
+               paging parameters. See the section on configuring destinations
+               for a discussion of what the paging parameters mean.</para>
+       <formalpara>
+               <title>UndeployTopic</title>
+               <para>This operation lets you programmatically undeploy a
+		       topic.</para></formalpara>
+               <para>The queue is undeployed but is NOT removed from
+               persistent storage.</para>
+               <para>This operation returns <literal>true</literal> if the
+               topic was successfully undeployed. otherwise it returns
+               <literal>false</literal>.</para>
+       <formalpara>
+               <title>DestroyTopic</title>
+               <para>This operation lets you programmatically destroy a
+		       topic.</para></formalpara>
+               <para>The topic is undeployed and then all its data is
+               destroyed from the database.</para>
+               <warning>
+			<para>
+                   Be careful when using this method since it will delete all data for the topic. 
+			</para>
+               </warning>
+               <para>This operation returns <literal>true</literal> if the
+               topic was successfully destroyed. otherwise it returns
+               <literal>false</literal>.</para>
+       <formalpara>
+               <title>ListMessageCountersHTML</title>
+               <para>This operation returns message counters in an easy to
+               display HTML format.</para>
+</formalpara>
+<formalpara>
+               <title>ResetAllMesageCounters</title>
+               <para>This operation resets all message counters to
+               zero.</para>
+</formalpara>
+<formalpara>
+               <title>ResetAllMesageCounters</title>
+               <para>This operation resets all message counter histories to
+               zero.</para>
+</formalpara>
+<formalpara>
+               <title>EnableMessageCounters</title>
+               <para>This operation enables all message counters for all
+               destinations. Message counters are disabled by default.</para>
+</formalpara>
+<formalpara>
+               <title>DisableMessageCounters</title>
+               <para>This operation disables all message counters for all
+               destinations. Message counters are disabled by default.</para>
+</formalpara>
+<formalpara>
+               <title>RetrievePreparedTransactions</title>
+               <para>Retrieves a list of the Xids for all transactions
+               currently in a prepared state on the node.</para>
+</formalpara>
+<formalpara>
+               <title>ShowPreparedTransactions</title>
+               <para>Retrieves a list of the Xids for all transactions
+               currently in a prepared state on the node in an easy to display
+               HTML format.</para>
+</formalpara>
+      </section>
+   </section>
+   <section id="conf.changingds">
+      <title>Changing the Database</title>
+      <para>Several JBoss Messaging services interact with persistent storage.
+      They include: The Persistence Manager, The PostOffice and the JMS User
+      Manager. The Persistence Manager is used to handle the message-related
+      persistence. The Post Office handles binding related persistence. The
+      JMS User manager handles user related persistence The configuration for
+      all these MBeans is handled in the
+      <filename>xxx-persistence-service.xml</filename> file.</para>
+      <para>If the database you want to switch to is one of MySQL, Oracle,
+      PostgreSQL, MS SQL Sever or Sybase, persistence configuration files are
+      already available in the <filename>examples/config</filename> directory
+      of the release bundle.</para>
+      <para>In order to enable support for one of these databases, just
+      replace the default <filename>hsqldb-persistence-service.xml</filename>
+      configuration file with the database-specific configuration file and
+      restart the server.</para>
+      <para>Also, be aware that by default, the Messaging services relying on
+      a datastore are referencing <literal>"java:/DefaultDS"</literal> for the
+      datasource. If you are deploying a datasource with a different JNDI
+      name, you need to update all the <literal>DataSource</literal> attribute
+      in the persistence configuration file. Example data source
+      configurations for each of the popular databases are available in the
+      distribution.</para>
+   </section>
+   <section id="conf.postoffice">
+      <title>Configuring the Post office</title>
+      <para>It is the job of the post office to route messages to their
+      destination(s).</para>
+      <para>The post office maintains the mappings between addresses to which
+      messages can be sent and their final queues.</para>
+      <para>For example when sending a message with an address that represents
+      a JMS queue name, the post office will route this to a single queue -
+      the JMS queue. When sending a message with an address that repesents a
+      JMS topic name, the post office will route this to a set of queues - one
+      for each JMS subscription.</para>
+      <para>The post office also handles the persistence for the mapping of
+      addresses.</para>
+      <para>JBoss Messaging post-offices are also cluster aware. In a cluster
+      they will automatically route and pull messages between them in order to
+      provide fully distributed JMS queues and topics.</para>
+      <para>The post office configuration is found in the
+      xxx-persistence-service.xml file (where xxx is the name of your
+      database).</para>
+      <para>Here is an example of a post office configuration:</para>
+      <programlisting>
+   &lt;mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
+      name="jboss.messaging:service=PostOffice"
+      xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml"&gt;
+      
+      &lt;depends optional-attribute-name="ServerPeer"&gt;jboss.messaging:service=ServerPeer&lt;/depends&gt;
+                
+      &lt;depends&gt;jboss.jca:service=DataSourceBinding,name=DefaultDS&lt;/depends&gt;
+      
+      &lt;depends optional-attribute-name="TransactionManager"&gt;jboss:service=TransactionManager&lt;/depends&gt;
+      
+      &lt;!-- The name of the post office --&gt;                  
+      
+      &lt;attribute name="PostOfficeName"&gt;JMS post office&lt;/attribute&gt;
+      
+      &lt;!-- The datasource used by the post office to access it's binding information --&gt;                     
+      
+      &lt;attribute name="DataSource"&gt;java:/DefaultDS&lt;/attribute&gt;
+      
+      &lt;!-- If true will attempt to create tables and indexes on every start-up --&gt;
+                        
+      &lt;attribute name="CreateTablesOnStartup"&gt;true&lt;/attribute&gt;
+      
+      &lt;!-- If true then we will automatically detect and reject duplicate messages sent during failover --&gt;
+      
+      &lt;attribute name="DetectDuplicates"&gt;true&lt;/attribute&gt;
+      
+      &lt;!-- The size of the id cache to use when detecting duplicate messages --&gt;
+      
+      &lt;attribute name="IDCacheSize"&gt;500&lt;/attribute&gt;
+                  
+      &lt;attribute name="SqlProperties"&gt;&lt;![CDATA[
+CREATE_POSTOFFICE_TABLE=CREATE TABLE JBM_POSTOFFICE (POSTOFFICE_NAME VARCHAR(255), NODE_ID INTEGER, QUEUE_NAME VARCHAR(255), COND VARCHAR(1023), SELECTOR VARCHAR(1023), CHANNEL_ID BIGINT, CLUSTERED CHAR(1), ALL_NODES CHAR(1), PRIMARY KEY(POSTOFFICE_NAME, NODE_ID, QUEUE_NAME)) ENGINE = INNODB
+INSERT_BINDING=INSERT INTO JBM_POSTOFFICE (POSTOFFICE_NAME, NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED, ALL_NODES) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
+DELETE_BINDING=DELETE FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=? AND QUEUE_NAME=?
+LOAD_BINDINGS=SELECT QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED, ALL_NODES FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=?
+      ]]&gt;&lt;/attribute&gt;
+      
+      &lt;!-- This post office is clustered. If you don't want a clustered post office then set to false --&gt;
+      
+      &lt;attribute name="Clustered"&gt;true&lt;/attribute&gt;
+      
+      &lt;!-- 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 --&gt;
+      
+      &lt;!-- The JGroups group name that the post office will use --&gt;            
+      
+      &lt;attribute name="GroupName"&gt;${jboss.messaging.groupname:MessagingPostOffice}&lt;/attribute&gt;
+      
+      &lt;!-- Max time to wait for state to arrive when the post office joins the cluster --&gt;            
+                  
+      &lt;attribute name="StateTimeout"&gt;5000&lt;/attribute&gt;
+      
+      &lt;!-- Max time to wait for a synchronous call to node members using the MessageDispatcher --&gt;            
+                  
+      &lt;attribute name="CastTimeout"&gt;50000&lt;/attribute&gt;
+      
+      &lt;!-- Set this to true if you want failover of connections to occur when a node is shut down --&gt;
+      
+      &lt;attribute name="FailoverOnNodeLeave"&gt;false&lt;/attribute&gt;
+            
+      
+      &lt;!-- JGroups stack configuration for the data channel - used for sending data across the cluster --&gt; 
+                   
+      &lt;!-- By default we use the TCP stack for data --&gt;                  
+      &lt;attribute name="DataChannelConfig"&gt;      
+         &lt;config&gt;
+            &lt;TCP start_port="7900"
+                 loopback="true"
+                 recv_buf_size="20000000"
+                 send_buf_size="640000"
+                 discard_incompatible_packets="true"
+                 max_bundle_size="64000"
+                 max_bundle_timeout="30"
+                 use_incoming_packet_handler="true"
+                 use_outgoing_packet_handler="false"
+                 down_thread="false" up_thread="false"
+                 enable_bundling="false"
+                 use_send_queues="false"
+                 sock_conn_timeout="300"
+                 skip_suspected_members="true"/&gt;
+            &lt;MPING timeout="4000"
+		         bind_to_all_interfaces="true"
+		         mcast_addr="${jboss.messaging.datachanneludpaddress:228.6.6.6}"
+		         mcast_port="${jboss.messaging.datachanneludpport:45567}"
+		         ip_ttl="8"
+		         num_initial_members="2"
+		         num_ping_requests="1"/&gt;                     
+            &lt;MERGE2 max_interval="100000"
+                    down_thread="false" up_thread="false" min_interval="20000"/&gt;
+            &lt;FD_SOCK down_thread="false" up_thread="false"/&gt;            
+            &lt;VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/&gt;
+            &lt;pbcast.NAKACK max_xmit_size="60000"
+                           use_mcast_xmit="false" gc_lag="0"
+                           retransmit_timeout="300,600,1200,2400,4800"
+                           down_thread="false" up_thread="false"
+                           discard_delivered_msgs="true"/&gt;
+            &lt;pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+                           down_thread="false" up_thread="false"
+                           max_bytes="400000"/&gt;
+            &lt;pbcast.GMS print_local_addr="true" join_timeout="3000"
+                        down_thread="false" up_thread="false"
+                        join_retry_timeout="2000" shun="false"
+                        view_bundling="true"/&gt;
+        &lt;/config&gt;        
+      &lt;/attribute&gt;
+      
+      &lt;!-- JGroups stack configuration to use for the control channel - used for control messages --&gt;         
+              
+      &lt;!-- We use udp stack for the control channel --&gt;
+      &lt;attribute name="ControlChannelConfig"&gt;
+         &lt;config&gt;
+            &lt;UDP
+                 mcast_addr="${jboss.messaging.controlchanneludpaddress:228.7.7.7}"
+                 mcast_port="${jboss.messaging.controlchanneludpport:45568}"
+                 tos="8"
+                 ucast_recv_buf_size="20000000"
+                 ucast_send_buf_size="640000"
+                 mcast_recv_buf_size="25000000"
+                 mcast_send_buf_size="640000"
+                 loopback="false"
+                 discard_incompatible_packets="true"
+                 max_bundle_size="64000"
+                 max_bundle_timeout="30"
+                 use_incoming_packet_handler="true"
+                 use_outgoing_packet_handler="false"
+                 ip_ttl="2"
+                 down_thread="false" up_thread="false"
+                 enable_bundling="false"/&gt;
+            &lt;PING timeout="2000"
+                  down_thread="false" up_thread="false" num_initial_members="3"/&gt;
+            &lt;MERGE2 max_interval="100000"
+                    down_thread="false" up_thread="false" min_interval="20000"/&gt;
+            &lt;FD_SOCK down_thread="false" up_thread="false"/&gt;
+            &lt;FD timeout="10000" max_tries="5" down_thread="false" up_thread="false" shun="true"/&gt;
+            &lt;VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/&gt;
+            &lt;pbcast.NAKACK max_xmit_size="60000"
+                           use_mcast_xmit="false" gc_lag="0"
+                           retransmit_timeout="300,600,1200,2400,4800"
+                           down_thread="false" up_thread="false"
+                           discard_delivered_msgs="true"/&gt;
+            &lt;UNICAST timeout="300,600,1200,2400,3600"
+                     down_thread="false" up_thread="false"/&gt;
+            &lt;pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+                           down_thread="false" up_thread="false"
+                           max_bytes="400000"/&gt;
+            &lt;pbcast.GMS print_local_addr="true" join_timeout="3000" use_flush="true" flush_timeout="3000"
+                        down_thread="false" up_thread="false"
+                        join_retry_timeout="2000" shun="false"
+                        view_bundling="true"/&gt;
+            &lt;FRAG2 frag_size="60000" down_thread="false" up_thread="false"/&gt;
+            &lt;pbcast.STATE_TRANSFER down_thread="false" up_thread="false" use_flush="true" flush_timeout="3000"/&gt;
+            &lt;pbcast.FLUSH down_thread="false" up_thread="false" timeout="20000" auto_flush_conf="false"/&gt;
+        &lt;/config&gt;
+     &lt;/attribute&gt;	   
+      
+   &lt;/mbean&gt;
+      </programlisting>
+      <section id="conf.postoffice.attributes">
+         <title>The post office has the following attributes</title>
+         <formalpara>
+            <title>DataSource</title>
+            <para>The datasource the postoffice should use for persisting its
+            mapping data.</para>
+</formalpara>
+<formalpara>
+            <title>SQLProperties</title>
+            <para>This is where the DDL and DML for the particular database is
+            specified. If a particular DDL or DML statement is not overridden,
+            the default Hypersonic configuration will be used for that
+            statement.</para>
+</formalpara>
+<formalpara>
+            <title>CreateTablesOnStartup</title>
+            <para>Set this to <literal>true</literal> if you wish the post
+            office to attempt to create the tables (and indexes) when it
+            starts. If the tables (or indexes) already exist a
+            <literal>SQLException</literal> will be thrown by the JDBC driver
+            and ignored by the Persistence Manager, allowing it to
+	    continue.</para></formalpara>
+            <para>By default the value of
+            <literal>CreateTablesOnStartup</literal> attribute is set to
+            <literal>true</literal></para>
+    <formalpara>
+            <title>DetectDuplicates</title>
+	    <para>Set this to <literal>true</literal> if you wish the post office detect duplicate messages
+			 that may sent when a send is retried on a different node after server failure.
+		 </para>	</formalpara>	 
+            <para>By default the value of <literal>DetectDuplicates</literal>
+	          attribute is set to <literal>true</literal></para>
+	  <formalpara>
+	    <title>IDCacheSize</title>
+	
+	    <para>If duplicate detection is enabled. (See <literal>DetectDuplicates</literal>), then the server will rememeber the last
+		<literal>n</literal> message ids
+		sent, to prevent duplicate messages sent after failover has occurred. The value of <literal>n</literal> is determined by this attribute.
+	</para></formalpara>
+	
+	    <para>By default the value of <literal>IDCacheSize</literal>
+		attribute is set to <literal>500</literal></para>	 
+	<formalpara>
+            <title>PostOfficeName</title>
+            <para>The name of the post office.</para>
+    </formalpara>
+    <formalpara>
+            <title>NodeIDView</title>
+            <para>This returns set containing the node ids of all the nodes in
+            the cluster.</para>
+</formalpara>
+<formalpara>
+            <title>GroupName</title>
+            <para>All post offices in the cluster with the same group name
+            will form a cluster together. Make sure the group name matches
+            with all the nodes in the cluster you want to form a cluster
+            with.</para>
+</formalpara>
+<formalpara>
+            <title>Clustered</title>
+            <para>If true the post office will take part in a cluster to form
+            distributed queues and topics. If false then it will not
+            participate in the cluster. If false, then all the cluster related
+            attributes will be ignored.</para>
+</formalpara>
+<formalpara>
+            <title>StateTimeout</title>
+            <para>The maximum time to wait when waiting for the group state to
+		    arrive when a node joins a pre-existing cluster.</para></formalpara>
+            <para>The default value is <literal>5000</literal>
+            milliseconds.</para>
+    <formalpara>
+            <title>CastTimeout</title>
+            <para>The maximum time to wait for a reply casting message
+		    synchronously.</para></formalpara>
+            <para>The default value is <literal>5000</literal>
+            milliseconds.</para>
+    <formalpara>
+            <title>FailoverOnNodeLeave</title>		 
+	    <para>If this attribute is <literal>true</literal> then if a server node is shut down cleanly, then this will cause any
+		    connections on the shutting down node to failover onto another node.</para></formalpara>		 
+	     <para>The default value for this is attribute is <literal>false</literal></para>				  
+	     <formalpara>
+            <title>MaxConcurrentReplications</title>
+            <para>The maximum number of concurrent replication requests to
+            make before blocking for replies to come back. This prevents us
+            overwhelming JGroups. This is rarely a good reason to change
+	    this.</para></formalpara>
+            <para>The default value is <literal>50</literal></para>
+	    <formalpara>
+            <title>ControlChannelConfig</title>
+            <para>JBoss Messaging uses JGroups for all group management. This
+            contains the JGroups stack configuration for the control
+	    channel.</para></formalpara>
+            <para>The control channel is used for sending request/receiving
+            responses from other nodes in the cluster</para>
+            <para>The details of the JGroups configuration won't be discussed
+            here since it is standard JGroups configuration. Detailed
+            information on JGroups can be found in JGroups release
+            documentation or on-line at <ulink
+            url="http://www.jgroups.org">http://www.jgroups.org</ulink> or
+            <ulink
+            url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups">http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups</ulink>.</para>
+
+    <formalpara>
+            <title>DataChannelConfig</title>
+            <para>JBoss Messaging uses JGroups for all group management. This
+            contains the JGroups stack configuration for the data
+	    channel.</para></formalpara>
+            <para>The data channel is used for sending sending/receiving
+            messages from other nodes in the cluster and for replicating
+            session data.</para>
+            <para>The details of the JGroups configuration won't be discussed
+            here since it is standard JGroups configuration. Detailed
+            information on JGroups can be found in JGroups release
+            documentation or on-line at <ulink
+            url="http://www.jgroups.org">http://www.jgroups.org</ulink> or
+            <ulink
+            url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups">http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups</ulink>.</para>
+      </section>
+   </section>
+   <section id="conf.persistencemanager">
+      <title>Configuring the Persistence Manager</title>
+      <para>It is the job of the persistence manager to manage all message
+      related persistence.</para>
+      <para>JBoss Messaging ships with a JDBC Persistence Manager used for
+      handling persistence of message data in a relational database accessed
+      via JDBC. The Persistence Manager implementation is pluggable (the
+      Persistence Manager is a Messaging server plug-in), this making possible
+      to provide other implementations for persisting message data in non
+      relational stores, file stores etc.</para>
+      <para>The configuration of "persistent" services is grouped in a
+      <filename>xxx-persistence-service.xml</filename> file, where xxx
+      corresponds to the database name. By default, Messaging ships with a
+      <filename>hsqldb-persistence-service.xml</filename>, which configures
+      the Messaging server to use the in-VM Hypersonic database instance that
+      comes by default with any JBossAS instance.</para>
+      <warning>
+         <para>The default Persistence Manager configuration is works out of
+         the box with Hypersonic, however it must be stressed that Hypersonic
+         should not be used in a production environment mainly due to its
+         limited support for transaction isolation and its propensity to
+         behave erratically under high load.</para>
+         <para>The <ulink
+         url="http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigJBossMQDB">Critique
+         of Hypersonic</ulink> wiki page outlines some of the well-known
+         issues occuring when using this database.</para>
+      </warning>
+      <para>JBoss Messaging also ships with pre-made Persistence Manager
+      configurations for MySQL, Oracle, PostgreSQL, Sybase and MS SQL Server.
+      The example <filename>mysql-persistence-service.xml</filename>,
+       <filename>ndb-persistence-service.xml</filename>,
+      <filename>oracle-persistence-service.xml</filename>,
+      <filename>postgres-persistence-service.xml</filename> and
+      <filename>sybase-persistence-service.xml</filename> and
+      <filename>mssql-persistence-service.xml</filename> configuration files
+      are available in the <filename>examples/config</filename> directory of
+      the release bundle.</para>
+      <para>Users are encouraged to contribute their own configuration files
+      where we will thoroughly test them before certifying them for suppported
+      use with JBoss Messaging. The JDBC Persistence Manager has been designed
+      to use standard SQL for the DML so writing a JDBC Persistence Manager
+      configuration for another database is usually only a fairly simple
+      matter of changing DDL in the configuration which is likely to be
+      different for different databases.</para>
+      <para>JBoss Messaging also ships with a Null Persistence Manager config - this can be used when you don't want any persistence at all.
+      </para>
+      <para>The default Hypersonic persistence configuration file is listed
+      below:</para>
+      <programlisting>
+	 &lt;mbean code="org.jboss.messaging.core.jmx.JDBCPersistenceManagerService"
+      name="jboss.messaging:service=PersistenceManager"
+      xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml"&gt;
+      
+      &lt;depends&gt;jboss.jca:service=DataSourceBinding,name=DefaultDS&lt;/depends&gt;
+      
+      &lt;depends optional-attribute-name="TransactionManager"&gt;jboss:service=TransactionManager&lt;/depends&gt;
+      
+      &lt;!-- The datasource to use for the persistence manager --&gt;
+                    
+      &lt;attribute name="DataSource"&gt;java:/DefaultDS&lt;/attribute&gt;      
+      
+      &lt;!-- If true will attempt to create tables and indexes on every start-up --&gt;
+                  
+      &lt;attribute name="CreateTablesOnStartup"&gt;true&lt;/attribute&gt;
+      
+      &lt;!-- If true then will use JDBC batch updates --&gt;
+                  
+      &lt;attribute name="UsingBatchUpdates"&gt;true&lt;/attribute&gt;
+      
+      &lt;attribute name="SqlProperties"&gt;&lt;![CDATA[
+   CREATE_DUAL=CREATE TABLE JBM_DUAL (DUMMY INTEGER, PRIMARY KEY (DUMMY)) ENGINE = INNODB
+   CREATE_MESSAGE_REFERENCE=CREATE TABLE JBM_MSG_REF (CHANNEL_ID BIGINT, MESSAGE_ID BIGINT, TRANSACTION_ID BIGINT, STATE CHAR(1), ORD BIGINT, PAGE_ORD BIGINT, DELIVERY_COUNT INTEGER, SCHED_DELIVERY BIGINT, PRIMARY KEY(CHANNEL_ID, MESSAGE_ID)) ENGINE = INNODB
+   CREATE_IDX_MESSAGE_REF_TX=CREATE INDEX JBM_MSG_REF_TX ON JBM_MSG_REF (TRANSACTION_ID)
+   CREATE_IDX_MESSAGE_REF_ORD=CREATE INDEX JBM_MSG_REF_ORD ON JBM_MSG_REF (ORD)
+   CREATE_IDX_MESSAGE_REF_PAGE_ORD=CREATE INDEX JBM_MSG_REF_PAGE_ORD ON JBM_MSG_REF (PAGE_ORD)
+   CREATE_IDX_MESSAGE_REF_MESSAGE_ID=CREATE INDEX JBM_MSG_REF_MESSAGE_ID ON JBM_MSG_REF (MESSAGE_ID)
+   CREATE_IDX_MESSAGE_REF_SCHED_DELIVERY=CREATE INDEX JBM_MSG_REF_SCHED_DELIVERY ON JBM_MSG_REF (SCHED_DELIVERY)
+   CREATE_MESSAGE=CREATE TABLE JBM_MSG (MESSAGE_ID BIGINT, RELIABLE CHAR(1), EXPIRATION BIGINT, TIMESTAMP BIGINT, PRIORITY TINYINT, TYPE TINYINT, HEADERS MEDIUMBLOB, PAYLOAD LONGBLOB, PRIMARY KEY (MESSAGE_ID)) ENGINE = INNODB
+   CREATE_IDX_MESSAGE_TIMESTAMP=CREATE INDEX JBM_MSG_REF_TIMESTAMP ON JBM_MSG (TIMESTAMP)
+   CREATE_TRANSACTION=CREATE TABLE JBM_TX (NODE_ID INTEGER, TRANSACTION_ID BIGINT, BRANCH_QUAL VARBINARY(254), FORMAT_ID INTEGER, GLOBAL_TXID VARBINARY(254), PRIMARY KEY (TRANSACTION_ID)) ENGINE = INNODB
+   CREATE_COUNTER=CREATE TABLE JBM_COUNTER (NAME VARCHAR(255), NEXT_ID BIGINT, PRIMARY KEY(NAME)) ENGINE = INNODB
+   INSERT_DUAL=INSERT INTO JBM_DUAL VALUES (1)
+   CHECK_DUAL=SELECT 1 FROM JBM_DUAL
+   INSERT_MESSAGE_REF=INSERT INTO JBM_MSG_REF (CHANNEL_ID, MESSAGE_ID, TRANSACTION_ID, STATE, ORD, PAGE_ORD, DELIVERY_COUNT, SCHED_DELIVERY) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
+   DELETE_MESSAGE_REF=DELETE FROM JBM_MSG_REF WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
+   UPDATE_MESSAGE_REF=UPDATE JBM_MSG_REF SET TRANSACTION_ID=?, STATE='-' WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
+   UPDATE_PAGE_ORDER=UPDATE JBM_MSG_REF SET PAGE_ORD = ? WHERE MESSAGE_ID=? AND CHANNEL_ID=?
+   COMMIT_MESSAGE_REF1=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='+'
+   COMMIT_MESSAGE_REF2=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='-'
+   ROLLBACK_MESSAGE_REF1=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='+'
+   ROLLBACK_MESSAGE_REF2=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='-'
+   LOAD_PAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, PAGE_ORD, SCHED_DELIVERY FROM JBM_MSG_REF WHERE CHANNEL_ID = ? AND PAGE_ORD BETWEEN ? AND ? ORDER BY PAGE_ORD
+   LOAD_UNPAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? AND PAGE_ORD IS NULL ORDER BY ORD
+   LOAD_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? ORDER BY ORD     
+   UPDATE_REFS_NOT_PAGED=UPDATE JBM_MSG_REF SET PAGE_ORD = NULL WHERE PAGE_ORD BETWEEN ? AND ? AND CHANNEL_ID=?
+   SELECT_MIN_MAX_PAGE_ORD=SELECT MIN(PAGE_ORD), MAX(PAGE_ORD) FROM JBM_MSG_REF WHERE CHANNEL_ID = ?
+   SELECT_EXISTS_REF_MESSAGE_ID=SELECT MESSAGE_ID FROM JBM_MSG_REF WHERE MESSAGE_ID = ?
+   UPDATE_DELIVERY_COUNT=UPDATE JBM_MSG_REF SET DELIVERY_COUNT = ? WHERE CHANNEL_ID = ? AND MESSAGE_ID = ?
+   UPDATE_CHANNEL_ID=UPDATE JBM_MSG_REF SET CHANNEL_ID = ? WHERE CHANNEL_ID = ?
+   LOAD_MESSAGES=SELECT MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, HEADERS, PAYLOAD, TYPE FROM JBM_MSG
+   INSERT_MESSAGE=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, HEADERS, PAYLOAD) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
+   INSERT_MESSAGE_CONDITIONAL=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INST_TIME) SELECT ?, ?, ?, ?, ?, ?, ? FROM JBM_DUAL WHERE NOT EXISTS (SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ?)
+   UPDATE_MESSAGE_4CONDITIONAL=UPDATE JBM_MSG SET HEADERS=?, PAYLOAD=? WHERE MESSAGE_ID=?
+   INSERT_MESSAGE_CONDITIONAL_FULL=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, HEADERS, PAYLOAD) SELECT ?, ?, ?, ?, ?, ?, ?, ? FROM JBM_DUAL WHERE NOT EXISTS (SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ?)   
+   MESSAGE_ID_COLUMN=MESSAGE_ID   
+   DELETE_MESSAGE=DELETE FROM JBM_MSG WHERE MESSAGE_ID = ? AND NOT EXISTS (SELECT * FROM JBM_MSG_REF WHERE JBM_MSG_REF.MESSAGE_ID = ?)      
+   INSERT_TRANSACTION=INSERT INTO JBM_TX (NODE_ID, TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID) VALUES(?, ?, ?, ?, ?)
+   DELETE_TRANSACTION=DELETE FROM JBM_TX WHERE NODE_ID = ? AND TRANSACTION_ID = ?
+   SELECT_PREPARED_TRANSACTIONS=SELECT TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID FROM JBM_TX WHERE NODE_ID = ?
+   SELECT_MESSAGE_ID_FOR_REF=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '+' ORDER BY ORD
+   SELECT_MESSAGE_ID_FOR_ACK=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '-' ORDER BY ORD
+   UPDATE_COUNTER=UPDATE JBM_COUNTER SET NEXT_ID = ? WHERE NAME=?
+   SELECT_COUNTER=SELECT NEXT_ID FROM JBM_COUNTER WHERE NAME=? FOR UPDATE
+   INSERT_COUNTER=INSERT INTO JBM_COUNTER (NAME, NEXT_ID) VALUES (?, ?)
+   SELECT_ALL_CHANNELS=SELECT DISTINCT(CHANNEL_ID) FROM JBM_MSG_REF
+   UPDATE_TX=UPDATE JBM_TX SET NODE_ID=? WHERE NODE_ID=?
+      ]]&gt;&lt;/attribute&gt;
+      
+      &lt;!-- The maximum number of parameters to include in a prepared statement --&gt;
+                  
+      &lt;attribute name="MaxParams"&gt;500&lt;/attribute&gt;
+         
+      &lt;attribute name="UseNDBFailoverStrategy"&gt;true&lt;/attribute&gt;
+
+   &lt;/mbean&gt;
+	  
+	   </programlisting>
+      <section id="conf.persistencemanager.attributes">
+         <title>We now discuss the MBean attributes of the PersistenceManager
+         MBean</title>
+ <formalpara>
+            <title>CreateTablesOnStartup</title>
+            <para>Set this to <literal>true</literal> if you wish the
+            Persistence Manager to attempt to create the tables (and indexes)
+            when it starts. If the tables (or indexes) already exist a
+            <literal>SQLException</literal> will be thrown by the JDBC driver
+            and ignored by the Persistence Manager, allowing it to
+	    continue.</para></formalpara>
+            <para>By default the value of
+            <literal>CreateTablesOnStartup</literal> attribute is set to
+            <literal>true</literal></para>
+         <formalpara>
+            <title>UsingBatchUpdates</title>
+            <para>Set this to <literal>true</literal> if the database supports
+            JDBC batch updates. The JDBC Persistence Manager will then group
+	    multiple database updates in batches to aid performance.</para></formalpara>
+            <para>By default the value of <literal>UsingBatchUpdates</literal>
+            attribute is set to <literal>false</literal></para>
+    <formalpara>
+            <title>UsingBinaryStream</title>
+            <para>Set this to <literal>true</literal> if you want messages to
+            be store and read using a JDBC binary stream rather than using
+            getBytes(), setBytes(). Some database has limits on the maximum
+            number of bytes that can be get/set using
+	    getBytes()/setBytes().</para></formalpara>
+            <para>By default the value of <literal>UsingBinaryStream</literal>
+            attribute is set to <literal>true</literal></para>
+    <formalpara>
+            <title>UsingTrailingByte</title>
+            <para>Certain version of Sybase are known to truncate blobs if
+            they have trailing zeros. To prevent this if this attribute is set
+            to <literal>true</literal> then a trailing non zero byte will be
+            added and removed to each blob before and after persistence to
+            prevent the database from truncating it. Currently this is only
+	    known to be necessary for Sybase.</para></formalpara>
+            <para>By default the value of <literal>UsingTrailingByte</literal>
+            attribute is set to <literal>false</literal></para>
+    <formalpara>
+            <title>SupportsBlobOnSelect</title>
+            <para>Oracle (and possibly other databases) is known to not allow
+            BLOBs to be inserted using a INSERT INTO ... SELECT FROM
+            statement, and requires a two stage conditional insert of
+            messages. If this value is false then such a two stage insert will
+	    be used.</para></formalpara>
+            <para>By default the value of
+            <literal>SupportsBlobOnSelect</literal> attribute is set to
+            <literal>true</literal></para>
+    <formalpara>
+            <title>SQLProperties</title>
+            <para>This is where the DDL and DML for the particular database is
+            specified. If a particular DDL or DML statement is not overridden,
+            the default Hypersonic configuration will be used for that
+            statement.</para>
+</formalpara>
+<formalpara>
+            <title>MaxParams</title>
+            <para>When loading messages the persistence manager will generate
+            prepared statements with many parameters. This value tells the
+            persistence manager what the absolute maximum number of parameters
+	    are allowable per prepared statement.</para></formalpara>
+            <para>By default the value of <literal>MaxParams</literal>
+            attribute is set to <literal>100</literal></para>
+
+    <formalpara>
+         <title>UseNDBFailoverStrategy</title>
+          <para>When running in a clustered database environment it is possible that some databases,
+             MySQL for instance, can fail during the commit of a database transaction. This can happen
+             if the database node dies whilst committing meaning that the final state of the transaction is
+             unknown. If this attribute is set to true and the above happens then the SQL statement will be
+             re-executed, however if there is a further error an assumption is made that this is because the
+             previous transaction committed successfully and the error is ignored.
+     </para></formalpara>
+
+          <para>By default the value of <literal>UseNDBFailoverStrategy</literal> attribute
+          is set to <literal>false</literal></para>
+      </section>
+      <!-- end conf.persistencemanager.attributes -->
+   </section>
+   <!-- end conf.persistencemanager -->
+   <section id="conf.jmsusermanager">
+      <title>Configuring the JMS user manager</title>
+      <para>The JMS user manager handles the mapping of pre-configured client
+      IDs to users and also managers the user and role tables which may or may
+      not be used depending on which login module you have configured</para>
+      <para>Here is an example JMSUserManager configuration</para>
+      <programlisting>
+   &lt;mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
+      name="jboss.messaging:service=JMSUserManager"
+      xmbean-dd="xmdesc/JMSUserManager-xmbean.xml"&gt;
+      &lt;depends&gt;jboss.jca:service=DataSourceBinding,name=DefaultDS&lt;/depends&gt;
+      &lt;depends optional-attribute-name="TransactionManager"&gt;
+               jboss:service=TransactionManager
+      &lt;/depends&gt;
+      &lt;attribute name="DataSource"&gt;java:/DefaultDS&lt;/attribute&gt;
+      &lt;attribute name="CreateTablesOnStartup"&gt;true&lt;/attribute&gt;
+      &lt;attribute name="SqlProperties"&gt;&lt;![CDATA[
+               CREATE_USER_TABLE=CREATE TABLE JBM_USER (USER_ID VARCHAR(32) NOT NULL,
+               PASSWD VARCHAR(32) NOT NULL, CLIENTID VARCHAR(128),
+               PRIMARY KEY(USER_ID)) ENGINE = INNODB
+               CREATE_ROLE_TABLE=CREATE TABLE JBM_ROLE (ROLE_ID VARCHAR(32) NOT NULL,
+               USER_ID VARCHAR(32) NOT NULL, PRIMARY KEY(USER_ID, ROLE_ID))
+               ENGINE = INNODB
+               SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JBM_USER WHERE USER_ID=?
+               POPULATE.TABLES.1=INSERT INTO JBM_USER (USER_ID,PASSWD,CLIENTID)
+               VALUES ('dilbert','dogbert','dilbert-id')
+      ]]&gt;&lt;/attribute&gt;
+   &lt;/mbean&gt;
+           </programlisting>
+      <section id="conf.jmsusermanager.attributes">
+         <title>We now discuss the MBean attributes of the JMSUserManager
+         MBean</title>
+ <formalpara>
+            <title>CreateTablesOnStartup</title>
+            <para>Set this to <literal>true</literal> if you wish the JMS user
+            manager to attempt to create the tables (and indexes) when it
+            starts. If the tables (or indexes) already exist a
+            <literal>SQLException</literal> will be thrown by the JDBC driver
+            and ignored by the Persistence Manager, allowing it to
+	    continue.</para></formalpara>
+            <para>By default the value of
+            <literal>CreateTablesOnStartup</literal> attribute is set to
+            <literal>true</literal></para>
+    <formalpara>
+            <title>UsingBatchUpdates</title>
+            <para>Set this to <literal>true</literal> if the database supports
+            JDBC batch updates. The JDBC Persistence Manager will then group
+	    multiple database updates in batches to aid performance.</para></formalpara>
+            <para>By default the value of <literal>UsingBatchUpdates</literal>
+            attribute is set to <literal>false</literal></para>
+    <formalpara>
+            <title>SQLProperties</title>
+            <para>This is where the DDL and DML for the particular database is
+            specified. If a particular DDL or DML statement is not overridden,
+            the default Hypersonic configuration will be used for that
+	    statement.</para></formalpara>
+            <para>Default user and role data can also be specified here. Any
+            data to be inserted must be specified with property names starting
+            with <literal>POPULATE.TABLES</literal> as in the above
+            example.</para>
+      </section>
+      <!-- end conf.jmsusermanager.attributes -->
+   </section>
+   <!-- end.conf.jmsusermanager -->
+   <section id="conf.destination">
+      <title>Configuring Destinations</title>
+      <section id="conf.destinations.preconf">
+         <title>Pre-configured destinations</title>
+         <para>JBoss Messaging ships with a default set of pre-configured
+         destinations that will be deployed during the server start up. The
+         file that contains configuration for these destinations is
+         <filename>destinations-service.xml</filename>. A section of this file
+         is listed below:</para>
+         <programlisting>
+   &lt;!--
+      The Default Dead Letter Queue. This destination is a dependency of an EJB MDB container.
+   --&gt;
+
+   &lt;mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=DLQ"
+      xmbean-dd="xmdesc/Queue-xmbean.xml"&gt;
+      &lt;depends optional-attribute-name="ServerPeer"&gt;
+                  jboss.messaging:service=ServerPeer
+      &lt;/depends&gt;
+      &lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;
+   &lt;/mbean&gt;
+
+
+   &lt;mbean code="org.jboss.jms.server.destination.TopicService"
+      name="jboss.messaging.destination:service=Topic,name=testTopic"
+      xmbean-dd="xmdesc/Topic-xmbean.xml"&gt;
+      &lt;depends optional-attribute-name="ServerPeer"&gt;
+                  jboss.messaging:service=ServerPeer
+      &lt;/depends&gt;
+      &lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;
+      &lt;attribute name="SecurityConfig"&gt;
+         &lt;security&gt;
+            &lt;role name="guest" read="true" write="true"/&gt;
+            &lt;role name="publisher" read="true" write="true" create="false"/&gt;
+            &lt;role name="durpublisher" read="true" write="true" create="true"/&gt;
+         &lt;/security&gt;
+      &lt;/attribute&gt;
+   &lt;/mbean&gt;
+
+   &lt;mbean code="org.jboss.jms.server.destination.TopicService"
+      name="jboss.messaging.destination:service=Topic,name=securedTopic"
+      xmbean-dd="xmdesc/Topic-xmbean.xml"&gt;
+      &lt;depends optional-attribute-name="ServerPeer"&gt;
+                  jboss.messaging:service=ServerPeer
+      &lt;/depends&gt;
+      &lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;
+      &lt;attribute name="SecurityConfig"&gt;
+         &lt;security&gt;
+            &lt;role name="publisher" read="true" write="true" create="false"/&gt;
+         &lt;/security&gt;
+      &lt;/attribute&gt;
+   &lt;/mbean&gt;
+
+
+   &lt;mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=testQueue"
+      xmbean-dd="xmdesc/Queue-xmbean.xml"&gt;
+      &lt;depends optional-attribute-name="ServerPeer"&gt;
+                  jboss.messaging:service=ServerPeer
+      &lt;/depends&gt;
+      &lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;
+      &lt;attribute name="SecurityConfig"&gt;
+         &lt;security&gt;
+            &lt;role name="guest" read="true" write="true"/&gt;
+            &lt;role name="publisher" read="true" write="true" create="false"/&gt;
+            &lt;role name="noacc" read="false" write="false" create="false"/&gt;
+         &lt;/security&gt;
+      &lt;/attribute&gt;
+   &lt;/mbean&gt;
+
+   &lt;mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=A"
+      xmbean-dd="xmdesc/Queue-xmbean.xml"&gt;
+      &lt;depends optional-attribute-name="ServerPeer"&gt;
+                  jboss.messaging:service=ServerPeer
+      &lt;/depends&gt;
+      &lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;
+   &lt;/mbean&gt;
+
+
+   &lt;!-- It's possible for indiviual queues and topics to use a specific queue for
+   an expiry or DLQ --&gt;
+
+   &lt;mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=PrivateDLQ"
+      xmbean-dd="xmdesc/Queue-xmbean.xml"&gt;
+      &lt;depends optional-attribute-name="ServerPeer"&gt;
+                  jboss.messaging:service=ServerPeer
+      &lt;/depends&gt;
+      &lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;
+   &lt;/mbean&gt;
+
+   &lt;mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue"
+      xmbean-dd="xmdesc/Queue-xmbean.xml"&gt;
+      &lt;depends optional-attribute-name="ServerPeer"&gt;
+                  jboss.messaging:service=ServerPeer
+      &lt;/depends&gt;
+      &lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;
+   &lt;/mbean&gt;
+
+   &lt;mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=QueueWithOwnDLQAndExpiryQueue"
+      xmbean-dd="xmdesc/Queue-xmbean.xml"&gt;
+      &lt;depends optional-attribute-name="ServerPeer"&gt;
+                  jboss.messaging:service=ServerPeer
+      &lt;/depends&gt;
+      &lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;
+      &lt;attribute name="DLQ"&gt;
+                  jboss.messaging.destination:service=Queue,name=PrivateDLQ
+      &lt;/attribute&gt;
+      &lt;attribute name="ExpiryQueue"&gt;
+                  jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue
+      &lt;/attribute&gt;
+   &lt;/mbean&gt;
+
+   &lt;mbean code="org.jboss.jms.server.destination.TopicService"
+      name="jboss.messaging.destination:service=Topic,name=TopicWithOwnDLQAndExpiryQueue"
+      xmbean-dd="xmdesc/Topic-xmbean.xml"&gt;
+      &lt;depends optional-attribute-name="ServerPeer"&gt;
+                  jboss.messaging:service=ServerPeer
+      &lt;/depends&gt;
+      &lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;
+      &lt;attribute name="DLQ"&gt;
+                  jboss.messaging.destination:service=Queue,name=PrivateDLQ
+      &lt;/attribute&gt;
+      &lt;attribute name="ExpiryQueue"&gt;
+                  jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue
+      &lt;/attribute&gt;
+   &lt;/mbean&gt;
+
+
+   &lt;mbean code="org.jboss.jms.server.destination.TopicService"
+      name="jboss.messaging.destination:service=Topic,name=TopicWithOwnRedeliveryDelay"
+      xmbean-dd="xmdesc/Topic-xmbean.xml"&gt;
+      &lt;depends optional-attribute-name="ServerPeer"&gt;
+                  jboss.messaging:service=ServerPeer
+      &lt;/depends&gt;
+      &lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;
+      &lt;attribute name="RedeliveryDelay"&gt;5000&lt;/attribute&gt;
+   &lt;/mbean&gt;
+
+
+   &lt;mbean code="org.jboss.jms.server.destination.TopicService"
+      name="jboss.messaging.destination:service=Topic,name=testDistributedTopic"
+      xmbean-dd="xmdesc/Topic-xmbean.xml"&gt;
+      &lt;depends optional-attribute-name="ServerPeer"&gt;
+                  jboss.messaging:service=ServerPeer
+      &lt;/depends&gt;
+      &lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;
+      &lt;attribute name="Clustered"&gt;true&lt;/attribute&gt;
+   &lt;/mbean&gt;
+....
+              </programlisting>
+      </section>
+
+      <!-- end conf.preconf.destinations -->
+      <section id="conf.destination.queue">
+         <title>Configuring queues</title>
+	 <para>This section will discuss the configuration of queues.</para>
+         <section id="conf.destination.queue.attributes">
+            <title>Queue MBean attributes</title>
+	    <para>We now discuss the attributes of the Queue MBean</para>
+	    <formalpara>
+               <title>Name</title>
+               <para>The name of the queue</para>
+       </formalpara>
+       <formalpara>
+               <title>JNDIName</title>
+               <para>The JNDI name where the queue is bound</para>
+       </formalpara>
+       <formalpara>
+               <title>DLQ</title>
+               <para>The DLQ used for this queue. Overrides any value set on
+               the ServerPeer config</para>
+</formalpara>
+<formalpara>
+               <title>ExpiryQueue</title>
+               <para>The Expiry queue used for this queue. Overrides any value
+               set on the ServerPeer config</para>
+</formalpara>
+<formalpara>
+               <title>RedeliveryDelay</title>
+               <para>The redelivery delay to be used for this queue. Overrides
+               any value set on the ServerPeer config</para>
+</formalpara>
+<formalpara>
+               <title>MaxDeliveryAttempts</title>
+               <para>The maximum number of times delivery of a message will be
+               attempted before sending the message to the DLQ, if configured.
+               If set to -1 (the default), the value from the ServerPeer
+               config is used. Any other setting overrides the value set on
+               the ServerPeer config.</para>
+</formalpara>
+<formalpara>
+               <title>Destination Security Configuration</title>
+               <para><literal>SecurityConfig</literal> - allows you to
+               determine which roles are allowed to read, write and create on
+               the destination. It has exactly the same syntax and semantics
+	       as the security configuration in JBossMQ destinations.</para></formalpara>
+               <para>The <literal>SecurityConfig</literal> element should
+               contain one <literal>&lt;security&gt;</literal> element. The
+               <literal>&lt;security&gt;</literal> element can contain
+               multiple <literal>&lt;role&gt;</literal> elements. Each
+               <literal>&lt;role&gt;</literal> element defines the access for
+               that particular role.</para>
+               <para>If the <literal>read</literal> attribute is
+               <literal>true</literal> then that role will be able to read
+               (create consumers, receive messaages or browse) this
+               destination.</para>
+               <para>If the <literal>write</literal> attribute is
+               <literal>true</literal> then that role will be able to write
+               (create producers or send messages) to this destination.</para>
+               <para>If the <literal>create</literal> attribute is
+               <literal>true</literal> then that role will be able to create
+               durable subscriptions on this destination.</para>
+               <para>Note that the security configuration for a destination is
+               optional. If a <literal>SecurityConfig</literal> element is not
+               specifed then the default security configuration from the
+               Server Peer will be used.</para>
+
+       <formalpara>
+               <title>Destination paging parameters</title>
+               <para>'Pageable Channels' are a sophisticated new feature
+		       available in JBoss Messaging.</para></formalpara>
+               <para>If your application needs to support very large queues or
+               subscriptions containing potentially millions of messages, then
+               it's not possible to store them all in memory at once.</para>
+               <para>JBoss Messaging solves this problem but letting you
+               specify the maximum number of messages that can be stored in
+               memory at any one time, on a queue-by-queue, or topic-by-topic
+               basis. JBoss Messaging then pages messages to and from storage
+               transparently in blocks, allowing queues and subscriptions to
+               grow to very large sizes without any performance degradation as
+               channel size increases.</para>
+               <para>This has been tested with in excess of 10 million 2K
+               messages on very basic hardware and has the potential to scale
+               to much larger number of messages.</para>
+               <para>The individual parameters are:</para>
+               <para><literal>FullSize</literal> - this is the maximum number
+               of messages held by the queue or topic subscriptions in memory
+               at any one time. The actual queue or subscription can hold many
+               more messages than this but these are paged to and from storage
+               as necessary as messages are added or consumed.</para>
+               <para><literal>PageSize</literal> - When loading messages from
+               the queue or subscrition this is the maximum number of messages
+               to pre-load in one operation.</para>
+               <para><literal>DownCacheSize</literal> - When paging messages
+               to storage from the queue they first go into a "Down Cache"
+               before being written to storage. This enables the write to
+               occur as a single operation thus aiding performance. This
+               setting determines the max number of messages that the Down
+               Cache will hold before they are flushed to storage.</para>
+               <para>If no values for <literal>FullSize</literal>,
+               <literal>PageSize</literal>, or
+               <literal>DownCacheSize</literal> are specified they will
+               default to values 75000, 2000, 2000 respectively.</para>
+               <para>If you want to specify the paging parameters used for
+               temporary queues then you need to specify them on the
+               appropriate connection factory. See connection factory
+               configuration for details.</para>
+
+       <formalpara>
+               <title>CreatedProgrammatically</title>
+               <para>Returns <literal>true</literal> if the queue was created
+               programmatically</para>
+</formalpara>
+<formalpara>
+               <title>MessageCount</title>
+               <para>Returns the total number of messages in the queue =
+               number not being delivered + number being delivered + number
+               being scheduled</para>
+</formalpara>
+<formalpara>
+               <title>ScheduledMessageCount</title>
+               <para>Returns the number of scheduled messages in the queue.
+               This is the number of messages scheduled to be delivered at a
+	       later date.</para></formalpara>
+               <para>Scheduled delivery is a feature of JBoss Messaging where
+               you can send a message and specify the earliest time at which
+               it will be delivered. E.g. you can send a message now, but the
+               message won't actually be delivered until 2 hours time.</para>
+               <para>To do this, you just need to set the following header in
+               the message before sending:</para>
+               <programlisting>
+              
+              long now = System.currentTimeMillis();
+         
+              Message msg = sess.createMessage();  
+                  
+              msg.setLongProperty(JBossMessage.JMS_JBOSS_SCHEDULED_DELIVERY_PROP_NAME,
+                     now + 1000 * 60 * 60 * 2);
+              
+              prod.send(msg);
+                            
+                 </programlisting>
+
+		 <formalpara>
+               <title>MaxSize</title>
+               <para>A maximum size (in number of messages) can be specified
+               for a queue. Any messages that arrive beyond this point will be
+               dropped. The default is <literal>-1</literal> which is
+               unbounded.</para>
+</formalpara>
+<formalpara>
+               <title>Clustered</title>
+               <para>Clustered destinations must have this set to
+               <literal>true</literal>.</para>
+</formalpara>
+<formalpara>
+               <title>MessageCounter</title>
+               <para>Each queue maintains a message counter.</para>
+       </formalpara>
+       <formalpara>
+               <title>MessageCounterStatistics</title>
+               <para>The statistics for the message counter</para>
+       </formalpara>
+       <formalpara>
+               <title>MessageCounterHistoryDayLimit</title>
+               <para>The maximum number of days to hold message counter
+               history for. Overrides any value set on the ServerPeer.</para>
+</formalpara>
+<formalpara>
+               <title>ConsumerCount</title>
+               <para>The number of consumers currently consuming from the
+               queue.</para>
+</formalpara>
+</section>
+         <section id="conf.destination.queue.operations"> 
+            <title>Queue Operations</title>
+	    <para>We now discuss the MBean operations of the Queue
+            MBean</para> 
+    <formalpara>
+               <title>RemoveAllMessages</title>
+	       <para>Remove (and delete) all messages from the queue.</para></formalpara> 
+       <warning>
+		<para>
+                      Use this with caution. It will permanently delete all messages from the queue 
+			</para>
+                  </warning>
+		  <formalpara>
+               <title>ListAllMessages</title>
+	       <para>List all messages currently in the queue</para>
+       </formalpara>
+               <para>There are two overloaded versions of this operation: One
+               takes a JMS selector as an argument, the other does not. By
+               using the selector you can retrieve a subset of the messages in
+               the queue that match the criteria</para>
+       <formalpara>
+               <title>ListDurableMessages</title>
+               <para>As listAllMessages but only lists the durable
+		       messages</para>
+       </formalpara>
+               <para>There are two overloaded versions of this operation: One
+               takes a JMS selector as an argument, the other does not. By
+               using the selector you can retrieve a subset of the messages in
+               the queue that match the criteria</para>
+
+       <formalpara>
+               <title>ListNonDurableMessages</title>
+               <para>As listAllMessages but only lists the non durable
+		       messages</para>
+       </formalpara>
+               <para>There are two overloaded versions of this operation: One
+               takes a JMS selector as an argument, the other does not. By
+               using the selector you can retrieve a subset of the messages in
+               the queue that match the criteria</para>
+
+       <formalpara>
+               <title>ResetMessageCounter</title>
+               <para>Resets the message counter to zero.</para>
+       </formalpara>
+       <formalpara>
+               <title>ResetMessageCounterHistory</title>
+               <para>Resets the message counter history.</para>
+       </formalpara>
+       <formalpara>
+               <title>ListMessageCounterAsHTML</title>
+               <para>Lists the message counter in an easy to display HTML
+               format</para>
+</formalpara>
+<formalpara>
+               <title>ListMessageCounterHistoryAsHTML</title>
+               <para>Lists the message counter history in an easy to display
+               HTML format</para>
+</formalpara> 
+</section>
+</section>
+      </section>
+      <section id="conf.destination.topics">
+         <title>Configuring topics</title>
+	 <para>This section will explain the configuration of topics</para>
+         <section id="conf.destination.topic.attributes">
+            <title>We now discuss the MBean attributes of the Topic
+            MBean</title>
+    <formalpara>
+               <title>Name</title>
+               <para>The name of the topic</para>
+       </formalpara>
+       <formalpara>
+               <title>JNDIName</title>
+               <para>The JNDI name where the topic is bound</para>
+       </formalpara>
+       <formalpara>
+               <title>DLQ</title>
+               <para>The DLQ used for this topic. Overrides any value set on
+               the ServerPeer config</para>
+</formalpara>
+<formalpara>
+               <title>ExpiryQueue</title>
+               <para>The Expiry queue used for this topic. Overrides any value
+               set on the ServerPeer config</para>
+</formalpara>
+<formalpara>
+               <title>RedeliveryDelay</title>
+               <para>The redelivery delay to be used for this topic. Overrides
+               any value set on the ServerPeer config</para>
+</formalpara>
+<formalpara>
+               <title>MaxDeliveryAttempts</title>
+               <para>The maximum number of times delivery of a message will be
+               attempted before sending the message to the DLQ, if configured.
+               If set to -1 (the default), the value from the ServerPeer
+               config is used. Any other setting overrides the value set on
+               the ServerPeer config.</para>
+</formalpara>
+<formalpara>
+               <title>Destination Security Configuration</title>
+               <para><literal>SecurityConfig</literal> - allows you to
+               determine which roles are allowed to read, write and create on
+               the destination. It has exactly the same syntax and semantics
+	       as the security configuration in JBossMQ destinations.</para></formalpara>
+               <para>The <literal>SecurityConfig</literal> element should
+               contain one <literal>&lt;security&gt;</literal> element. The
+               <literal>&lt;security&gt;</literal> element can contain
+               multiple <literal>&lt;role&gt;</literal> elements. Each
+               <literal>&lt;role&gt;</literal> element defines the access for
+               that particular role.</para>
+               <para>If the <literal>read</literal> attribute is
+               <literal>true</literal> then that role will be able to read
+               (create consumers, receive messaages or browse) this
+               destination.</para>
+               <para>If the <literal>write</literal> attribute is
+               <literal>true</literal> then that role will be able to write
+               (create producers or send messages) to this destination.</para>
+               <para>If the <literal>create</literal> attribute is
+               <literal>true</literal> then that role will be able to create
+               durable subscriptions on this destination.</para>
+               <para>Note that the security configuration for a destination is
+               optional. If a <literal>SecurityConfig</literal> element is not
+               specifed then the default security configuration from the
+               Server Peer will be used.</para>
+
+       <formalpara>
+               <title>Destination paging parameters</title>
+               <para>'Pageable Channels' are a sophisticated new feature
+		       available in JBoss Messaging.</para></formalpara>
+               <para>If your application needs to support very large queues or
+               subscriptions containing potentially millions of messages, then
+               it's not possible to store them all in memory at once.</para>
+               <para>JBoss Messaging solves this problem but letting you
+               specify the maximum number of messages that can be stored in
+               memory at any one time, on a queue-by-queue, or topic-by-topic
+               basis. JBoss Messaging then pages messages to and from storage
+               transparently in blocks, allowing queues and subscriptions to
+               grow to very large sizes without any performance degradation as
+               channel size increases.</para>
+               <para>This has been tested with in excess of 10 million 2K
+               messages on very basic hardware and has the potential to scale
+               to much larger number of messages.</para>
+               <para>The individual parameters are:</para>
+               <para><literal>FullSize</literal> - this is the maximum number
+               of messages held by the queue or topic subscriptions in memory
+               at any one time. The actual queue or subscription can hold many
+               more messages than this but these are paged to and from storage
+               as necessary as messages are added or consumed.</para>
+               <para><literal>PageSize</literal> - When loading messages from
+               the queue or subscrition this is the maximum number of messages
+               to pre-load in one operation.</para>
+               <para><literal>DownCacheSize</literal> - When paging messages
+               to storage from the queue they first go into a "Down Cache"
+               before being written to storage. This enables the write to
+               occur as a single operation thus aiding performance. This
+               setting determines the max number of messages that the Down
+               Cache will hold before they are flushed to storage.</para>
+               <para>If no values for <literal>FullSize</literal>,
+               <literal>PageSize</literal>, or
+               <literal>DownCacheSize</literal> are specified they will
+               default to values 75000, 2000, 2000 respectively.</para>
+               <para>If you want to specify the paging parameters used for
+               temporary queues then you need to specify them on the
+               appropriate connection factory. See connection factory
+               configuration for details.</para>
+
+       <formalpara>
+               <title>CreatedProgrammatically</title>
+               <para>Returns <literal>true</literal> if the topic was created
+               programmatically</para>
+</formalpara>
+<formalpara>
+               <title>MaxSize</title>
+               <para>A maximum size (in number of messages) can be specified
+               for a topic subscription. Any messages that arrive beyond this
+               point will be dropped. The default is <literal>-1</literal>
+               which is unbounded.</para>
+</formalpara>
+<formalpara>
+               <title>Clustered</title>
+               <para>Clustered destinations must have this set to
+               <literal>true</literal></para>
+</formalpara>
+<formalpara>
+               <title>MessageCounterHistoryDayLimit</title>
+               <para>The maximum number of days to hold message counter
+               history for. Overrides any value set on the ServerPeer.</para>
+</formalpara>
+<formalpara>
+               <title>MessageCounters</title>
+               <para>Return a list of the message counters for the
+               subscriptions of this topic.</para>
+</formalpara>
+<formalpara>
+               <title>AllMessageCount</title>
+               <para>Return the total number of messages in all subscriptions
+               of this topic.</para>
+</formalpara>
+<formalpara>
+               <title>DurableMessageCount</title>
+               <para>Return the total number of durable messages in all
+               subscriptions of this topic.</para>
+</formalpara>
+<formalpara>
+               <title>NonDurableMessageCount</title>
+               <para>Return the total number of non durable messages in all
+               subscriptions of this topic.</para>
+</formalpara>
+<formalpara>
+               <title>AllSubscriptionsCount</title>
+               <para>The count of all subscriptions on this topic</para>
+       </formalpara>
+       <formalpara>
+               <title>DurableSubscriptionsCount</title>
+               <para>The count of all durable subscriptions on this
+               topic</para>
+</formalpara>
+<formalpara>
+               <title>NonDurableSubscriptionsCount</title>
+               <para>The count of all non durable subscriptions on this
+               topic</para>
+</formalpara>
+         </section>
+         <section id="conf.destination.topic.operations">
+            <title>We now discuss the MBean operations of the Topic
+            MBean</title>
+    <formalpara>
+               <title>RemoveAllMessages</title>
+               <para>Remove (and delete) all messages from the subscriptions
+		       of this topic.</para></formalpara> <warning><para>
+                      Use this with caution. It will permanently delete all messages from the topic. </para>
+                  </warning>
+		  <formalpara>
+               <title>ListAllSubscriptions</title>
+               <para>List all subscriptions of this topic</para>
+       </formalpara>
+       <formalpara>
+               <title>ListDurableSubscriptions</title>
+               <para>List all durable subscriptions of this topic</para>
+       </formalpara>
+       <formalpara>
+               <title>ListNonDurableSubscriptions</title>
+               <para>List all non durable subscriptions of this topic</para>
+       </formalpara>
+       <formalpara>
+               <title>ListAllSubscriptionsAsHTML</title>
+               <para>List all subscriptions of this topic in an easy to
+               display HTML format</para>
+</formalpara>
+<formalpara>
+               <title>ListDurableSubscriptionsAsHTML</title>
+               <para>List all durable subscriptions of this topic in an easy
+               to display HTML format</para>
+</formalpara>
+<formalpara>
+               <title>ListNonDurableSubscriptionsAsHTML</title>
+               <para>List all non durable subscriptions of this topic in an
+               easy to display HTML format</para>
+</formalpara>
+<formalpara>
+               <title>ListAllMessages</title>
+	       <para>Lists all messages for the specified subscription.</para></formalpara>
+               <para>There are two overloaded versions of this operation. One
+               that takes a selector and one that does not. By specifyingthe
+               selector you can limit the messages returned.</para>
+
+<formalpara>
+               <title>ListNonDurableMessages</title>
+               <para>Lists all non durable messages for the specified
+		       subscription.</para></formalpara>
+               <para>There are two overloaded versions of this operation. One
+               that takes a selector and one that does not. By specifyingthe
+               selector you can limit the messages returned.</para>
+
+       <formalpara>
+               <title>ListDurableMessages</title>
+               <para>Lists all durable messages for the specified
+		       subscription.</para></formalpara>
+               <para>There are two overloaded versions of this operation. One
+               that takes a selector and one that does not. By specifyingthe
+               selector you can limit the messages returned.</para>
+         </section>
+      </section>
+   <!-- end of conf destination -->
+   <section id="conf.connectionfactory">
+      <title>Configuring Connection Factories</title>
+      <para>With the default configuration JBoss Messaging binds two
+      connection factories in JNDI at start-up.</para>
+      <para>The first connection factory is the default non-clustered
+      connection factory and is bound into the following JNDI contexts:
+      <literal>/ConnectionFactory, /XAConnectionFactory,
+      java:/ConnectionFactory, java:/XAConnectionFactory</literal>. This
+      connection factory is provided to maintain compatibility with
+      applications originally written against JBoss MQ which has no automatic
+      failover or load balancing. This connection factory should be used if
+      you do not require client side automatic failover or load
+      balancing.</para>
+      <para>The second connection factory is the default clustered connection
+      factory and is bound into the following JNDI contexts
+      <literal>/ClusteredConnectionFactory, /ClusteredXAConnectionFactory,
+      java:/ClusteredConnectionFactory,
+      java:/ClusteredXAConnectionFactory</literal>.</para>
+      <para>You may want to configure additional connection factories, for
+      instance if you want to provide a default client id for a connection
+      factory, or if you want to bind it in different places in JNDI, if you
+      want different connection factories to use different transports, or if
+      you want to selective enable or disable load-balancing and/or automatic
+      failover for a particular connection factory. Deploying a new connection
+      factory is equivalent with adding a new ConnectionFactory MBean
+      configuration to
+      <filename>connection-factories-service.xml</filename>.</para>
+      <para>It is also possible to create an entirely new service deployment
+      descriptor <filename>xxx-service.xml</filename> altogether and deploy it
+      in <filename>$JBOSS_HOME/server/messaging/deploy</filename>.</para>
+      <para>Connection factories can support automatic failover and/or
+      load-balancing by setting the corresponding attributes</para>
+      <para>An example connection factory configuration is presented
+      below:</para>
+      <programlisting>
+&lt;mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
+      name="jboss.messaging.connectionfactory:service=MyConnectionFactory"
+      xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml"&gt;
+      &lt;depends optional-attribute-name="ServerPeer"&gt;
+                 jboss.messaging:service=ServerPeer
+      &lt;/depends&gt;
+      &lt;depends optional-attribute-name="Connector"&gt;
+                 jboss.messaging:service=Connector,transport=bisocket
+      &lt;/depends&gt;
+      &lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;
+
+      &lt;attribute name="JNDIBindings"&gt;
+         &lt;bindings&gt;
+            &lt;binding&gt;/MyConnectionFactory&lt;/binding&gt;
+            &lt;binding&gt;/factories/cf&lt;/binding&gt;
+         &lt;/bindings&gt;
+      &lt;/attribute&gt;
+      
+      &lt;attribute name="ClientID"&gt;myClientID&lt;/attribute&gt;
+
+      &lt;attribute name="SupportsFailover"&gt;true&lt;/attribute&gt;
+      
+      &lt;attribute name="SupportsLoadBalancing"&gt;false&lt;/attribute&gt;  
+      
+      &lt;attribute name="LoadBalancingFactory"&gt;org.acme.MyLoadBalancingFactory&lt;/attribute&gt;
+          
+      &lt;attribute name="PrefetchSize"&gt;1000&lt;/attribute&gt; 
+
+      &lt;attribute name="SlowConsumers"&gt;false&lt;/attribute&gt;
+      
+      &lt;attribute name="StrictTck"&gt;true&lt;/attribute&gt;
+
+      &lt;attribute name="DefaultTempQueueFullSize"&gt;50000&lt;/attribute&gt;
+      
+      &lt;attribute name="DefaultTempQueuePageSize"&gt;1000&lt;/attribute&gt; 
+            
+      &lt;attribute name="DefaultTempQueueDownCacheSize"&gt;1000&lt;/attribute&gt; 
+      
+      &lt;attribute name="DupsOKBatchSize"&gt;10000&lt;/attribute&gt; 
+   &lt;/mbean&gt;
+   
+
+             </programlisting>
+      <para>The above example would create a connection factory with
+      pre-configured client ID <literal>myClientID</literal> and bind the
+      connection factory in two places in the JNDI tree:
+      <literal>/MyConnectionFactory</literal> and
+      <literal>/factories/cf</literal>. The connection factory overrides the
+      default values for PreFetchSize, DefaultTempQueueFullSize,
+      DefaultTempQueuePageSize, DefaultTempQueueDownCacheSize and
+      DupsOKBatchSize, SupportsFailover, SupportsLoadBalancing and
+      LoadBalancingFactory. The connection factory will use the default
+      remoting connector. To use a different remoting connector with the
+      connection factory change the <literal>Connector</literal> attribute to
+      specify the service name of the connector you wish to use.</para>
+      <section id="conf.connectionfactory.attributes">
+         <title>We now discuss the MBean attributes of the ConnectionFactory
+         MBean</title>
+ <formalpara>
+            <title>ClientID</title>
+            <para>Connection factories can be pre-configured with a client id.
+            Any connections created using this connection factory will obtain
+            this client id</para>
+</formalpara>
+<formalpara>
+            <title>JNDIBindings</title>
+            <para>The list of the JNDI bindings for this connection
+            factory</para>
+</formalpara>
+<formalpara>
+            <title>PrefetchSize</title>
+	    <para>This parameter specifies the window size in numbers of messages, for consumer flow control.
+		    The window size determines the number of messages a server can send to a consumer without blocking.
+        Each consumer maintains a buffer of messages from which it consumes. Please note that TCP also implements its own flow control, so if you set this to too large a number, then the TCP window size may be hit before the prefetchSize, which can cause writes to block.</para>
+</formalpara>
+<formalpara>
+            <title>SlowConsumers</title>
+	    <para>If you have very slow consumers, then you probably want to make
+		    sure they don't buffer any messages. Since this can prevent them from
+        being consumed by faster consumers. Setting this to true is equivalent to setting PrefetchSize to 1</para>
+</formalpara>
+<formalpara>
+            <title>StrictTck</title>
+            <para>Set this to true if you want strict JMS behaviour as
+            required by the TCK.</para>
+</formalpara>
+<formalpara>
+            <title>Temporary queue paging parameters</title>
+            <para>DefaultTempQueueFullSize, DefaultTempQueuePageSize,
+            DefaultTempQueueDownCacheSize are optional attributes that
+            determine the default paging parameters to be used for any
+            temporary destinations scoped to connections created using this
+            connection factory. See the section on paging channels for more
+            information on what these values mean. They will default to values
+            of 200000, 2000 and 2000 respectively if ommitted.</para>
+</formalpara>
+<formalpara>
+            <title>DupsOKBatchSize</title>
+            <para>When using a session with acknowledge mode of
+            DUPS_OK_ACKNOWLEDGE this setting determines how many
+            acknowledgments it will buffer locally before sending. The default
+            value is <literal>2000</literal></para>
+</formalpara>
+<formalpara>
+            <title>SupportsLoadBalancing</title>
+            <para>When using a connection factory with a clustered JBoss
+            Messaging installation you can choose whether to enable client
+            side connection load-balancing. This is determined by setting the
+	    attribute supportsLoadBalancing on the connection factory.</para></formalpara>
+            <para>If load balancing is enabled on a connection factory then
+            any connections created with that connection factory will be
+            load-balanced across the nodes of the cluster. Once a connection
+            is created on a particular node, it stays on that node.</para>
+            <para>The exact policy that determines how connections are load
+            balanced is determined by the LoadBalancingFactory
+            attribute</para>
+            <para>The default value is <literal>false</literal></para>
+
+	    <formalpara>
+            <title>SupportsFailover</title>
+            <para>When using a connection factory with a clustered JBoss
+            Messaging installation you can choose whether to enable client
+            side automatic failover. This is determined by setting the
+	    attribute supportsFailover on the connection factory.</para></formalpara>
+            <para>If automatic failover is enabled on a connection factory,
+            then if a connection problem is detected with the connection then
+            JBoss Messaging will automatically and transparently failover to
+            another node in the cluster.</para>
+            <para>The failover is transparent meaning the user can carry on
+            using the sessions, consumers, producers and connection objects as
+            before.</para>
+            <para>If automatic failover is not required, then this attribute
+            can be set to false. With automatic failover disabled it is up to
+            the user code to catch connection exceptions in synchronous JMS
+            operations and install a JMS ExceptionListener to catch exceptions
+            asynchronously. When a connection is caught, the client side code
+            should lookup a new connection factory using HAJNDI and recreate
+            the connection using that.</para>
+            <para>The default value is <literal>false</literal></para>
+
+	    <formalpara>
+            <title>DisableRemotingChecks</title>
+            <para>By default, when deploying a connection factory, JBoss
+            Messaging checks that the corresponding JBoss Remoting Connector
+            has "sensible" values. JBoss Messaging is very sensitive to the
+            values and for many of them there's rarely a good reason to change
+	    them. To disable such sanity checking set this to false.</para></formalpara> <warning><para>
+                   There is rarely a good reason to disable checking. Only do so if you are absolutely sure in what you are doing </para>
+               </warning>
+            <para>The default value is <literal>false</literal></para>
+
+	    <formalpara>
+            <title>LoadBalancingFactory</title>
+            <para>If you are using a connection factory with client side load
+            balancing then you can specify how the load balancing is
+            implemented by overriding this attribute. The value must
+            correspond to the name of a class which implements the interface
+	    org.jboss.jms.client.plugin.LoadBalancingFactory</para></formalpara>
+            <para>The default value is
+            org.jboss.jms.client.plugin.RoundRobinLoadBalancingFactory, which
+            load balances connetions across the cluster in a round-robin
+            fashion</para>
+
+    <formalpara>
+            <title>Connector</title>
+            <para>This specifies which remoting connector this connection
+            factory uses. Different connection factories can use different
+	    connectors.</para></formalpara>
+            <para>For instance you could deploy one connection factory that
+            creates connections that use the HTTP transport to communicate to
+            the server and another that creates connections that use the
+            bisocket transport to communicate.</para>
+
+      </section>
+      <!-- End conf.connectionfactory.attributes -->
+   </section>
+   <!-- End conf.connectionfactory -->
+   <section id="conf.connector">
+      <title>Configuring the remoting connector</title>
+      <para>JBoss Messaging uses JBoss Remoting for all client to server
+      communication. For full details of what JBoss Remoting is capable of and
+      how it is configured please consult the JBoss Remoting
+      documentation.</para>
+      <para>The default configuration includes a single remoting connector
+      which is used by the single default connection factory. Each connection
+      factory can be configured to use its own connector.</para>
+      <para>The default connector is configured to use the remoting bisocket
+      transport. The bisocket transport is a TCP socket based transport which
+      only listens and accepts connections on the server side. I.e.
+      connections are always initiated from the client side. This means it
+      works well in typical firewall scenarios where only inbound connections
+      are allowed on the server. Or where onlu outbound connections are
+      allowed from the client.</para>
+      <para>The bisocket transport can be configured to use SSL where a higher
+      level of security is required.</para>
+      <para>The other supported transport is the HTTP transport. This uses the
+      HTTP protocol to communicate between client and server. Data is received
+      on the client by the client periodically polling the server for
+      messages. This transport is well suited to situations where there is a
+      firewall between client and server which only allows incoming HTTP
+      traffic on the server. Please note this transport will not be as
+      performant as the bisocket transport due to the nature of polling and
+      the HTTP protocl. Also please note it is not designed for high load
+      situations.</para>
+      <para>No other remoting transports are currently supported by JBoss
+      Messaging</para>
+      <para>You can look at remoting configuration under:</para>
+      <para>&lt;JBoss&gt;/server/&lt;YourMessagingServer&gt;/deploy/jboss-messaging.sar/remoting-bisocket-service.xml</para>
+      <para>Here is an example bisocket remoting configuration:
+      <programlisting>
+         &lt;config&gt;
+            &lt;invoker transport="bisocket"&gt;
+            
+               &lt;!-- There should be no reason to change these parameters - warning!
+                    Changing them may stop JBoss Messaging working correctly --&gt;            
+               &lt;attribute name="marshaller" isParam="true"&gt;org.jboss.jms.wireformat.JMSWireFormat&lt;/attribute&gt;
+               &lt;attribute name="unmarshaller" isParam="true"&gt;org.jboss.jms.wireformat.JMSWireFormat&lt;/attribute&gt;
+               &lt;attribute name="dataType" isParam="true"&gt;jms&lt;/attribute&gt;
+               &lt;attribute name="socket.check_connection" isParam="true"&gt;false&lt;/attribute&gt;
+               &lt;attribute name="timeout" isParam="true"&gt;0&lt;/attribute&gt;
+               &lt;attribute name="serverBindAddress"&gt;${jboss.bind.address}&lt;/attribute&gt;
+               &lt;attribute name="serverBindPort"&gt;4457&lt;/attribute&gt;
+               &lt;attribute name="clientSocketClass" isParam="true"&gt;org.jboss.jms.client.remoting.ClientSocketWrapper&lt;/attribute&gt;
+               &lt;attribute name="serverSocketClass" isParam="true"&gt;org.jboss.jms.server.remoting.ServerSocketWrapper&lt;/attribute&gt;
+               &lt;attribute name="numberOfCallRetries" isParam="true"&gt;1&lt;/attribute&gt;
+               &lt;attribute name="pingFrequency" isParam="true"&gt;214748364&lt;/attribute&gt;
+               &lt;attribute name="pingWindowFactor" isParam="true"&gt;10&lt;/attribute&gt;
+               &lt;attribute name="onewayThreadPool"&gt;org.jboss.jms.server.remoting.DirectThreadPool&lt;/attribute&gt;
+               
+               &lt;!-- Periodicity of client pings. Server window by default is twice this figure --&gt;                               
+               &lt;attribute name="clientLeasePeriod" isParam="true"&gt;10000&lt;/attribute&gt;
+
+               &lt;!-- Number of seconds to wait for a connection in the client pool to become free --&gt;
+               &lt;attribute name="numberOfRetries" isParam="true"&gt;10&lt;/attribute&gt;
+
+               &lt;!-- Max Number of connections in client pool. This should be significantly higher than
+                    the max number of sessions/consumers you expect --&gt;
+               &lt;attribute name="clientMaxPoolSize" isParam="true"&gt;200&lt;/attribute&gt;
+               
+               &lt;!-- Use these parameters to specify values for binding and connecting control connections to 
+                    work with your firewall/NAT configuration
+               &lt;attribute name="secondaryBindPort"&gt;xyz&lt;/attribute&gt;                           
+               &lt;attribute name="secondaryConnectPort"&gt;abc&lt;/attribute&gt;               
+               --&gt;
+                              
+            &lt;/invoker&gt;
+            &lt;handlers&gt;
+               &lt;handler subsystem="JMS"&gt;org.jboss.jms.server.remoting.JMSServerInvocationHandler&lt;/handler&gt;
+            &lt;/handlers&gt;
+         &lt;/config&gt;
+      </programlisting></para>
+      <para>Please note that some of the attributes should not be changed
+      unless you know exactly what you are doing. We will discuss the
+      attributes that you may have a good reason to change:</para>
+      <para><itemizedlist>
+            <listitem>
+		    <para>
+                clientLeasePeriod - Clients periodically send heartbeats to the server to tell the server they are still alive. If the server does not receive a heartbeat after a certain time it will close down the connection and remove all resources on the server corresponding to the client's session. The clientLeasePeriod determines the period of heartbeats. The server will (by default) close a client if it does not receive a heartbeat in 2 * clientLeasePeriod ms. The actual factor gets automatically resized according to system load. The value is in milliseconds. The defaut value is 10000 ms. 
+	</para>
+            </listitem>
+            <listitem>
+            <para>
+                numberOfRetries - This effectively corresponds to the number of seconds JBoss Remoting will block on the client connection pool waiting for a connection to become free. If you have a very large number of sessions concurrently accessing the server from a client and you are experiencing issues due to not being able to obtain connections from the pool, you may want to consider increasing this value. 
+	</para>
+            </listitem>
+            <listitem>
+		    <para>
+                clientMaxPoolSize - JBoss Remoting maintains a client side pool of TCP connections on which to service requests. If you have a very large number of sessions concurrently accessing the server from a client and you are experiencing issues due to not being able to obtain connections from the pool in a timely manner, you may want to consider increasing this value. 
+	</para>
+            </listitem>
+            <listitem>
+		    <para>
+                secondaryBindPort - The bisocket transport uses control connections to pass control messages between server and client. If you want to work behind a firewall you may want to specify a particular value for this according to your firewall configuration. This is the address the secondary ServerSocket binds to 
+	</para>
+            </listitem>
+            <listitem>
+		    <para>
+                secondaryConnectPort - This is the port the client uses to connect. You may want to specify this to allow clients to work with NAT routers. 
+	</para>
+            </listitem>
+            <listitem>
+		    <para>
+                maxPoolSize - This is the number of threads used on the server side to service requests. 
+	</para>
+            </listitem>
+         </itemizedlist></para>
+      <para>By default JBoss Messaging binds to ${jboss.bind.address} which
+      can be defined by: ./run.sh -c &lt;yourconfig&gt; -b yourIP.</para>
+      <para>You can change remoting-bisocket-service.xml if you want for
+      example use a different communication port.</para>
+      <warning>
+<para>
+          There is rarely a good reason to change values in the the bisocket or sslbisocket connector configuration apart from clientLeasePeriod, clientMaxPoolSize, maxRetries, numberOfRetries, secondaryBindPort or secondaryConnectPort. Changing them can cause JBoss Messaging to stop functioning correctly. 
+</para>
+      </warning>
+   </section>
+   <!-- end conf.connector -->
+   <section id="conf.servicebindingmanager">
+      <title>ServiceBindingManager</title>
+      <para>If you are using the JBoss AS ServiceBindingManager to provide
+      different servers with different port ranges, then you must make sure
+      that the JBoss Messaging remoting configuration specified in the JBoss
+      Messaging section of the ServiceBindingManager xml file exactly matches
+      that in remoting-bisocket-service.xml.</para>
+      <para>If you are using a newer version of JBM in an older version of
+      JBAS then the example bindings in the AS distribution may well be out of
+      date. It is therefore imperative that the relevant sections are
+      overwritten with the remoting configuration from the JBM
+      distribution.</para>
+      <para>See the chapter on installation for a description of how to set-up
+      the service binding manager for JBoss Messaging</para>
+   </section>
+   <!-- End conf.callback -->
+</chapter>
\ No newline at end of file

Added: projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/gettingstarted.xml
===================================================================
--- projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/gettingstarted.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/gettingstarted.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="gettingstarted">
+   <title>Download Software</title>
+   <para>The official JBoss Messaging project page is <ulink
+   url="http://labs.jboss.com/jbossmessaging">http://labs.jboss.com/jbossmessaging/</ulink>.</para>
+   <para>The download location is the JBoss Labs Messaging Project download
+   zone: <ulink
+   url="http://labs.jboss.com/jbossmessaging/">http://labs.jboss.com/jbossmessaging/downloads</ulink></para>
+   <section id="SVN">
+      <title>SVN Access</title>
+      <para>If you want to experiment with the latest developments you may
+      checkout the latest code from the Messaging SVN trunk. Be aware that the
+      information provided in this manual might then not be accurate. For the
+      latest instructions on how to check out and build source code, please go
+      to <ulink
+      url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMessagingDevelopment">
+      Messaging Development wiki page</ulink>, specifically <ulink
+      url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMessagingBuildInstructions">
+      "Building and Running JBoss Messaging"</ulink> section.</para>
+   </section>
+</chapter>
\ No newline at end of file

Added: projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/installation.xml
===================================================================
--- projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/installation.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/installation.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,1013 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="installation">
+   <title>JBoss Messaging Installation</title>
+   <para>This section describes procedures on how to install JBoss Messaging
+   into JBoss AS. At the end of this procedure, you will create a JBoss
+   Messaging configuration that will start a clustered or non-clustered
+   messaging server.</para>
+   <para>By default, JBoss AS 4 ships with JBossMQ as default JMS provider. In
+   order to use the JBoss AS instance with JBoss Messaging, you need to
+   perform the installation procedure described below.</para>
+   <para><note>
+          A JBossMQ and a JBoss Messaging instance cannot coexist, at least not unless special precautions are taken. Do not simply attempt to copy the Messaging release artifact 
+         <filename>jboss-messaging.sar</filename>
+          over to the JBoss instance w 
+         <filename>deploy</filename>
+          directory. Follow one of the alternate installation procedures outlined below instead. 
+      </note></para>
+   <para><note>
+          We only recommend and support installing JBoss Messaging in JBoss AS 4.2 or later. You should avoid using JBoss Messaging on any version of JBoss AS prior to JBoss 4.2.0.GA, such as 4.0.5.GA and 4.0.4.GA. 
+      </note><note>
+          JBoss Messaging is built against the JBoss AS 4.2 libraries which are built using Java 5. Therefore JBoss Messaging only runs with Java 5 or later. 
+      </note></para>
+   <section id="install">
+      <title>Installing JBoss Messaging on JBoss AS 4.2</title>
+      <para>In this section we present two different methods of installing
+      JBoss Messaging in JBoss AS 4.2</para>
+      <itemizedlist>
+         <listitem>
+             If you have a completely clean JBoss AS 4.2.0 installation then you can do an 
+            <xref linkend="install.automated">automatic install</xref>
+             . 
+         </listitem>
+         <listitem>
+             If you have a JBoss 4.2.0 that you have changed in some way from a clean JBoss AS 4.2.0 installation then you will need to do a 
+            <xref linkend="install.manual">manual install</xref>
+             . 
+         </listitem>
+      </itemizedlist>
+      <section id="install.automated">
+         <title>Automated Installation</title>
+         <para><note>
+                This procedure should only be performed from a clean JBoss AS 4.2 installation. If you have modifed the JBoss AS 4.2 installation at all since installation then you will need to perform a manual clustered JBoss Messaging installation 
+            </note></para>
+         <itemizedlist>
+            <listitem>
+               <para>Set up the <literal>JBOSS_HOME</literal> environment
+               variable to point to the JBoss 4.2 installation you want to use
+               JBoss Messaging with.</para>
+               <para>Run the installation script, available in the
+               <filename>util</filename> directory of the release bundle as
+               follows:</para>
+               <para>If you want to create a simple non clustered installion
+               based on the default configuration:</para>
+               <programlisting>
+         cd util
+         ant -f release-admin.xml
+         </programlisting>
+               <para>If you want to create a clustered installation based on
+               the all configuration or change the configuration name:</para>
+               <programlisting>
+ cd util
+ ant -f release-admin.xml -Dmessaging.config.source=all -Dmessaging.config.name=messaging-node0
+         </programlisting>
+               <para>In the above you would substitute
+               <literal>messaging-node0</literal> with whatever is the name
+               you want to give the configuration. If you want several cluster
+               nodes on the same machine, e.g. for development purposes then a
+               good convention is to name them <literal>messaging-node0,
+               messaging-node1</literal> to match
+               <literal>messaging-node&lt;ServerPeerID&gt;</literal></para>
+               <para>The messaging.config.source variable determines which
+               JBoss AS configuration (e.g. default or all) to base the
+               installation on</para>
+               <para>The installation script will create a
+               <filename>$JBOSS_HOME/server/messaging-node0</filename>
+               configuration. (If you have chosen
+               <literal>messaging-node0</literal>)</para>
+            </listitem>
+            <para>For the rest of the procedure we assume JBOSS_CONFIG refers
+            to your new messaging configuration (e.g. messaging-node0 or
+            messaging)</para>
+            <para>You don't actually have to create an environment variable
+            <literal>JBOSS_CONFIG</literal>, this is just used in the
+            installation instructions to describe the steps</para>
+            <listitem>
+               <para>
+                  <warning>For a clustered installation it is mandatory that a
+                  shared database is available to all nodes in the cluster.
+                  The default JBoss AS uses HSQLDB for its database which is a
+                  local shared database. Therefore in order to use clustering
+                  you must replace this with a different shared database. If
+                  the database is not replaced then clustering will not
+                  work.</warning>
+               </para>
+               <itemizedlist>
+                  <listitem>
+                     <para>Replace
+                     <literal>$JBOSS_CONFIG/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml</literal>
+                     by the
+                     <literal>databasename&gt;-persistence-service</literal>
+                     from
+                     <literal>&lt;downloadPackage&gt;/examples/config.</literal>.
+                     For instance
+                     <literal>mysql-persistence-service.xml</literal></para>
+                  </listitem>
+                  <listitem><para>Configure a JCA datasource using an example
+                  from <literal>$JBOSS_HOME/docs/examples/jca</literal></para>
+                  and copying to <literal>$JBOSS_CONFIG/deploy</literal>
+                  <para>JBoss Messaging uses <literal>DefaultDS</literal> by
+                  default so you should configure your datasource to bind to
+                  that</para></listitem>
+                  <listitem>
+                     <para>Remove hsqldb-ds.xml from
+                     <literal>$JBOSS_CONFIG/deploy</literal></para>
+                  </listitem>
+                  <listitem>
+                     <para>Copy your database driver to
+                     <literal>$JBOSS_CONFIG/lib</literal></para>
+                     <para>Your database driver can probably be downloaded
+                     from your database provider's web site</para>
+                  </listitem>
+               </itemizedlist>
+            </listitem>
+            <listitem>
+               <para>Ensure the <literal>ServerPeerID</literal> MBean
+               attribute value in messaging-service.xml is unique for each
+               node. The <literal>ServerPeerID</literal> value must be a valid
+               integer. Every node MUST have a unique id, including those just
+               connected by message bridges.</para>
+               <para>
+                  <warning>Each node must have a unique
+                  <literal>ServerPeerID</literal> irrespective of whether you
+                  are using clustering.</warning>
+               </para>
+            </listitem>
+            <listitem>
+               <para>If you want to run multiple JBoss Messaging nodes on the
+               same box using the same IP address, e.g. for development
+               purposes, then you can use the ServiceBindingManager to do this
+               as follows:</para>
+               <itemizedlist>
+                  <listitem>
+                     <para>Uncomment binding manager service from
+                     $JBOSS_CONFIG/conf/jboss-service.xml</para>
+                  </listitem>
+                  <listitem>
+                     <para>Specify the desired port rage (e.g. ports-01,
+                     ports-02... etc)</para>
+                  </listitem>
+                  <listitem>
+                     <para>Look at
+                     $JBOSS_HOME/docs/examples/binding-manager/sample-bindings.xml.
+                     Here is an example:</para>
+                     <programlisting>
+      &lt;service-config name="jboss.messaging:service=Connector,transport=bisocket"
+                      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"&gt;
+         &lt;delegate-config&gt;
+            &lt;attribute name="Configuration"&gt;&lt;![CDATA[
+	        &lt;config&gt;
+            &lt;invoker transport="bisocket"&gt;
+            
+               &lt;!-- There should be no reason to change these parameters - warning!
+                    Changing them may stop JBoss Messaging working correctly --&gt;            
+               &lt;attribute name="marshaller" isParam="true"&gt;org.jboss.jms.wireformat.JMSWireFormat&lt;/attribute&gt;
+               &lt;attribute name="unmarshaller" isParam="true"&gt;org.jboss.jms.wireformat.JMSWireFormat&lt;/attribute&gt;
+               &lt;attribute name="dataType" isParam="true"&gt;jms&lt;/attribute&gt;
+               &lt;attribute name="socket.check_connection" isParam="true"&gt;false&lt;/attribute&gt;
+               &lt;attribute name="serverBindAddress"&gt;${jboss.bind.address}&lt;/attribute&gt;
+               &lt;attribute name="serverBindPort"&gt;4657&lt;/attribute&gt;
+               &lt;attribute name="clientSocketClass" isParam="true"&gt;org.jboss.jms.client.remoting.ClientSocketWrapper&lt;/attribute&gt;
+               &lt;attribute name="serverSocketClass" isParam="true"&gt;org.jboss.jms.server.remoting.ServerSocketWrapper&lt;/attribute&gt;
+               &lt;attribute name="numberOfCallRetries" isParam="true"&gt;1&lt;/attribute&gt;
+               &lt;attribute name="pingFrequency" isParam="true"&gt;214748364&lt;/attribute&gt;
+               &lt;attribute name="pingWindowFactor" isParam="true"&gt;10&lt;/attribute&gt;
+               &lt;attribute name="onewayThreadPool"&gt;org.jboss.jms.server.remoting.DirectThreadPool&lt;/attribute&gt;
+               
+               &lt;!-- Periodicity of client pings. Server window by default is twice this figure --&gt;                               
+               &lt;attribute name="clientLeasePeriod" isParam="true"&gt;10000&lt;/attribute&gt;
+
+	       &lt;attribute name="timeout" isParam="true"&gt;0&lt;/attribute&gt;
+	       
+               &lt;!-- Number of seconds to wait for a connection in the client pool to become free --&gt;
+               &lt;attribute name="numberOfRetries" isParam="true"&gt;10&lt;/attribute&gt;
+
+               &lt;!-- Max Number of connections in client pool. This should be significantly higher than
+                    the max number of sessions/consumers you expect --&gt;
+               &lt;attribute name="JBM_clientMaxPoolSize" isParam="true"&gt;200&lt;/attribute&gt;
+               
+               &lt;!-- Use these parameters to specify values for binding and connecting control connections to 
+                    work with your firewall/NAT configuration
+               &lt;attribute name="secondaryBindPort"&gt;xyz&lt;/attribute&gt;                           
+               &lt;attribute name="secondaryConnectPort"&gt;abc&lt;/attribute&gt;               
+               --&gt;
+                              
+            &lt;/invoker&gt;
+            &lt;handlers&gt;
+               &lt;handler subsystem="JMS"&gt;org.jboss.jms.server.remoting.JMSServerInvocationHandler&lt;/handler&gt;
+            &lt;/handlers&gt;
+         &lt;/config&gt;
+            ]]&gt;&lt;/attribute&gt;
+         &lt;/delegate-config&gt;
+         &lt;binding port="4657"/&gt;
+      &lt;/service-config&gt;
+              
+              </programlisting>
+                     <warning>You must ensure that the config (like above) is
+                     identical to that in
+                     <literal>remoting-bisocket-service.xml</literal> With the
+                     exception of the actual serverBindPort which clearly must
+                     be different for each ports range. Please note that the
+                     default JBoss Messaging service binding manager bindings
+                     in <literal>sample-bindings.xml</literal> shipped with
+                     JBAS 4.2.0 may be out of date and you will need to copy
+                     the config from <literal>remoting-bisocket-service.xml.
+                     DO NOT just copy and paste from the above example - copy
+                     it from the JBoss Messaging
+                     distribution.</literal></warning>
+                     <para>You should ensure that each node is configured to
+                     use a different ports range.</para>
+                  </listitem>
+               </itemizedlist>
+            </listitem>
+            <listitem>
+               <para>There are few extra steps at <xref
+               linkend="install.extra-steps" /></para>
+            </listitem>
+            <listitem>That's it</listitem>
+         </itemizedlist>
+      </section>
+      <section id="install.manual">
+         <title>Manual Installation</title>
+         <para><note>
+                This installation procedure should be performed if you are installing into a JBoss AS configuration that you have changed in some way from the default JBoss AS distribution. If you are just using the standard, untouched JBoss AS 4.2 distribution you can use the automated procedure above 
+            </note></para>
+         <para>For this procedure we assume you already have your custom
+         configuration located at
+         <literal>JBOSS_CONFIG=$JBOSS_HOME/server/&lt;myconfiguration&gt;</literal>,
+         and that it contains a JBoss MQ installation.</para>
+         <para>You don't actually have to create an environment variable
+         <literal>JBOSS_CONFIG</literal>, this is just used in the
+         installation instructions to describe the steps</para>
+         <itemizedlist>
+            <listitem>
+               <para>Move
+               <literal>$JBOSS_CONFIG/deploy/jms/hajndi-jms-ds.xml</literal>
+               and <literal>$JBOSS_CONFIG/deploy/jms/jms-ra.rar</literal> to
+               <literal>$JBOSS_CONFIG/deploy</literal></para>
+            </listitem>
+            <listitem>
+                
+               <para>Remove the old JBoss MQ by removing the directory
+               <literal>$JBOSS_CONFIG/deploy/jms.</literal></para>
+                . 
+               <para>Remove the old JBoss MQ jar file:
+               <literal>$JBOSS_CONFIG/lib/jbossmq.jar</literal></para>
+                
+               <para>Make sure you don't have any JBossMQ files under
+               <literal>$JBOSS_CONFIG/deploy-hasingleton</literal>. For that
+               just remove
+               <literal>$JBOSS_CONFIG/deploy-hasingleton/jms</literal></para>
+                
+            </listitem>
+            <listitem>
+                
+               <para>Add a security policy called "messaging" on
+               $JBOSS_CONFIG/config/login-config.xml. You could use this as an
+               example, or create one according to JBoss Security
+               Documentation:</para>
+                
+               <programlisting>
+&lt;application-policy name = "messaging"&gt;
+&lt;authentication&gt;
+&lt;login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required" &gt;
+   &lt;module-option name = "unauthenticatedIdentity"&gt;guest&lt;/module-option&gt;
+   &lt;module-option name = "usersProperties"&gt;props/messaging-users.properties&lt;/module-option&gt;
+   &lt;module-option name = "rolesProperties"&gt;props/messaging-roles.properties&lt;/module-option&gt;
+&lt;/login-module&gt;
+&lt;/authentication&gt;
+&lt;/application-policy&gt;
+          </programlisting>
+                
+               <para>In case you are using the above policy you should also
+               create files <literal>messaging-users.properties</literal> and
+               <literal>messaging-roles.properties</literal> in the
+               <literal>$JBOSS_CONFIG/config/props/</literal> directory</para>
+                . 
+               <para>
+                  <note>You can find an example
+                  <literal>messaging-users.properties</literal> and
+                  <literal>messaging-roles.properties</literal> in the JBoss
+                  Messaging distribution in the
+                  <literal>&lt;downloadPackage&gt;src/etc/server/default/config</literal>
+                  directory.</note>
+               </para>
+                
+               <programlisting>
+# messaging-roles.properties
+# Add roles as you like
+# user=role1,role2,...
+#
+guest=guest
+          </programlisting>
+                
+               <programlisting>
+# messaging-users.properties
+
+# Add users as you like
+# user=password
+#
+guest=guest
+          </programlisting>
+                
+            </listitem>
+            <listitem>
+               <para>Unzip jboss-messaging.sar from your download package into
+               the directory
+               <literal>JBOSS_CONFIG/deploy/jboss-messaging.sar</literal></para>
+               <para>JBoss Messaging should be deployed unzipped (exploded) so
+               you have easy access to its config files which are stored
+               there.</para>
+            </listitem>
+            <listitem>
+               <para>Copy jboss-messaging.jar from your download package into
+               the directory <literal>JBOSS_CONFIG/lib</literal></para>
+               <para>jboss-messaging.jar needs to go in the lib directory so
+               it is accessible to other services e.g. the JBoss Transactions
+               Recovery Manager</para>
+            </listitem>
+            <listitem>
+               <para><warning>
+                      For a clustered installation it is mandatory that a shared database is available to all nodes in the cluster. The default JBoss AS uses HSQLDB for its database which is a local shared database. Therefore in order to use clustering you must replace this with a different shared database. If the database is not replaced then clustering will not work. 
+                  </warning></para>
+               <itemizedlist>
+                  <listitem>
+                     <para>Replace
+                     <literal>$JBOSS_CONFIG/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml</literal>
+                     by the
+                     <literal>databasename&gt;-persistence-service</literal>
+                     from
+                     <literal>&lt;downloadPackage&gt;/examples/config.</literal>.
+                     For instance
+                     <literal>mysql-persistence-service.xml</literal></para>
+                  </listitem>
+                  <listitem>
+                      
+                     <para>Configure a JCA datasource using an example from
+                     <literal>$JBOSS_HOME/docs/examples/jca</literal></para>
+                      and copying to 
+                     <literal>$JBOSS_CONFIG/deploy</literal>
+                      
+                     <para>JBoss Messaging uses <literal>DefaultDS</literal>
+                     by default so you should configure your datasource to
+                     bind to that</para>
+                      
+                  </listitem>
+                  <listitem>
+                     <para>Remove hsqldb-ds.xml from
+                     <literal>$JBOSS_CONFIG/deploy</literal></para>
+                  </listitem>
+                  <listitem>
+                     <para>Copy your database driver to
+                     <literal>$JBOSS_CONFIG/lib</literal></para>
+                     <para>Your database driver can probably be downloaded
+                     from your database provider's web site</para>
+                  </listitem>
+               </itemizedlist>
+            </listitem>
+            <listitem>
+               <para>Ensure the <literal>ServerPeerID</literal> MBean
+               attribute value in messaging-service.xml is unique for each
+               node on the cluster. The <literal>ServerPeerID</literal> value
+               must be a valid integer.</para>
+               <para><warning>
+                      Each node must have a unique 
+                     <literal>ServerPeerID</literal>
+                      irrespective of whether you are using clustering.
+                  </warning></para>
+            </listitem>
+            <listitem>
+               <para>If you want to run multiple JBoss Messaging nodes on the
+               same box using the same IP address, e.g. for development
+               purposes, then you can use the ServiceBindingManager to do this
+               as follows:</para>
+               <itemizedlist>
+                  <listitem>
+                     <para>Uncomment binding manager service from
+                     $JBOSS_CONFIG/conf/jboss-service.xml</para>
+                  </listitem>
+                  <listitem>
+                     <para>Specify the desired port rage (e.g. ports-01,
+                     ports-02... etc)</para>
+                  </listitem>
+                  <listitem>
+                     <para>Look at
+                     $JBOSS_HOME/docs/examples/binding-manager/sample-bindings.xml.
+                     On each port range, JBoss Remoting configuration should
+                     look like:</para>
+                     <programlisting>
+      &lt;service-config name="jboss.messaging:service=Connector,transport=bisocket"
+                      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"&gt;
+         &lt;delegate-config&gt;
+            &lt;attribute name="Configuration"&gt;&lt;![CDATA[
+	        &lt;config&gt;
+            &lt;invoker transport="bisocket"&gt;
+            
+               &lt;!-- There should be no reason to change these parameters - warning!
+                    Changing them may stop JBoss Messaging working correctly --&gt;            
+               &lt;attribute name="marshaller" isParam="true"&gt;org.jboss.jms.wireformat.JMSWireFormat&lt;/attribute&gt;
+               &lt;attribute name="unmarshaller" isParam="true"&gt;org.jboss.jms.wireformat.JMSWireFormat&lt;/attribute&gt;
+               &lt;attribute name="dataType" isParam="true"&gt;jms&lt;/attribute&gt;
+               &lt;attribute name="socket.check_connection" isParam="true"&gt;false&lt;/attribute&gt;              
+               &lt;attribute name="serverBindAddress"&gt;${jboss.bind.address}&lt;/attribute&gt;
+               &lt;attribute name="serverBindPort"&gt;4657&lt;/attribute&gt;
+               &lt;attribute name="clientSocketClass" isParam="true"&gt;org.jboss.jms.client.remoting.ClientSocketWrapper&lt;/attribute&gt;
+               &lt;attribute name="serverSocketClass" isParam="true"&gt;org.jboss.jms.server.remoting.ServerSocketWrapper&lt;/attribute&gt;
+               &lt;attribute name="numberOfCallRetries" isParam="true"&gt;1&lt;/attribute&gt;
+               &lt;attribute name="pingFrequency" isParam="true"&gt;214748364&lt;/attribute&gt;
+               &lt;attribute name="pingWindowFactor" isParam="true"&gt;10&lt;/attribute&gt;
+               &lt;attribute name="onewayThreadPool"&gt;org.jboss.jms.server.remoting.DirectThreadPool&lt;/attribute&gt;
+               
+               &lt;!-- Periodicity of client pings. Server window by default is twice this figure --&gt;                               
+               &lt;attribute name="clientLeasePeriod" isParam="true"&gt;10000&lt;/attribute&gt;
+
+               &lt;!-- Number of seconds to wait for a connection in the client pool to become free --&gt;
+               &lt;attribute name="numberOfRetries" isParam="true"&gt;10&lt;/attribute&gt;
+
+	       &lt;attribute name="timeout" isParam="true"&gt;0&lt;/attribute&gt;
+	       
+               &lt;!-- Max Number of connections in client pool. This should be significantly higher than
+                    the max number of sessions/consumers you expect --&gt;
+               &lt;attribute name="JBM_clientMaxPoolSize" isParam="true"&gt;200&lt;/attribute&gt;
+               
+               &lt;!-- Use these parameters to specify values for binding and connecting control connections to 
+                    work with your firewall/NAT configuration
+               &lt;attribute name="secondaryBindPort"&gt;xyz&lt;/attribute&gt;                           
+               &lt;attribute name="secondaryConnectPort"&gt;abc&lt;/attribute&gt;               
+               --&gt;
+                              
+            &lt;/invoker&gt;
+            &lt;handlers&gt;
+               &lt;handler subsystem="JMS"&gt;org.jboss.jms.server.remoting.JMSServerInvocationHandler&lt;/handler&gt;
+            &lt;/handlers&gt;
+         &lt;/config&gt;
+            ]]&gt;&lt;/attribute&gt;
+         &lt;/delegate-config&gt;
+         &lt;binding port="4657"/&gt;
+      &lt;/service-config&gt;
+              
+              </programlisting>
+                     <warning>
+                        You must ensure that the config (like above) is identical to that in 
+                        <literal>remoting-bisocket-service.xml</literal>
+                         With the exception of the actual serverBindPort which clearly must be different for each ports range. Please note that the default JBoss Messaging service binding manager bindings in 
+                        <literal>sample-bindings.xml</literal>
+                         shipped with JBAS 4.2.0 may be out of date and you will need to copy the config from 
+                        <literal>remoting-bisocket-service.xml. DO NOT just
+                        copy and paste from the above example - copy it from
+                        the JBoss Messaging distribution.</literal>
+                        
+                        <literal />
+                        
+                        <literal />
+                        
+                        <literal />
+                        
+                     </warning>
+                     <para>You should ensure that each node is configured to
+                     use a different ports range.</para>
+                  </listitem>
+               </itemizedlist>
+            </listitem>
+            <listitem>
+               <para>There are few extra steps at <xref
+               linkend="install.extra-steps" /></para>
+            </listitem>
+            <listitem>
+                That's it 
+            </listitem>
+         </itemizedlist>
+      </section>
+      <section id="install.extra-steps">
+         <title>Extra steps to complete your installation</title>
+         <itemizedlist>
+            <listitem>
+               <para>
+                  <warning>SECURITY RISK! To avoid a security risk, you MUST
+                  specify the value of the attribute SuckerPassword in the
+                  Server Peer config (messaging-service.xml). If you do not
+                  specify a value, the default value will be used. Any person
+                  that knows the default value will be able to access to all
+                  destinations on the server. The password chosen should only
+                  be exposed to administrators</warning>
+               </para>
+            </listitem>
+            <listitem>
+               <para>
+                  <note>JBoss Messaging 1.4.0 requires a patched version of
+                  jboss-remoting.jar. This version is available on JBoss EAP 4.3, so if you're using a different version of JBoss you should download the patched version which can be found <ulink
+                  url="http://repository.jboss.com/jboss/remoting/2.2.2.SP8-brew/ ">here</ulink>The
+                  version is JBoss Remoting 2.2.2.SP8-brew. Please download it
+                  and copy it into the <literal>$JBOSS_HOME/server/&lt;your
+                  server name&gt;/lib directory</literal> of any server
+                  profiles that use JBoss Messaging 1.4.0. If you are using
+                  JBoss Messaging from a standalone client also make sure this
+                  jar is on your classpath *before*
+                  jbossall-client.jar.</note>
+               </para>
+            </listitem>
+            <para>You should also make these changes on any configuration you
+            choose, to remove all references to the old JBossMQ:</para>
+            <listitem>
+               <para>Edit <literal>$JBOSS_CONFIG/deploy/jms-ds.xml</literal>
+               and replace jboss.mq by jboss.messaging on every
+               occurrence</para>
+               <para>If you are in a clustered installation, then do the above
+               with the file
+               <literal>$JBOSS_CONFIG/deploy/hajndi-jms-ds.xml</literal></para>
+            </listitem>
+            <listitem>
+               <para>Edit
+               <literal>$JBOSS_CONFIG/conf/standardjboss.xml</literal> and set
+               <literal>CreateJBossMQDestination</literal> to false on every
+               occurrence</para>
+               <para>Make sure it looks like this:</para>
+               <para>
+                  <literal>&lt;CreateJBossMQDestination&gt;false&lt;/CreateJBossMQDestination&gt;</literal>
+               </para>
+               <para>Those Proxies will try to create a Destination on JBossMQ
+               if they can't find it on JNDI, what would cause some errors
+               related to JBoss MQ.</para>
+            </listitem>
+            <listitem>
+               <para>Edit $JBOSS_CONFIG/conf/jboss-service.xml and remove the
+               reference to JBoss MQ on JSR-77 Management Bean:</para>
+               <programlisting>
+ &lt;!-- ==================================================================== --&gt;
+ &lt;!-- JSR-77 Single JBoss Server Management Domain                         --&gt;
+ &lt;!-- ==================================================================== --&gt;
+ &lt;mbean code="org.jboss.management.j2ee.LocalJBossServerDomain"
+
+  ... Remove this line ...
+ &lt;attribute name="JMSService"&gt;jboss.mq:service=DestinationManager&lt;/attribute&gt;
+             </programlisting>
+            </listitem>
+            <listitem>
+               <para>Change
+               <literal>$JBOSS_CONFIG/conf/login-config.xml</literal> and
+               remove jboss-mq security policies</para>
+               <programlisting>
+### Remove these lines:
+
+&lt;!-- Security domain for JBossMQ --&gt;
+&lt;application-policy name = "jbossmq"&gt;
+ &lt;authentication&gt;
+    &lt;login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
+       flag = "required"&gt;
+       &lt;module-option name = "unauthenticatedIdentity"&gt;guest&lt;/module-option&gt;
+       &lt;module-option name = "dsJndiName"&gt;java:/DefaultDS&lt;/module-option&gt;
+       &lt;module-option name = "principalsQuery"&gt;
+             SELECT PASSWD FROM JMS_USERS WHERE USERID=?&lt;/module-option&gt;
+       &lt;module-option name = "rolesQuery"&gt;
+             SELECT ROLEID, 'Roles' FROM JMS_ROLES WHERE USERID=?&lt;/module-option&gt;
+    &lt;/login-module&gt;
+ &lt;/authentication&gt;
+&lt;/application-policy&gt;
+
+&lt;!-- Security domain for JBossMQ when using file-state-service.xml
+&lt;application-policy name = "jbossmq"&gt;
+ &lt;authentication&gt;
+    &lt;login-module code = "org.jboss.mq.sm.file.DynamicLoginModule"
+       flag = "required"&gt;
+       &lt;module-option name = "unauthenticatedIdentity"&gt;guest&lt;/module-option&gt;
+       &lt;module-option name = "sm.objectname"&gt;jboss.mq:service=StateManager&lt;/module-option&gt;
+    &lt;/login-module&gt;
+ &lt;/authentication&gt;
+&lt;/application-policy&gt;
+--&gt;
+             
+            </programlisting>
+            </listitem>
+         </itemizedlist>
+      </section>
+   </section>
+   <section id="startingtheservice">
+      <title>Starting the Server</title>
+      <para>To run the server, execute the <filename>run.bat</filename> or
+      <filename>run.sh</filename> script as appropriate for your operating
+      system, in the <filename>$JBOSS_HOME/bin</filename> directory.</para>
+      <programlisting>
+cd $JBOSS_HOME/bin
+./run.sh -c &lt;config name&gt;
+   </programlisting>
+      <para>Where config_name is the name of the JBoss AS configuration where
+      you have installed messaging. (The default is 'messaging')</para>
+      <para>A successful JBoss Messaging deployment generates logging output
+      similar to for a non clustered installation (for a clustered
+      installation you will also see extra cluster related output)</para>
+      <programlisting>
+....
+13:19:14,914 WARN  [JDBCPersistenceManager] 
+
+JBoss Messaging Warning: DataSource connection transaction isolation should be READ_COMMITTED,
+but it is currently NONE.
+                         Using an isolation level less strict than READ_COMMITTED may lead to
+data consistency problems.
+                         Using an isolation level more strict than READ_COMMITTED may lead to
+deadlock.
+
+13:19:15,166 INFO  [ServerPeer] JBoss Messaging 1.4.0.GA server [0] started
+13:19:15,411 INFO  [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled
+, lease period 10000 milliseconds
+13:19:15,412 INFO  [ConnectionFactory] [/ConnectionFactory, /XAConnectionFactory, java:/Connec
+tionFactory, java:/XAConnectionFactory] started
+13:19:15,412 WARN  [ConnectionFactoryJNDIMapper] supportsFailover attribute is true on connect
+ion factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but
+post office is non clustered. So connection factory will *not* support failover
+13:19:15,413 WARN  [ConnectionFactoryJNDIMapper] supportsLoadBalancing attribute is true on co
+nnection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory
+but post office is non clustered. So connection factory will *not* support load balanc
+ing
+13:19:15,449 INFO  [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled
+, lease period 10000 milliseconds
+13:19:15,449 INFO  [ConnectionFactory] [/ClusteredConnectionFactory, /ClusteredXAConnectionFac
+tory, java:/ClusteredConnectionFactory, java:/ClusteredXAConnectionFactory] started
+13:19:15,468 INFO  [QueueService] Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, d
+ownCacheSize=2000
+13:19:15,474 INFO  [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize
+=2000, downCacheSize=2000
+13:19:15,476 INFO  [TopicService] Topic[/topic/testTopic] started, fullSize=200000, pageSize=2
+000, downCacheSize=2000
+13:19:15,478 INFO  [TopicService] Topic[/topic/securedTopic] started, fullSize=200000, pageSiz
+e=2000, downCacheSize=2000
+13:19:15,479 INFO  [TopicService] Topic[/topic/testDurableTopic] started, fullSize=200000, pag
+eSize=2000, downCacheSize=2000
+13:19:15,482 INFO  [QueueService] Queue[/queue/testQueue] started, fullSize=200000, pageSize=2
+000, downCacheSize=2000
+13:19:15,483 INFO  [QueueService] Queue[/queue/A] started, fullSize=200000, pageSize=2000, dow
+nCacheSize=2000
+13:19:15,485 INFO  [QueueService] Queue[/queue/B] started, fullSize=200000, pageSize=2000, dow
+nCacheSize=2000
+13:19:15,487 INFO  [QueueService] Queue[/queue/C] started, fullSize=200000, pageSize=2000, dow
+nCacheSize=2000
+13:19:15,489 INFO  [QueueService] Queue[/queue/D] started, fullSize=200000, pageSize=2000, dow
+nCacheSize=2000
+13:19:15,490 INFO  [QueueService] Queue[/queue/ex] started, fullSize=200000, pageSize=2000, do
+wnCacheSize=2000
+13:19:15,501 INFO  [QueueService] Queue[/queue/PrivateDLQ] started, fullSize=200000, pageSize=
+2000, downCacheSize=2000
+13:19:15,503 INFO  [QueueService] Queue[/queue/PrivateExpiryQueue] started, fullSize=200000, p
+ageSize=2000, downCacheSize=2000
+13:19:15,507 INFO  [QueueService] Queue[/queue/QueueWithOwnDLQAndExpiryQueue] started, fullSiz
+e=200000, pageSize=2000, downCacheSize=2000
+13:19:15,508 INFO  [TopicService] Topic[/topic/TopicWithOwnDLQAndExpiryQueue] started, fullSiz
+e=200000, pageSize=2000, downCacheSize=2000
+13:19:15,511 INFO  [QueueService] Queue[/queue/QueueWithOwnRedeliveryDelay] started, fullSize=
+200000, pageSize=2000, downCacheSize=2000
+13:19:15,512 INFO  [TopicService] Topic[/topic/TopicWithOwnRedeliveryDelay] started, fullSize=
+200000, pageSize=2000, downCacheSize=2000
+13:19:15,514 INFO  [QueueService] Queue[/queue/testDistributedQueue] started, fullSize=200000,
+pageSize=2000, downCacheSize=2000
+13:19:15,519 INFO  [TopicService] Topic[/topic/testDistributedTopic] started, fullSize=200000,
+pageSize=2000, downCacheSize=2000
+13:19:15,809 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:servic
+e=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
+13:19:15,834 INFO  [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-consol
+e.war/
+13:19:16,322 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
+13:19:16,342 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
+13:19:16,480 INFO  [Server] JBoss (MX MicroKernel) [4.2.0.GA (build: SVNTag=JBoss_4_2_0_GA dat
+e=200705111440)] Started in 19s:359ms
+
+   </programlisting>
+      <note>
+          The warning message 
+         <literal>"DataSource connection transaction isolation should be
+         READ_COMMITTED, but it is currently NONE"</literal>
+          is there to remind you that by default JBossAS ships with Hypersonic, an in-memory Java-based database engine, which is apropriate for demo purposes, but not for heavy load production environments. The 
+         <ulink
+         url="http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigJBossMQDB">Critique
+         of Hypersonic</ulink>
+          wiki page outlines some of the well-known issues occuring when using this database. 
+      </note>
+      <warning>
+          Before using Messaging in production, you 
+         <emphasis>must</emphasis>
+          configure the Messaging instance to use an enterprise-class database backend such as Oracle, Sybase, PostgreSQL, MS SQL or MySQL, otherwise you risk losing your data. See 
+         <xref linkend="conf.changingds" />
+          for details about replacing Hypersonic. 
+      </warning>
+   </section>
+   <section id="inst.validation">
+      <title>Installation Validation</title>
+      <para>The release bundle contains a series of examples that should run
+      "out of the box" and could be used to validate a new installation. Such
+      an example sends a persistent JMS message to a queue called
+      <literal>queue/testQueue</literal>.</para>
+      <para>To run the example and validate the installation, open an new
+      command line window and set the <literal>JBOSS_HOME</literal>
+      environment variable to point to the JBoss AS 4.x installation you've
+      just installed Messaging on. Navigate to the folder where you extracted
+      the release bundle and drill down to
+      <filename>/examples/queue</filename>. Apache Ant must pe present in your
+      path in order to be able to run the example.</para>
+      <para>Make sure you start the JBoss server before trying to run the
+      tests</para>
+      <programlisting>
+
+setenv JBOSS_HOME=&lt;your_JBoss_installation&gt;
+cd .../examples/queue
+$ant
+
+   </programlisting>
+      <para>A successfull execution log output looks similar to:</para>
+      <programlisting>
+[tim at Vigor14 queue]$ ant
+Buildfile: build.xml
+
+identify:
+     [echo] ###########################################################################
+     [echo] #                       Running the QUEUE example                         #
+     [echo] ###########################################################################
+     [echo] The queue:      testQueue
+     [echo] The client jar: ../../../output/lib/jboss-messaging-client.jar
+
+sanity-check:
+
+init:
+    [mkdir] Created dir: /home/tim/dev/jboss-messaging/trunk/docs/examples/queue/output/classe
+s
+    [mkdir] Created dir: /home/tim/dev/jboss-messaging/trunk/docs/examples/common/output/class
+es
+
+compile:
+    [javac] Compiling 5 source files to /home/tim/dev/jboss-messaging/trunk/docs/examples/comm
+on/output/classes
+    [javac] Compiling 1 source file to /home/tim/dev/jboss-messaging/trunk/docs/examples/queue
+/output/classes
+
+run:
+     [java] Queue /queue/testQueue exists
+     [java] The message was successfully sent to the testQueue queue
+     [java] Received message: Hello!
+     [java] The example connected to JBoss Messaging version 1.4.0.GA (1.4)
+
+     [java] #####################
+     [java] ###    SUCCESS!   ###
+     [java] #####################
+
+BUILD SUCCESSFUL
+Total time: 5 seconds
+[tim at Vigor14 queue]$
+
+</programlisting>
+      <para>It is recommended to run <literal>all</literal> validation
+      examples available in the <filename>example</filename> directory
+      (<filename>queue</filename>, <filename>topic</filename>,
+      <filename>mdb</filename>, <filename>stateless</filename>, etc.). In
+      <xref linkend="examples" />, we will have a look at each of those
+      examples.</para>
+   </section>
+   <section id="inst.remoteclient">
+      <title>Accessing JBoss Messaging from a remote client</title>
+      <para>In order to access JBoss Messaging from a client outside the JBoss
+      app server, you will need to ensure the following jar files are on the
+      client classpath:</para>
+      <itemizedlist>
+         <listitem>
+            <para><note>
+                   JBoss Messaging 1.4.0 requires a patched version of jboss-remoting.jar. The version is JBoss Remoting 2.2.2.SP8-brew. This version is available on JBoss EAP 4.3, so if you're using a different version you should download it. The patched jar can be found 
+                  <ulink
+                  url="http://repository.jboss.com/jboss/remoting/2.2.2.SP8-brew/lib/">here</ulink>
+                   . Please download it and make sure this jar is on your classpath *before* jbossall-client.jar. 
+               </note></para>
+         </listitem>
+         <listitem>
+            <para>jboss-messaging-client.jar - This is available in the
+            messaging distribution</para>
+         </listitem>
+         <listitem>
+            <para>jbossall-client.jar - This is available in your
+            $JBOSS_HOME/client directory</para>
+         </listitem>
+         <listitem>
+            <para>$JBOSS_HOME/server/&lt;SERVER_NAME&gt;/deploy/jboss-aop.deployer/jboss-aop.jar</para>
+            <para>JBoss AOP 1.5.5.GA+</para>
+            <para><ulink
+            url="http://repository.jboss.com/jboss/aop/1.5.5.GA/lib/">http://repository.jboss.com/jboss/aop/1.5.5.GA/lib/</ulink></para>
+            <para>(For AOP, sometimes you have to use a specific JAR according
+            to your JVM of choice. Use the most convenient for you)</para>
+         </listitem>
+         <listitem>
+            <para>$JBOSS_HOME/server/&lt;SERVER_NAME&gt;/lib/javassist.jar</para>
+            <para>Javassist 3.5.0.GA-brew+</para>
+            <para><ulink
+            url="http://repository.jboss.com/javassist/3.5.0.GA-brew/lib/">http://repository.jboss.com/javassist/3.5.0.GA-brew/lib/</ulink></para>
+         </listitem>
+         <listitem>
+            <para>$JBOSS_HOME/server/&lt;SERVER_NAME&gt;/lib/trove.jar</para>
+            <para>trove 1.0.2-brew</para>
+            <para><ulink
+            url="http://repository.jboss.com/trove/1.0.2-brew/lib/">http://repository.jboss.com/trove/1.0.2-brew/lib/</ulink></para>
+         </listitem>
+         <listitem>
+            <para>log4j</para>
+         </listitem>
+      </itemizedlist>
+   </section>
+   <section id="inst.mqmessagemigration">
+      <title>Migrating Messages from JBoss MQ to JBoss Messaging</title>
+      <para>This configuration will allow you to migrate your systems using JBossMQ to JBM(JBoss Messaging).
+         Many Enterprise systems are complex and have multiple applications and can't be migrated from JBossMQ to
+         JBM all at one time.</para>
+      <para>Made up Use Case: For instance, your business is selling items, some you make directly and some you farm
+         out to other distributors. Your ordering system is JBossMQ based. Customers place orders that are then queued
+         up to be processed(via JBossMQ). You also use MQ to queue up the orders that you need to produce and you also
+         queue up the orders that will go to your other distributors. You use MDB's in three separate places in your
+         operation. You want to do a staged migration from JBossMQ to JBM. That requires that JBossMQ and JBM work
+         together. This is exactly what the JBM bridge was meant to do. It's meant to take messages from one queue/topic
+         and transfer them to another queue/topic. This helps with the migration by allowing you to pull messages from
+         your JBossMQ queues automatically and push them into your JBM Queues. You can also do the opposite, you can
+         push messages from your JBM system to your JBossMQ system. In our example, we want to replace the ordering
+         side(producer) with JBM. We push messages into the JBM Order queue, but we set the bridge up to send all of
+         those messages to the JBossMQ Order queue. The rest of your processing happens as normal. Lets say you want
+         to leave your ordering system intact, but you want to have JBM and EJB3 MDBs process the orders. You can have
+         your old client put messages in JBossMQ as normal, but you set the bridge up to pull the messages from JBossMQ
+         Order queue and push them into the JBM Order queue.</para>
+      <para>This allows JBM and JBossMQ to interact together by pushing messages back and forth between different systems.</para>
+      <para>The Following Assumptions are made:</para>
+      <itemizedlist>
+         <listitem>You have one JBoss instance set up for JBoss Messaging and One Jboss instance set up that has your old JBoss MQ on it.</listitem>
+         <listitem>We are copying messages from JBossMQ(Source) to JBM(Target)</listitem>
+      </itemizedlist>
+      <section id="inst.mqmessagemigration.steps">
+         <title>Steps to Set up the bridge</title>
+         <itemizedlist>
+            <listitem>
+               <para>Copy the jbossmq.jar from the Source Machine(JBossMQ) under the server/default/lib/ to the
+                  messaging configuration on the Target JBM machine(server/messaging/lib)</para>
+               <note>substitute what ever your messaging server configuration is above. I used the default stand alone
+                  messaging server configuration note: This is required to dereference the JBossMQ objects that are
+                  dereferenced on the JBM side. If you don't copy the jar over, you will get a
+                  "java.lang.ClassCastException: javax.naming.Reference" exception and the bridge will not be able to start</note>
+            </listitem>
+            <listitem><para>Add the remote JBossMQ provider to the jms-ds.xml file in the server/messaging/deploy
+               directory on your target(JBM) machine.</para>
+               <para>Here is an example of the provider to add.</para>
+            <programlisting>
+&lt;mbean code="org.jboss.jms.jndi.JMSProviderLoader"
+               name="jboss.messaging:service=JMSProviderLoader,
+               name=MyRemoteJMSProvider"&gt;
+  &lt;attribute name="ProviderName"&gt;RemoteXAConnectionFactory&lt;/attribute&gt;
+  &lt;attribute name="ProviderAdapterClass"&gt;org.jboss.jms.jndi.JNDIProviderAdapter&lt;/attribute&gt;
+  &lt;!-- The combined connection factory --&gt;
+  &lt;attribute name="FactoryRef"&gt;XAConnectionFactory&lt;/attribute&gt;
+  &lt;!-- The queue connection factory --&gt;
+  &lt;attribute name="QueueFactoryRef"&gt;XAConnectionFactory&lt;/attribute&gt;
+  &lt;!-- The topic factory --&gt;
+  &lt;attribute name="TopicFactoryRef"&gt;XAConnectionFactory&lt;/attribute&gt;
+  &lt;attribute name="Properties"&gt;
+     java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+     java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+     java.naming.provider.url=192.168.0.199:1099
+  &lt;/attribute&gt;
+&lt;/mbean&gt;
+            </programlisting>
+               <note>you will need to change the java.naming.provider.url so that it points to your JBossMQ machine.
+                  Everything else should remain the same. Keep your jms-ds.xml file open, because you will be addning
+                  another entry in it for the next step.</note>
+            </listitem>
+            <listitem>
+               <para>Add the Bridge provider to the jms-ds.xml file in the server/messaging/deploy directory on your
+                  target(JBM) machine.</para>
+               <para>Here is an example bridge configuration</para>
+               <programlisting>
+&lt;mbean code="org.jboss.jms.server.bridge.BridgeService"
+                  name="jboss.messaging:service=Bridge,name=TestBridge"
+                  xmbean-dd="xmdesc/Bridge-xmbean.xml"&gt;
+     &lt;depends optional-attribute-name="SourceProviderLoader"&gt;
+                  jboss.messaging:service=JMSProviderLoader,
+                  name=MyRemoteJMSProvider&lt;/depends&gt;
+     &lt;depends optional-attribute-name="TargetProviderLoader"&gt;
+                  jboss.messaging:service=JMSProviderLoader,
+                  name=JMSProvider&lt;/depends&gt;
+     &lt;attribute name="SourceDestinationLookup"&gt;/queue/testQueue&lt;/attribute&gt;
+     &lt;attribute name="TargetDestinationLookup"&gt;/queue/A&lt;/attribute&gt;
+     &lt;attribute name="QualityOfServiceMode"&gt;0&lt;/attribute&gt;
+     &lt;attribute name="MaxBatchSize"&gt;5&lt;/attribute&gt;
+     &lt;attribute name="MaxBatchTime"&gt;-1&lt;/attribute&gt;
+     &lt;attribute name="FailureRetryInterval"&gt;5000&lt;/attribute&gt;
+     &lt;attribute name="MaxRetries"&gt;-1&lt;/attribute&gt;
+     &lt;attribute name="AddMessageIDInHeader"&gt;false&lt;/attribute&gt;
+&lt;/mbean&gt;                  
+               </programlisting>
+               <note>my target is the current JBM JMS Provider and the source is the JBossMQ remote provider. If you
+                  have a pretty stock system and you want to move messages from JBossMQ to JBM, you will not have to
+                  change this example except for the queue Names. If you wish to move from JBM to JBossMQ, just switch
+                  the soure and target definitions.</note>
+            </listitem>
+         </itemizedlist>
+         <para>Start the JBossMQ system and then just start the JBM system and the messages will begin to move over.</para>
+         <para>The following is an example of the jms-ds.xml file that was used for the test. If you want to test the bridge first 
+            and you have a stock JBM system(JBM has been installed using the default configuration), then you can just
+            copy the jms-ds.xml file over the one in server/messaging/deploy and begin to put messages in the JBossMQ
+            system under the /queue/TestQueue. The messages will then be moved over to your JBM queue /queue/A. Both of
+            these queues exist in the stock versions of JBM and JBossMQ.</para>
+      </section>
+      <programlisting>
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+
+&lt;connection-factories&gt;
+
+  &lt;!-- ==================================================================== --&gt;
+  &lt;!-- JMS Stuff                                                            --&gt;
+  &lt;!-- ==================================================================== --&gt;
+
+  &lt;!-- The JMS provider loader --&gt;
+  &lt;mbean code="org.jboss.jms.jndi.JMSProviderLoader"
+    name="jboss.messaging:service=JMSProviderLoader,name=JMSProvider"&gt;
+    &lt;attribute name="ProviderName"&gt;DefaultJMSProvider&lt;/attribute&gt;
+
+    &lt;attribute name="ProviderAdapterClass"&gt;
+      org.jboss.jms.jndi.JNDIProviderAdapter
+    &lt;/attribute&gt;
+    &lt;!-- The combined connection factory --&gt;
+    &lt;attribute name="FactoryRef"&gt;java:/XAConnectionFactory&lt;/attribute&gt;
+    &lt;!-- The queue connection factory --&gt;
+    &lt;attribute name="QueueFactoryRef"&gt;java:/XAConnectionFactory&lt;/attribute&gt;
+    &lt;!-- The topic factory --&gt;
+
+    &lt;attribute name="TopicFactoryRef"&gt;java:/XAConnectionFactory&lt;/attribute&gt;
+    &lt;!-- Uncomment to use HAJNDI to access JMS
+    &lt;attribute name="Properties"&gt;
+       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+       java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+       java.naming.provider.url=localhost:1100
+    &lt;/attribute&gt;
+    --&gt;
+  &lt;/mbean&gt;
+
+
+&lt;mbean code="org.jboss.jms.jndi.JMSProviderLoader"
+         name="jboss.messaging:service=JMSProviderLoader,
+         name=MyRemoteJMSProvider"&gt;
+     &lt;attribute name="ProviderName"&gt;RemoteXAConnectionFactory&lt;/attribute&gt;
+     &lt;attribute name="ProviderAdapterClass"&gt;org.jboss.jms.jndi.JNDIProviderAdapter&lt;/attribute&gt;
+     &lt;!-- The combined connection factory --&gt;
+
+     &lt;attribute name="FactoryRef"&gt;XAConnectionFactory&lt;/attribute&gt;
+     &lt;!-- The queue connection factory --&gt;
+     &lt;attribute name="QueueFactoryRef"&gt;XAConnectionFactory&lt;/attribute&gt;
+     &lt;!-- The topic factory --&gt;
+     &lt;attribute name="TopicFactoryRef"&gt;XAConnectionFactory&lt;/attribute&gt;
+     &lt;attribute name="Properties"&gt;
+        java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+        java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+        java.naming.provider.url=192.168.0.199:1099
+     &lt;/attribute&gt;
+
+&lt;/mbean&gt;
+
+&lt;mbean code="org.jboss.jms.server.bridge.BridgeService"
+         name="jboss.messaging:service=Bridge,name=TestBridge"
+         xmbean-dd="xmdesc/Bridge-xmbean.xml"&gt;
+     &lt;depends optional-attribute-name="SourceProviderLoader"&gt;
+         jboss.messaging:service=JMSProviderLoader,
+         name=MyRemoteJMSProvider&lt;/depends&gt;
+     &lt;depends optional-attribute-name="TargetProviderLoader"&gt;
+         jboss.messaging:service=JMSProviderLoader,
+         name=JMSProvider&lt;/depends&gt;
+     &lt;attribute name="SourceDestinationLookup"&gt;/queue/testQueue&lt;/attribute&gt;
+     &lt;attribute name="TargetDestinationLookup"&gt;/queue/A&lt;/attribute&gt;
+     &lt;attribute name="QualityOfServiceMode"&gt;0&lt;/attribute&gt;
+
+     &lt;attribute name="MaxBatchSize"&gt;5&lt;/attribute&gt;
+     &lt;attribute name="MaxBatchTime"&gt;-1&lt;/attribute&gt;
+     &lt;attribute name="FailureRetryInterval"&gt;5000&lt;/attribute&gt;
+     &lt;attribute name="MaxRetries"&gt;-1&lt;/attribute&gt;
+     &lt;attribute name="AddMessageIDInHeader"&gt;false&lt;/attribute&gt;
+&lt;/mbean&gt;
+
+  &lt;!-- The server session pool for Message Driven Beans --&gt;
+  &lt;mbean code="org.jboss.jms.asf.ServerSessionPoolLoader"
+    name="jboss.messaging:service=ServerSessionPoolMBean,name=StdJMSPool"&gt;
+    &lt;depends optional-attribute-name="XidFactory"&gt;jboss:service=XidFactory&lt;/depends&gt;
+    &lt;attribute name="PoolName"&gt;StdJMSPool&lt;/attribute&gt;
+    &lt;attribute name="PoolFactoryClass"&gt;
+      org.jboss.jms.asf.StdServerSessionPoolFactory
+    &lt;/attribute&gt;
+  &lt;/mbean&gt;
+
+  &lt;!-- JMS XA Resource adapter, use this to get transacted JMS in beans --&gt;
+  &lt;tx-connection-factory&gt;
+    &lt;jndi-name&gt;JmsXA&lt;/jndi-name&gt;
+    &lt;xa-transaction/&gt;
+    &lt;rar-name&gt;jms-ra.rar&lt;/rar-name&gt;
+    &lt;connection-definition&gt;org.jboss.resource.adapter.jms.JmsConnectionFactory
+         &lt;/connection-definition&gt;
+    &lt;config-property name="SessionDefaultType" type="java.lang.String"&gt;javax.jms.Topic
+         &lt;/config-property&gt;
+
+    &lt;config-property name="JmsProviderAdapterJNDI" type="java.lang.String"&gt;
+         java:/DefaultJMSProvider&lt;/config-property&gt;
+    &lt;max-pool-size&gt;20&lt;/max-pool-size&gt;
+    &lt;security-domain-and-application&gt;JmsXARealm&lt;/security-domain-and-application&gt;
+  &lt;/tx-connection-factory&gt;
+
+&lt;/connection-factories&gt;
+
+      </programlisting>
+      <para>You can also merge topics back and forth from JBM to JBossMQ, by setting the subscription name and client id.
+         You can see these arguments in the JBM Bridge chapter. </para>
+   </section>
+</chapter>

Added: projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/introduction.xml
===================================================================
--- projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/introduction.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/introduction.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="introduction">
+   <title>Introduction</title>
+
+   <para>JBoss Messaging provides an open source and standards-based messaging
+   platform that brings enterprise-class messaging to the mass market.</para>
+
+   <para>JBoss Messaging implements a high performance, robust messaging core
+   that is designed to support the largest and most heavily utilized SOAs,
+   enterprise service buses (ESBs) and other integration needs ranging from
+   the simplest to the highest demand networks.</para>
+
+   <para>It will allow you to smoothly distribute your application load across
+   your cluster, intelligently balancing and utilizing each nodes CPU cycles,
+   with no single point of failure, providing a highly scalable and performant
+   clustering implementation.</para>
+
+   <para>JBoss Messaging includes a JMS front-end to deliver messaging in a
+   standards-based format as well as being designed to be able to support
+   other messaging protocols in the future.</para>
+
+	<note>
+		<para>JBoss Messaging 1.4 is the default JMS provider in JBoss Enterprise Application Platform 4.3.</para>
+	</note>
+
+   <section id="features">
+      <title>JBoss Messaging Features</title>
+
+      <para>JBoss Messaging provides:</para>
+
+      <itemizedlist>
+         <listitem>
+            <para>A fully compatible and Sun certified JMS 1.1 implementation,
+            that currently works with a standard 4.2 or later JBoss
+            Application Server installation.</para>
+         </listitem>
+
+         <listitem>
+            <para>A strong focus on performance, reliability and scalability
+            with high throughput and low latency.</para>
+         </listitem>
+
+         <listitem>
+            <para>A foundation for JBoss ESB for SOA initiatives; JBoss ESB
+            uses JBoss Messaging as its default JMS provider.</para>
+         </listitem>
+      </itemizedlist>
+
+      <para>Other JBoss Messaging features include:</para>
+
+      <itemizedlist>
+         <listitem>
+            <para>Publish-subscribe and point-to-point messaging models</para>
+         </listitem>
+
+         <listitem>
+            <para>Persistent and non-persistent messages</para>
+         </listitem>
+
+         <listitem>
+            <para>Guaranteed message delivery that ensures that messages
+            arrive once and only once where required</para>
+         </listitem>
+
+         <listitem>
+            <para>Transactional and reliable - supporting ACID
+            semantics</para>
+         </listitem>
+
+         <listitem>
+            <para>Customizable security framework based on JAAS</para>
+         </listitem>
+
+         <listitem>
+            <para>Fully integrated with JBoss Transactions (formerly known as
+            Arjuna JTA) for full transaction recoverability.</para>
+         </listitem>
+
+         <listitem>
+            <para>Extensive JMX management interface</para>
+         </listitem>
+
+         <listitem>
+            <para>Support for most major databases including Oracle, Sybase,
+            MS SQL Server, PostgreSQL and MySQL</para>
+         </listitem>
+
+         <listitem>
+            <para>HTTP transport to allow use through firewalls that only
+            allow HTTP traffic</para>
+         </listitem>
+
+         <listitem>
+            <para>SSL transport</para>
+         </listitem>
+
+         <listitem>
+            <para>Configurable DLQs (Dead Letter Queues) and Expiry
+            Queues</para>
+         </listitem>
+
+         <listitem>
+            <para>Message statistics. Gives you a rolling historical view of
+            what messages were delivered to what queues and
+            subscriptions</para>
+         </listitem>
+
+         <listitem>
+            <para>Automatic paging of messages to storage. Allows the use of
+            very large queues - too large to fit in memory at once</para>
+         </listitem>
+      </itemizedlist>
+
+      <para>Clustering features:</para>
+
+      <itemizedlist>
+         <listitem>
+            <para>Fully clustered queues and topics. "Logical" queues and
+            topics are distributed across the cluster. You can send to a queue
+            or a topic from any node, and receive from any other.</para>
+         </listitem>
+
+         <listitem>
+            <para>Fully clustered durable subscriptions. A particular durable
+            subscription can be accessed from any node of the cluster -
+            allowing you to spread processing load from that subscription
+            across the cluster.</para>
+         </listitem>
+
+         <listitem>
+            <para>Fully clustered temporary queues. Send a message with a
+            replyTo of a temp queue and it can be sent back on any node of the
+            cluster.</para>
+         </listitem>
+
+         <listitem>
+            <para>Intelligent message redistribution. Messages are
+            automatically moved between different nodes of the cluster if
+            consumers are faster on one node than another. This can help
+            prevent starvation or build up of messages on particular
+            nodes.</para>
+         </listitem>
+
+         <listitem>
+            <para>Message order protection. If you want to ensure that the
+            order of messages produced by a producer is the same as is
+            consumed by a consumer then you can set this to true. This works
+            even in the presence of message redistribution.</para>
+         </listitem>
+
+         <listitem>
+            <para>Fully transparent failover. When a server fails, your
+            sessions continue without exceptions on a new node as if nothing
+            happened. (Fully configurable - If you don't want this you can
+            fall back to exceptions being thrown and manually recreation of
+            connections on another node)</para>
+         </listitem>
+
+         <listitem>
+            <para>High availability and seamless fail-over. If the node you
+            are connected to fails, you will automatically fail over to
+            another node and will not lose any persistent messages. You can
+            carry on with your session seamlessly where you left off. Once and
+            only once delivery of persistent messages is respected at all
+            times.</para>
+         </listitem>
+
+         <listitem>
+            <para>Message bridge. JBoss Messaging contains a message bridge
+            component which enables you to bridge messages between any two
+            JMS1.1 destinations on the same or physical separate locations.
+            (E.g. separated by a WAN). This allows you to connect
+            geographically separate clusters, forming huge globally
+            distributed logical queues and topics.</para>
+         </listitem>
+      </itemizedlist>
+   </section>
+
+   <section id="compatibility">
+      <title>Compatibility with JBossMQ</title>
+
+      <para>JBoss MQ is the JMS implementation currently shipped within JBoss
+      AS. Since JBoss Messaging is JMS 1.1 and JMS 1.0.2b compatible, the JMS
+      code written against JBossMQ will run with JBoss Messaging without any
+      changes.</para>
+
+      <para>JBoss Messaging does not have wire format compatibility with JBoss
+      MQ so it would be necessary to upgrade JBoss MQ clients with JBoss
+      Messaging client jars</para>
+
+      <important>
+<para>
+             Even if JBoss Messaging deployment descriptors are very similar to JBoss MQ deployment descriptors, they are 
+
+            <emphasis>not</emphasis>
+
+             identical, so they will require some simple adjustments to get them to work with JBoss Messaging. Also, the database data model is completely different, so don't attempt to use JBoss Messaging with a JBoss MQ data schema and vice-versa. 
+</para>
+         </important>
+   </section>
+<section id="introduction-Feedback">
+		<title>Feedback</title>
+		<para>
+			If you spot a typo in this guide, or if you have thought of a way to make this manual better, we would love to hear from you! Submit a report in <ulink url="http://jira.jboss.com/jira/browse/JBPAPP">JIRA</ulink> against the Product: JBoss Enterprise Application Platform, Version: <replaceable>&lt;version&gt;</replaceable>, Component: <emphasis>Doc</emphasis>. If you have a suggestion for improving the documentation, try to be as specific as possible. If you have found an error, include the section number and some of the surrounding text so we can find it easily.
+		</para>
+	</section>
+	
+	<section id="introduction-Other_Manuals">
+		<title>Other Manuals</title>
+		<para>
+			If you are looking for detailed product information refer to the manuals available online at <ulink url="http://www.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/"></ulink>.
+		</para>
+	</section>
+</chapter>

Added: projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/recoveryconfig.xml
===================================================================
--- projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/recoveryconfig.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/recoveryconfig.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="recovery">
+   <title>JBoss Messaging XA Recovery Configuration</title>
+   <para>This section describes how to configure JBoss Transactions in JBoss
+   AS 4.2.0 to handle XA recovery for JBoss Messaging resources.</para>
+   <para>JBoss Transactions recovery manager can easily be configured to
+   continually poll for and recover JBoss Messaging XA resources, this
+   provides an extremely high level of durability of transactions.</para>
+   <para>Enabling JBoss Transactions Recovery Manager to recover JBoss
+   Messaging resources is a very simple matter and involves adding a line to
+   the file ${JBOSS_CONFIG}/conf/jbossjta-properties.xml</para>
+   <para>Here's an example section of a jbossjta-properties.xml file with the
+   line added (note the whole file is not shown)</para>
+   <programlisting>
+     &lt;properties depends="arjuna" name="jta"&gt;
+        &lt;!--
+        Support subtransactions in the JTA layer?
+        Default is NO.
+        --&gt;
+        &lt;property name="com.arjuna.ats.jta.supportSubtransactions" value="NO"/&gt;
+        &lt;property name="com.arjuna.ats.jta.jtaTMImplementation"
+           value="com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple"/&gt;
+        &lt;property name="com.arjuna.ats.jta.jtaUTImplementation"
+           value="com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple"/&gt;      
+        &lt;!--
+           *** Add this line to enable recovery for JMS resources using DefaultJMSProvider ***
+        --&gt;
+        &lt;property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.JBMESSAGING1"
+           value="org.jboss.jms.server.recovery.MessagingXAResourceRecovery;java:/DefaultJMSProvider"/&gt;
+
+    &lt;/properties&gt;
+     
+  </programlisting>
+   <para>In the above example the recovery manager will attempt to recover JMS
+   resources using the JMSProviderLoader "DefaultJMSProvider"</para>
+   <para>DefaultJMSProvider is the default JMS provider loader that ships with
+   JBoss AS and is defined in jms-ds.xml (or hajndi-jms-ds.xml in a clustered
+   configuration). If you want to recovery using a different JMS provider
+   loader - e.g. one corresponding to a remote JMS provider then just add
+   another line and instead of DefaultJMSProvider specify the name of the
+   remote JMS provider as specified in it's MBean configuration.</para>
+   <para>For each line you add, the name must be unique, so you could specify
+   "com.arjuna.ats.jta.recovery.XAResourceRecovery.JBMESSAGING1",
+   "com.arjuna.ats.jta.recovery.XAResourceRecovery.JBMESSAGING2, ..."
+   etc.</para>
+   <para>In actual fact, the recovery also should work with any JMS provider
+   that implements recoverable XAResources (i.e. it properly implements
+   XAResource.recover()) , not just JBoss Messaging</para>
+   <para>Please note that to configure the recovery manager to recovery
+   transactions from any node of the cluster it will be necessary to specify a
+   line in the configuration for every node of the cluster</para>
+</chapter>
\ No newline at end of file

Added: projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/runningexamples.xml
===================================================================
--- projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/runningexamples.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/Messaging/JBoss_Messaging_User_Guide/en-US/runningexamples.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="examples">
+  <title>Running the Examples</title>
+
+  <para>In the directory <literal>docs/examples</literal>, you will find a set
+  of examples demonstrating JBoss Messaging working in various examples, they
+  include: <itemizedlist>
+      <listitem>
+        <para>docs/example/queue</para>
+
+        <para>This example shows a simple send and receive to a remote queue
+        using a JMS client</para>
+      </listitem>
+
+      <listitem>
+        <para>docs/example/topic</para>
+
+        <para>This example shows a simple send and receive to a remote topic
+        using a JMS client</para>
+      </listitem>
+
+      <listitem>
+        <para>docs/example/mdb</para>
+
+        <para>This example demonstrates usage of an EJB2.1 MDB with JBoss
+        Messaging</para>
+      </listitem>
+
+      <listitem>
+        <para>docs/example/ejb3mdb</para>
+
+        <para>This example demonstrates usage of an EJB3 MDB with JBoss
+        Messaging</para>
+      </listitem>
+
+      <listitem>
+        <para>docs/example/stateless</para>
+
+        <para>This example demonstrates an EJB2.1 stateless session bean
+        interacting with JBoss Messaging</para>
+      </listitem>
+
+      <listitem>
+        <para>docs/example/mdb-failure</para>
+
+        <para>This example demonstrates rollback and redelivery occuring with
+        an EJB2.1 MDB</para>
+      </listitem>
+
+      <listitem>
+        <para>docs/example/secure-socket</para>
+
+        <para>This example demonstrates a JMS client interacting with a JBoss
+        Messaging server using SSL encrypted transport</para>
+      </listitem>
+
+      <listitem>
+        <para>docs/example/http</para>
+
+        <para>This example demonstrates a JMS client interacting with a JBoss
+        Messaging server tunneling traffic over the HTTP protocol</para>
+      </listitem>
+
+      <listitem>
+        <para>docs/example/web-service</para>
+
+        <para>This example demonstrates JBoss web-service interacting with
+        JBoss Messaging</para>
+      </listitem>
+
+      <listitem>
+        <para>docs/example/distributed-queue</para>
+
+        <para>This example demonstrates a JMS client interacting with a JBoss
+        Messaging distributed queue - it requires two JBoss AS instances to be
+        running</para>
+      </listitem>
+
+      <listitem>
+        <para>docs/example/distributed-topic</para>
+
+        <para>This example demonstrates a JMS client interacting with a JBoss
+        Messaging distributed topic - it requires two JBoss AS instances to be
+        running</para>
+      </listitem>
+
+      <listitem>
+        <para>docs/example/stateless-clustered</para>
+
+        <para>This example demonstrates a JMS client interacting with
+        clustered EJB2.1 stateless session bean, which in turn interactes with
+        JBoss Messaging. The example uses HAJNDI to lookup the connection
+        factory</para>
+      </listitem>
+
+      <listitem>
+        <para>docs/example/bridge</para>
+
+        <para>This example demonstrates using a message bridge. It deploys a
+        message bridge in JBoss AS which then proceeds to move messages from a
+        source to a target queue</para>
+      </listitem>
+    </itemizedlist></para>
+
+  <para>It is highly recommended that you familiarise yourself with the
+  examples.</para>
+
+  <para>Make sure you start the JBoss server(s) before running the
+  examples!</para>
+
+  <para>The non clustered examples expect a JBoss AS instance to be running
+  with all the default settings</para>
+
+  <para>The clustered examples expect two JBoss AS instances to running with
+  ports settings as per ports-01 and ports-02.</para>
+
+  <para>For each example, you can always override the default ports it will
+  try to connect to by editing jndi.properties in the particular example
+  directory</para>
+</chapter>
\ No newline at end of file

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/README.html
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/README.html	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/README.html	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,115 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+  <title>JBoss Messaging Example - JMS Bridge</title>
+</head>
+<body>
+<br>
+<h1>JBoss Messaging Bridge Example</h1>
+$Revision: 2310 $
+<h2>Overview</h2>
+<br>
+This example deploys a message bridge in JBoss AS, which is configured to 
+move messages from one destination to another.
+<br>
+The example then sends some message to the source destination, then consumes the
+same messages from the target destionation, demonstrating that the bridge has
+successfully moved the messages from the source to the target.
+<br>
+The example is somewhat artificial in that normally a bridge would be used to move messages
+from source and target destinations on different servers, but it serves to illustrate how to 
+use a bridge
+<br>
+This example relies on having access to a running JBoss Messaging
+instance.
+The JBoss Messaging instance must be installed according to the userguide.<br>
+<span style="font-style: italic;"></span>
+<h2>Running the example</h2>
+1. Set up the JBOSS_HOME environment variable to point to the JBoss
+instance you deployed JBoss Messaging into. For example, if you
+deployed JBoss Messaging in <span style="font-family: monospace;">C:\jboss-4.2.0.GA\server\messaging\deploy,</span>
+then your JBOSS_HOME value should be <span
+ style="font-family: monospace;">C:\</span><span
+ style="font-family: monospace;">jboss-4.2.0.GA</span><br>
+<span style="font-family: monospace;"></span><span
+ style="font-family: monospace;"></span><br>
+2. Go to the example's home directory<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">cd
+...\examples\bridge</span><br>
+</div>
+<br>
+3. Run the example:<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">ant</span>
+<br>
+<br>
+<br>
+</div>
+The output of a successful run should be similar to:<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; background-color: rgb(204, 204, 204); margin-left: 40px;"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;">
+      <div style="margin-left: 40px;"><br>
+      </div>
+
+[tim at Vigor14 bridge]$ ant<br>
+Buildfile: build.xml<br>
+<br>
+identify:<br>
+     [echo] ###########################################################################<br>
+     [echo] #                       Running the BRIDGE example                         #<br>
+     [echo] ###########################################################################
+     [echo] The queue:      ${example.queue.name}<br>
+     [echo] The client jar: ../../../output/lib/jboss-messaging-client.jar<br>
+<br>
+sanity-check:<br>
+<br>
+init:<br>
+    [mkdir] Created dir: /home/tim/dev/jboss-messaging/trunk/docs/examples/bridge/output/classes<br>
+    [mkdir] Created dir: /home/tim/dev/jboss-messaging/trunk/docs/examples/common/output/classes<br>
+<br>
+compile:<br>
+    [javac] Compiling 5 source files to /home/tim/dev/jboss-messaging/trunk/docs/examples/common/output/classes<br>
+    [javac] Compiling 1 source file to /home/tim/dev/jboss-messaging/trunk/docs/examples/bridge/output/classes>br>
+<br>
+deploy:<br>
+     [copy] Copying 1 file to /home/tim/dev/jboss-4.2.0.GA/server/messaging/deploy<br>
+<br>sleep:<br>     [echo] Sleeping for 5 seconds ...<br><br>run:<br>     [java] Queue JBossQueue[A] exists<br>     [java] Queue JBossQueue[B] exists<br>     [java] The message was successfully sent to the A queue<br>     [java] The message was successfully sent to the A queue<br>     [java] The message was successfully sent to the A queue<br>     [java] The message was successfully sent to the A queue<br>     [java] The message was successfully sent to the A queue<br>     [java] The message was successfully sent to the A queue<br>     [java] The message was successfully sent to the A queue<br>     [java] The message was successfully sent to the A queue<br>     [java] The message was successfully sent to the A queue<br>     [java] The message was successfully sent to the A queue<br>     [java] The message was received successfully from the B queue<br>     [java] The message was received successfully from the B queue<br>     [java] The message was received successfully from t!
 he B queue<br>     [java] The message was received successfully from the B queue<br>     [java] The message was received successfully from the B queue<br>     [java] The message was received successfully from the B queue<br>     [java] The message was received successfully from the B queue<br>     [java] The message was received successfully from the B queue<br>     [java] The message was received successfully from the B queue<br>     [java] The message was received successfully from the B queue<br>     [java] The example connected to JBoss Messaging version 1.3.0.GA (1.3)<br><br>     [java] #####################<br>     [java] ###    SUCCESS!   ###<br>     [java] #####################<br><br>undeploy:<br>   [delete] Deleting: /home/tim/dev/jboss-4.2.0.GA/server/messaging/deploy/test-bridge-service.xml<br><br>BUILD SUCCESSFUL<br>Total time: 9 seconds<br><br>  
+      </td>
+    </tr>
+  </tbody>
+</table>
+<div style="margin-left: 40px;"><br>
+</div>
+<br>
+<br>
+<h2>Troublesooting</h2>
+<h3>1. I get <span style="font-family: monospace;">"javax.jms.JMSSecurityException:
+User null is NOT authenticated" <br>
+</span></h3>
+You probably didn't install JBoss Messaging correctly. A fresh JBoss
+Messaging installation requires changes in the security configuration
+of a <span style="font-family: monospace;">default </span>JBoss
+instance, specifically a properly configured "<small><span
+ style="font-family: courier new,courier,monospace;">messaging</span></small>"
+security domain.&nbsp; Follow the instructions from the "Installation"
+paragraph of the release documentation. <br>
+<br>
+<br>
+<hr style="width: 100%; height: 2px;"><br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</body>
+</html>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/build.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/build.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/build.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+   To run the example, set JBOSS_HOME and run ant (with no parameters)
+
+   $Id: build.xml 2705 2007-05-17 21:34:07Z clebert.suconic at jboss.com $
+
+ -->
+
+<project name="BridgeExample" default="run">
+
+   <property environment="ENV"/>
+
+   <!-- These properties may be overriden by calling ants when this example is used in a smoke test -->
+   <property file="../examples.properties"/>
+   <property name="messaging.client.jar.path" value="../../"/>
+   <property name="messaging.client.jar.name" value="jboss-messaging-client.jar"/>
+   <property name="jboss.home" value="${ENV.JBOSS_HOME}"/>
+   <property name="jboss.configuration" value="messaging"/>
+   <property name="example.source.queue" value="A"/>
+   <property name="example.target.queue" value="B"/>
+
+   <path id="common.compilation.classpath">
+      <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </path>
+
+   <path id="example.compilation.classpath">
+      <path refid="common.compilation.classpath"/>
+      <pathelement path="../common/output/classes"/>
+   </path>
+
+   <path id="execution.classpath">
+      <pathelement path="./etc"/>
+      <pathelement path="../common/output/classes"/>
+      <pathelement path="./output/classes"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/jboss-remoting.jar"/>
+      <fileset file="${jboss.home}/client/jbossall-client.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/log4j.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/javassist.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/trove.jar"/>
+   </path>
+
+   <target name="identify">
+      <echo message="###########################################################################"/>
+      <echo message="#                       Running the BRIDGE example                         #"/>
+      <echo message="###########################################################################"/>
+      <echo message="The queue:      ${example.queue.name}"/>
+      <echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </target>
+
+   <target name="sanity-check" depends="identify">
+      <available property="client.jar.present" file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fail message="Could not find client jar ${messaging.client.jar.path}/${messaging.client.jar.name}"
+            unless="client.jar.present"/>
+   </target>
+
+   <target name="init" depends="sanity-check">
+      <mkdir dir="./output/classes"/>
+      <mkdir dir="../common/output/classes"/>
+   </target>
+
+   <target name="compile" depends="init">
+      <javac destdir="../common/output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="../common/src"/>
+         <classpath refid="common.compilation.classpath"/>
+      </javac>
+      <javac destdir="./output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="./src"/>
+         <classpath refid="example.compilation.classpath"/>
+      </javac>
+   </target>
+   
+   <target name="deploy" depends="compile">
+      <copy file="./etc/test-bridge-service.xml"
+            todir="${jboss.home}/server/${jboss.configuration}/deploy"/>
+      <antcall target="sleep"><param name="sleep.interval" value="5"/></antcall>
+   </target>
+	
+   <target name="undeploy">
+      <delete file="${jboss.home}/server/${jboss.configuration}/deploy/test-bridge-service.xml" quiet="true"/>
+   </target>
+   
+   <target name="run" depends="deploy">
+      <java classname="org.jboss.example.jms.bridge.BridgeExample"
+            classpathref="execution.classpath" fork="yes" failonerror="true">
+         <sysproperty key="example.source.queue" value="${example.source.queue}"/>
+         <sysproperty key="example.target.queue" value="${example.target.queue}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=example"/>
+         -->
+      </java>
+   	  <antcall target="undeploy"/>
+   </target>
+
+   <target name="clean" depends="undeploy">
+      <delete dir="./output" quiet="true"/>
+      <delete dir="../common/output" quiet="true"/>
+   </target>
+	
+   <target name="sleep">
+	  <echo message="Sleeping for ${sleep.interval} seconds ..."/>
+	  <sleep seconds="${sleep.interval}"/>
+   </target>
+
+</project>
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/etc/jndi.properties
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/etc/jndi.properties	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/etc/jndi.properties	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,4 @@
+### JBossNS properties
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/etc/log4j.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/etc/log4j.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/etc/log4j.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- $Id: log4j.xml 2318 2007-02-15 02:11:43Z ovidiu.feodorov at jboss.com $ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p @%t [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+  <root>
+      <appender-ref ref="CONSOLE"/>
+   </root>
+
+</log4j:configuration>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/etc/test-bridge-service.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/etc/test-bridge-service.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/etc/test-bridge-service.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+     Example deployment descriptor for a message bridge
+
+     $Id: messaging-secure-socket-service.xml 2737 2007-05-29 17:56:49Z timfox $
+ -->
+
+<server>
+
+
+   <mbean code="org.jboss.jms.server.bridge.BridgeService"
+          name="jboss.messaging:service=Bridge,name=TestBridge"
+          xmbean-dd="xmdesc/Bridge-xmbean.xml">
+          
+      <!-- The JMS provider loader that is used to lookup the source destination -->   
+      <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>     
+      
+      <!-- The JMS provider loader that is used to lookup the target destination -->
+      <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>    
+      
+      <!-- The JNDI lookup for the source destination -->
+      <attribute name="SourceDestinationLookup">/queue/A</attribute> 
+      
+      <!-- The JNDI lookup for the target destination -->
+      <attribute name="TargetDestinationLookup">/queue/B</attribute>
+      
+      <!-- The username to use for the source connection 
+      <attribute name="SourceUsername">bob</attribute>
+      -->
+      
+      <!-- The password to use for the source connection
+      <attribute name="SourcePassword">cheesecake</attribute>
+      -->
+      
+      <!-- The username to use for the target connection
+      <attribute name="TargetUsername">mary</attribute>
+      -->
+      
+      <!-- The password to use for the target connection
+      <attribute name="TargetPassword">hotdog</attribute>
+      -->
+      
+      <!-- Optional: The Quality Of Service mode to use, one of:
+           QOS_AT_MOST_ONCE = 0;
+           QOS_DUPLICATES_OK = 1;
+           QOS_ONCE_AND_ONLY_ONCE = 2; -->
+      <attribute name="QualityOfServiceMode">0</attribute>
+      
+      <!-- JMS selector to use for consuming messages from the source
+      <attribute name="Selector">specify jms selector here</attribute>
+      -->
+      
+      <!-- The maximum number of messages to consume from the source before sending to the target -->
+      <attribute name="MaxBatchSize">5</attribute>     
+      
+      <!-- The maximum time to wait (in ms) before sending a batch to the target even if MaxBatchSize is not exceeded.
+           -1 means wait forever -->   
+      <attribute name="MaxBatchTime">-1</attribute>
+      
+      <!-- If consuming from a durable subscription this is the subscription name
+      <attribute name="SubName">mysub</attribute>
+      -->
+      
+      <!-- If consuming from a durable subscription this is the client ID to use
+      <attribute name="ClientID">myClientID</attribute>
+      -->
+      
+      <!-- The number of ms to wait between connection retrues in the event connections to source or target fail -->
+      <attribute name="FailureRetryInterval">5000</attribute>      
+      
+      <!-- The maximum number of connection retries to make in case of failure, before giving up
+           -1 means try forever-->
+      <attribute name="MaxRetries">-1</attribute>
+
+      <!-- If true then the message id of the message before bridging will be added as a header to the message so it is available
+           to the receiver. Can then be sent as correlation id to correlate in a distributed request-response -->
+      <attribute name="AddMessageIDInHeader">false</attribute>
+      
+    </mbean>
+ 
+ </server>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/src/org/jboss/example/jms/bridge/BridgeExample.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/src/org/jboss/example/jms/bridge/BridgeExample.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/bridge/src/org/jboss/example/jms/bridge/BridgeExample.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,150 @@
+/*
+ * 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.
+ */
+package org.jboss.example.jms.bridge;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+import org.jboss.example.jms.common.ExampleSupport;
+
+/**
+ * This example creates a JMS Connection to a JBoss Messaging instance and then sends a message to a source queue.
+ * It then waits to receive the same messages from the target queue.
+ * 
+ * The example ant script will deploy a message bridge that moves messages from the source to the target queue.
+ * 
+ * 
+ * Since this example is also used by the smoke test, it is essential that the VM exits with exit
+ * code 0 in case of successful execution and a non-zero value on failure.
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * @version <tt>$Revision: 2674 $</tt>
+ *
+ * $Id: QueueExample.java 2674 2007-05-14 19:57:23Z timfox $
+ */
+public class BridgeExample extends ExampleSupport
+{
+   
+   public void example() throws Exception
+   {
+      String source = System.getProperty("example.source.queue");
+      
+      String target = System.getProperty("example.target.queue");
+      
+      InitialContext ic = null;
+      ConnectionFactory cf = null;
+      Connection connection =  null;
+
+      try
+      {         
+         ic = new InitialContext();
+         
+         cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
+         Queue sourceQueue = (Queue)ic.lookup("/queue/" + source);
+         log("Queue " + sourceQueue + " exists");
+         
+         Queue targetQueue = (Queue)ic.lookup("/queue/" + target);
+         log("Queue " + targetQueue + " exists");
+         
+         connection = cf.createConnection();
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer sender = session.createProducer(sourceQueue);
+         
+         final int NUM_MESSAGES = 10;
+         
+         for (int i = 0; i < NUM_MESSAGES; i++)
+         {
+         	TextMessage message = session.createTextMessage("Hello!" + i);	
+         	
+         	sender.send(message);
+         	
+            log("The message was successfully sent to the " + sourceQueue.getQueueName() + " queue");
+         }
+         
+         MessageConsumer consumer =  session.createConsumer(targetQueue);
+         
+         connection.start();
+         
+         for (int i = 0; i < NUM_MESSAGES; i++)
+         {
+         	TextMessage message = (TextMessage)consumer.receive(10000);
+         	
+         	assertEquals("Hello!" + i, message.getText());
+         	
+         	log("The message was received successfully from the " + targetQueue.getQueueName() + " queue");
+         }
+                  
+         displayProviderInfo(connection.getMetaData());                 
+      }
+      finally
+      {         
+         if(ic != null)
+         {
+            try
+            {
+               ic.close();
+            }
+            catch(Exception e)
+            {
+               throw e;
+            }
+         }
+         
+         // ALWAYS close your connection in a finally block to avoid leaks.
+         // Closing connection also takes care of closing its related objects e.g. sessions.
+         closeConnection(connection);
+      }
+   }
+   
+   private void closeConnection(Connection con)
+   {      
+      try
+      {
+         if (con != null)
+         {
+            con.close();
+         }         
+      }
+      catch(JMSException jmse)
+      {
+         log("Could not close connection " + con +" exception was " + jmse);
+      }
+   }
+      
+   protected boolean isQueueExample()
+   {
+      return true;
+   }
+   
+   public static void main(String[] args)
+   {
+      new BridgeExample().run();
+   }
+   
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/etc/META-INF/ejb-jar.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/etc/META-INF/ejb-jar.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/etc/META-INF/ejb-jar.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,16 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
+    "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
+
+<ejb-jar>
+    <enterprise-beans>
+        <session>
+            <ejb-name>Management</ejb-name>
+            <home>org.jboss.example.jms.common.bean.ManagementHome</home>
+            <remote>org.jboss.example.jms.common.bean.Management</remote>
+            <ejb-class>org.jboss.example.jms.common.bean.ManagementBean</ejb-class>
+            <session-type>Stateless</session-type>
+            <transaction-type>Bean</transaction-type>
+        </session>
+    </enterprise-beans>
+</ejb-jar>
\ No newline at end of file

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/etc/META-INF/jboss.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/etc/META-INF/jboss.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/etc/META-INF/jboss.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jboss PUBLIC
+   "-//JBoss//DTD JBOSS 3.0//EN"
+   "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
+<jboss>
+   <enterprise-beans>
+      <session>
+         <ejb-name>Management</ejb-name>
+         <jndi-name>ejb/Management</jndi-name>
+      </session>
+   </enterprise-beans>
+</jboss>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/ExampleSupport.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/ExampleSupport.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/ExampleSupport.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,255 @@
+/**
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.example.jms.common;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionMetaData;
+import javax.jms.ConnectionFactory;
+import javax.naming.InitialContext;
+
+import org.jboss.example.jms.common.bean.Management;
+import org.jboss.example.jms.common.bean.ManagementHome;
+import org.jboss.jms.client.JBossConnection;
+import org.jboss.jms.client.JBossConnectionFactory;
+import org.jboss.jms.client.delegate.DelegateSupport;
+import org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate;
+import org.jboss.jms.client.state.ConnectionState;
+
+/**
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 3092 $</tt>
+ *
+ * $Id: ExampleSupport.java 3092 2007-09-10 21:42:30Z clebert.suconic at jboss.com $
+ */
+public abstract class ExampleSupport
+{
+   // Constants -----------------------------------------------------
+   
+   public static final String DEFAULT_QUEUE_NAME = "testQueue";
+   public static final String DEFAULT_TOPIC_NAME = "testTopic";
+   
+   // Static --------------------------------------------------------
+   
+   public static int getServerID(Connection conn) throws Exception
+   {
+      if (!(conn instanceof JBossConnection))
+      {
+         throw new Exception("Connection not an instance of JBossConnection");
+      }
+      
+      JBossConnection jbconn = (JBossConnection)conn;
+      
+      DelegateSupport del = (DelegateSupport)jbconn.getDelegate();
+      
+      ConnectionState state = (ConnectionState)del.getState();
+      
+      return state.getServerID();
+   }
+   
+   public static void assertEquals(Object o, Object o2)
+   {
+      if (o == null && o2 == null)
+      {
+         return;
+      }
+      
+      if (o.equals(o2))
+      {
+         return;
+      }
+      
+      throw new RuntimeException("Assertion failed, " + o + " != " + o2);
+   }
+   
+   public static void assertEquals(int i, int i2)
+   {
+      if (i == i2)
+      {
+         return;
+      }
+      
+      throw new RuntimeException("Assertion failed, " + i + " != " + i2);
+   }
+   
+   public static void assertNotEquals(int i, int i2)
+   {
+      if (i != i2)
+      {
+         return;
+      }
+      
+      throw new RuntimeException("Assertion failed, " + i + " == " + i2);
+   }
+   
+   
+   public static void killActiveNode() throws Exception
+   {
+      // Currently it will always kill the primary node, ignoring nodeID
+      
+      try
+      {
+         InitialContext ic = new InitialContext();
+         
+         ManagementHome home = (ManagementHome)ic.lookup("ejb/Management");
+         Management bean = home.create();
+         try
+         {
+            bean.killAS();
+         }
+         catch(Exception e)
+         {
+            // OK, I expect exceptions following a VM kill
+         }
+      }
+      catch(Exception e)
+      {
+         throw new RuntimeException("Could not kill the active node", e);
+      }
+   }
+   
+   
+   // Attributes ----------------------------------------------------
+   
+   private boolean failure;
+   private boolean deployed;
+   private String jndiDestinationName;
+   
+   // Constructors --------------------------------------------------
+   
+   protected ExampleSupport()
+   {
+      failure = false;
+   }
+   
+   // Public --------------------------------------------------------
+   
+   // Package protected ---------------------------------------------
+   
+   // Protected -----------------------------------------------------
+   
+   protected abstract void example() throws Exception;
+   protected abstract boolean isQueueExample();
+   
+   protected final boolean isTopicExample()
+   {
+      return !isQueueExample();
+   }
+   
+   protected void run()
+   {
+      try
+      {
+         setup();
+         example();
+         tearDown();
+      }
+      catch(Throwable t)
+      {
+         t.printStackTrace();
+         setFailure(true);
+      }
+      
+      reportResultAndExit();
+   }
+   
+   protected void setFailure(boolean b)
+   {
+      failure = b;
+   }
+   
+   protected boolean isFailure()
+   {
+      return failure;
+   }
+   
+   protected String getDestinationJNDIName()
+   {
+      return jndiDestinationName;
+   }
+   
+   protected void log(String s)
+   {
+      System.out.println(s);
+   }
+   
+   protected void displayProviderInfo(ConnectionMetaData metaData) throws Exception
+   {
+      String info =
+         "The example connected to " + metaData.getJMSProviderName() +
+         " version " + metaData.getProviderVersion() + " (" +
+         metaData.getProviderMajorVersion() + "." + metaData.getProviderMinorVersion() +
+         ")";
+      
+      System.out.println(info);
+   }
+   
+   // Private -------------------------------------------------------
+   
+   protected void setup() throws Exception
+   {
+      setup(null);
+   }
+   
+   protected void setup(InitialContext ic) throws Exception
+   {
+      String destinationName;
+      
+      if (isQueueExample())
+      {
+         destinationName = System.getProperty("example.queue.name");
+         jndiDestinationName =
+            "/queue/"  + (destinationName == null ? DEFAULT_QUEUE_NAME : destinationName);
+      }
+      else
+      {
+         destinationName = System.getProperty("example.topic.name");
+         jndiDestinationName =
+            "/topic/"  + (destinationName == null ? DEFAULT_TOPIC_NAME : destinationName);
+      }
+      
+      if (!Util.doesDestinationExist(jndiDestinationName,ic))
+      {
+         System.out.println("Destination " + jndiDestinationName + " does not exist, deploying it");
+         Util.deployQueue(jndiDestinationName,ic);
+         deployed = true;
+      }
+   }
+   
+   protected void tearDown() throws Exception
+   {
+      tearDown(null);
+   }
+   
+   protected void tearDown(InitialContext ic) throws Exception
+   {
+      if (deployed)
+      {
+         Util.undeployQueue(jndiDestinationName,ic);
+      }
+   }
+   
+   protected void reportResultAndExit()
+   {
+      if (isFailure())
+      {
+         System.err.println();
+         System.err.println("#####################");
+         System.err.println("###    FAILURE!   ###");
+         System.err.println("#####################");
+         System.exit(1);
+      }
+      
+      System.out.println();
+      System.out.println("#####################");
+      System.out.println("###    SUCCESS!   ###");
+      System.out.println("#####################");
+      System.exit(0);
+   }
+
+   // Inner classes -------------------------------------------------
+
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/Util.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/Util.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/Util.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,126 @@
+/*
+* 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.
+*/
+package org.jboss.example.jms.common;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.naming.InitialContext;
+import javax.naming.NameNotFoundException;
+
+/**
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2977 $</tt>
+ *
+ * $Id: Util.java 2977 2007-08-08 15:32:14Z timfox $
+ */
+public class Util
+{
+   // Constants -----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+
+   public static boolean doesDestinationExist(String jndiName) throws Exception
+   {
+       return doesDestinationExist(jndiName, null);
+   }
+
+   public static boolean doesDestinationExist(String jndiName, InitialContext ic) throws Exception
+   {
+      if (ic == null)
+      {
+          ic = new InitialContext();
+      }
+      try
+      {
+         ic.lookup(jndiName);
+      }
+      catch(NameNotFoundException e)
+      {
+         return false;
+      }
+      return true;
+   }
+
+   public static void deployQueue(String jndiName) throws Exception
+   {
+       deployQueue(jndiName,null);
+   }
+
+   public static void deployQueue(String jndiName, InitialContext ic) throws Exception
+   {
+      MBeanServerConnection mBeanServer = lookupMBeanServerProxy(ic);
+
+      ObjectName serverObjectName = new ObjectName("jboss.messaging:service=ServerPeer");
+
+      String queueName = jndiName.substring(jndiName.lastIndexOf('/') + 1);
+
+      mBeanServer.invoke(serverObjectName, "createQueue",
+                         new Object[] {queueName, jndiName},
+                         new String[] {"java.lang.String", "java.lang.String"});
+
+      System.out.println("Queue " + jndiName + " deployed");
+   }
+
+   public static void undeployQueue(String jndiName) throws Exception
+   {
+       undeployQueue(jndiName,null);
+   }
+
+   public static void undeployQueue(String jndiName, InitialContext ic) throws Exception
+   {
+      MBeanServerConnection mBeanServer = lookupMBeanServerProxy(ic);
+
+      ObjectName serverObjectName = new ObjectName("jboss.messaging:service=ServerPeer");
+
+      String queueName = jndiName.substring(jndiName.lastIndexOf('/') + 1);
+
+      mBeanServer.invoke(serverObjectName, "destroyQueue",
+                         new Object[] {queueName},
+                         new String[] {"java.lang.String"});
+
+      System.out.println("Queue " + jndiName + " undeployed");
+   }
+
+   public static MBeanServerConnection lookupMBeanServerProxy(InitialContext ic) throws Exception
+   {
+      if (ic == null)
+      {
+        ic = new InitialContext();
+      }
+      return (MBeanServerConnection)ic.lookup("jmx/invoker/RMIAdaptor");
+   }
+
+   // Attributes ----------------------------------------------------
+   
+   // Constructors --------------------------------------------------
+   
+   // Public --------------------------------------------------------
+
+   // Package protected ---------------------------------------------
+   
+   // Protected -----------------------------------------------------
+   
+   // Private -------------------------------------------------------
+   
+   // Inner classes -------------------------------------------------   
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/bean/Management.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/bean/Management.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/bean/Management.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,26 @@
+/**
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.example.jms.common.bean;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.EJBObject;
+
+/**
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 1766 $</tt>
+
+ * $Id: StatelessSessionExample.java 1766 2006-12-11 22:29:27Z ovidiu.feodorov at jboss.com $
+ */
+
+public interface Management extends EJBObject
+{
+   /**
+    * It kills the VM running the node instance. Needed by the failover tests.
+    */
+   public void killAS() throws Exception, RemoteException;
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/bean/ManagementBean.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/bean/ManagementBean.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/bean/ManagementBean.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,58 @@
+/**
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.example.jms.common.bean;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.EJBException;
+import javax.ejb.SessionBean;
+import javax.ejb.SessionContext;
+
+/**
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 1766 $</tt>
+
+ * $Id: StatelessSessionExampleBean.java 1766 2006-12-11 22:29:27Z ovidiu.feodorov at jboss.com $
+ */
+public class ManagementBean implements SessionBean
+{
+   public void killAS() throws Exception
+   {
+      System.out.println("######");
+      System.out.println("######");
+      System.out.println("######");
+      System.out.println("######");
+      System.out.println("###### SIMULATING A FAILURE, KILLING THE VM!");
+      System.out.println("######");
+      System.out.println("######");
+      System.out.println("######");
+      System.out.println("######");
+
+      Runtime.getRuntime().halt(1);
+   }
+
+   public void setSessionContext(SessionContext ctx) throws EJBException, RemoteException
+   {
+   }
+
+   public void ejbCreate()
+   {
+   }
+
+   public void ejbRemove() throws EJBException
+   {
+   }
+
+   public void ejbActivate() throws EJBException, RemoteException
+   {
+   }
+
+   public void ejbPassivate() throws EJBException, RemoteException
+   {
+   }
+
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/bean/ManagementHome.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/bean/ManagementHome.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/common/src/org/jboss/example/jms/common/bean/ManagementHome.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,24 @@
+/**
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.example.jms.common.bean;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+
+/**
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 563 $</tt>
+
+ * $Id: StatelessSessionExampleHome.java 563 2005-12-30 22:04:19Z ovidiu $
+ */
+
+public interface ManagementHome extends EJBHome
+{
+   public Management create() throws RemoteException, CreateException;
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/README.html
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/README.html	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/README.html	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,139 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+  <title>JBoss Messaging Example - Distributed Queue</title>
+</head>
+<body>
+<br>
+<h1>JBoss Messaging Distributed Queue Example</h1>
+$Revision: 1017 $
+<h2>Overview</h2>
+<br>
+This example demonstrates how to write JMS code that connects to a
+JBoss Messaging cluster and sends messages to a distributed queue.
+The example creates two connections to two distinct cluster nodes
+on which we have previously deployed a distributed queue.
+The example sends and receives messages using both connections.
+<br>
+<br>
+<span style="font-weight: bold;">Note</span><br>
+<div style="margin-left: 40px;">This is an example that assumes a
+NullMessagePullPolicy.
+This is the default configuration option a release ships with,
+and also is a very boring options, since messages are <span
+ style="font-weight: bold;">NOT</span>
+redistributed among nodes.
+An example that assumes a DefaultMessagePullPolicy is coming
+soon (<a href="http://jira.jboss.org/jira/browse/JBMESSAGING-907">http://jira.jboss.org/jira/browse/JBMESSAGING-907</a>).
+<br>
+</div>
+<br>
+This example relies on having access to a running JBoss Messaging
+cluster with at least two nodes. The JBoss Messaging cluster must be
+installed and started according to the user guide.
+<br>
+<br>
+<span style="font-style: italic;"></span><br>
+<h2>Running the example</h2>
+<span style="font-family: monospace;"></span><span
+ style="font-family: monospace;"></span><br>
+1. Make sure that a JBoss Messaging cluster with at least two nodes is
+up and running.<br>
+<br>
+2. Go to the example's home directory<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">cd
+...\examples\distributed-queue</span><br>
+</div>
+<br>
+3. Run the example:<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">ant</span>
+<br>
+<br>
+<br>
+</div>
+The output of a successful run should be similar to:<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; background-color: rgb(204, 204, 204); margin-left: 40px;"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;">
+      <div style="margin-left: 40px;"><br>
+      </div>
+$ ant<br>
+Buildfile: build.xml<br>
+      <br>
+identify:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+###########################################################################<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+Running the DISTRIBUTED QUEUE
+example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+#<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+###########################################################################<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo] The
+topic:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; testDistributedQueue<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo] The client jar:
+../../../output/lib/jboss-messaging-client.jar<br>
+      <br>
+sanity-check:<br>
+      <br>
+init:<br>
+&nbsp;&nbsp;&nbsp; [mkdir] Created dir:
+C:\work\src\svn\messaging\docs\examples\distributed-queue\output<br>
+&nbsp;&nbsp;&nbsp; [mkdir] Created dir:
+C:\work\src\svn\messaging\docs\examples\common\output<br>
+      <br>
+compile:<br>
+&nbsp;&nbsp;&nbsp; [javac] Compiling 2 source files to
+C:\work\src\svn\messaging\docs\examples\common\output<br>
+&nbsp;&nbsp;&nbsp; [javac] Compiling 2 source files to
+C:\work\src\svn\messaging\docs\examples\distributed-queue\output<br>
+      <br>
+run:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] Distributed queue
+/queue/testDistributedQueue exists<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] The message was successfully sent
+to the distributed queue<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] MessageListener0 received message:
+Hello!<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] MessageListener1 received message:
+Another Hello!<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] The example connected to JBoss
+Messaging version 1.3.0.GA (1.3)<br>
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] #####################<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] ###&nbsp;&nbsp;&nbsp;
+SUCCESS!&nbsp;&nbsp; ###<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] #####################<br>
+      <br>
+BUILD SUCCESSFUL<br>
+Total time: 4 seconds<br>
+      <br>
+      <br>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<div style="margin-left: 40px;"><br>
+</div>
+<br>
+<br>
+<br>
+<hr style="width: 100%; height: 2px;"><br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</body>
+</html>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/build.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/build.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/build.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+   To run the example, set JBOSS_HOME and run ant (with no parameters)
+
+   The example requires a two nodes messaging-node0 and messaging-node1 to be running
+
+   $Id: build.xml 974 2006-05-22 21:35:38 -0600 (Mon, 22 May 2006) ovidiu $
+
+ -->
+
+<project name="DistributedQueueExample" default="run">
+
+   <property environment="ENV"/>
+
+   <!-- These properties may be overriden by calling ants when this example is used in a smoke test -->
+   <property file="../examples.properties"/>
+   <property name="messaging.client.jar.path" value="../../"/>
+   <property name="messaging.client.jar.name" value="jboss-messaging-client.jar"/>
+   <property name="jboss.home" value="${ENV.JBOSS_HOME}"/>
+   <property name="jboss.configuration0" value="messaging-node0"/>
+   <property name="example.queue.name" value="testDistributedQueue"/>
+
+   <path id="common.compilation.classpath">
+      <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </path>
+
+   <path id="example.compilation.classpath">
+      <path refid="common.compilation.classpath"/>
+      <pathelement path="../common/output/classes"/>
+   </path>
+
+   <path id="execution.classpath">
+      <pathelement path="./etc"/>
+      <pathelement path="../common/output/classes"/>
+      <pathelement path="./output/classes"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration0}/lib/jboss-remoting.jar"/>
+      <fileset file="${jboss.home}/client/jbossall-client.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration0}/lib/log4j.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration0}/lib/javassist.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration0}/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration0}/deploy/jboss-aop-jdk50.deployer/trove.jar"/>
+   </path>
+
+   <target name="identify">
+      <echo message="###########################################################################"/>
+      <echo message="#                Running the DISTRIBUTED QUEUE example                    #"/>
+      <echo message="###########################################################################"/>
+      <echo message="The queue:      ${example.queue.name}"/>
+      <echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </target>
+
+   <target name="sanity-check" depends="identify">
+      <available property="client.jar.present" file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fail message="Could not find client jar ${messaging.client.jar.path}/${messaging.client.jar.name}"
+            unless="client.jar.present"/>
+   </target>
+
+   <target name="init" depends="sanity-check">
+      <mkdir dir="./output/classes"/>
+      <mkdir dir="../common/output/classes"/>
+   </target>
+
+   <target name="compile" depends="init">
+      <javac destdir="../common/output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="../common/src"/>
+         <classpath refid="common.compilation.classpath"/>
+      </javac>
+      <javac destdir="./output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="./src"/>
+         <classpath refid="example.compilation.classpath"/>
+      </javac>
+   </target>
+
+   <target name="run" depends="compile">
+      <!--
+           DistributedQueueExample expects to find the name of the queue to connect to as value of
+           the 'example.queue.name' property, which *may* be defined by calling ant when this
+           example is used in a smoke test.
+      -->
+      <java classname="org.jboss.example.jms.distributedqueue.DistributedQueueExample"
+         classpathref="execution.classpath" fork="yes" failonerror="true">
+         <sysproperty key="example.queue.name" value="${example.queue.name}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=example"/>
+          -->
+      </java>
+   </target>
+
+   <target name="clean">
+      <delete dir="./output" quiet="true"/>
+      <delete dir="../common/output" quiet="true"/>
+   </target>
+
+</project>
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/etc/jndi.properties
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/etc/jndi.properties	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/etc/jndi.properties	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,5 @@
+### JBossNS properties
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+# Assuming ports-01 so naming running on 1199
+java.naming.provider.url=jnp://localhost:1199
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/etc/log4j.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/etc/log4j.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/etc/log4j.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- $Id: log4j.xml 536 2005-12-22 00:28:39 -0600 (Thu, 22 Dec 2005) ovidiu $ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p @%t [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+   </root>
+
+</log4j:configuration>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/DistributedQueueExample.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/DistributedQueueExample.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/DistributedQueueExample.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,170 @@
+/*
+* 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.
+*/
+package org.jboss.example.jms.distributedqueue;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+import org.jboss.example.jms.common.ExampleSupport;
+
+/**
+ * The example creates two connections to two distinct cluster nodes on which we have previously
+ * deployed a distributed queue. The example sends messages on one node and consumes them from another
+ *
+ * Since this example is also used as a smoke test, it is essential that the VM exits with exit
+ * code 0 in case of successful execution and a non-zero value on failure.
+ *
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 1001 $</tt>
+ *
+ * $Id: TopicExample.java 1001 2006-06-24 09:05:40Z timfox $
+ */
+public class DistributedQueueExample extends ExampleSupport
+{
+   public void example() throws Exception
+   {
+      String destinationName = getDestinationJNDIName();
+
+      InitialContext ic = null;
+
+      Connection connection0 = null;
+      Connection connection1 = null;
+
+      ConnectionFactory cf = null;
+
+      try
+      {
+         // connecting to the first node
+
+         ic = new InitialContext();
+
+         cf = (ConnectionFactory)ic.lookup("/ClusteredConnectionFactory");
+         Queue distributedQueue = (Queue)ic.lookup(destinationName);
+         log("Distributed queue " + destinationName + " exists");
+
+
+         // When connecting to a messaging cluster, the ConnectionFactory has the capability of
+         // transparently creating physical connections to different cluster nodes, in a round
+         // robin fashion ...
+
+         // ... so this is a connection to a cluster node
+         connection0 = cf.createConnection();
+
+         // ... and this is a connection to a different cluster node
+         connection1 = cf.createConnection();
+
+         // Let's make sure that (this example is also a smoke test)
+         assertNotEquals(getServerID(connection0), getServerID(connection1));
+
+         // Create a session, and a producer on the first connection
+
+         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer publisher0 = session0.createProducer(distributedQueue);
+         
+         // Create another session, and consumer on the second connection
+
+         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);      
+         MessageConsumer consumer1 = session1.createConsumer(distributedQueue);
+         ExampleListener messageListener1 = new ExampleListener("MessageListener1");
+         consumer1.setMessageListener(messageListener1);
+
+         // Start connections, so we can receive the message
+
+         connection0.start();
+         connection1.start();
+
+         // Send the message
+
+         TextMessage message = session0.createTextMessage("Hello!");
+         publisher0.send(message);
+
+         log("The message was successfully sent to the distributed queue");
+         
+         messageListener1.waitForMessage(3000);
+
+         message = (TextMessage)messageListener1.getMessage();
+         log(messageListener1.getName() + " received message: " + message.getText());
+         assertEquals("Hello!", message.getText());
+        
+         displayProviderInfo(connection0.getMetaData());
+      }
+      finally
+      {
+         if (ic != null)
+         {
+            try
+            {
+               ic.close();
+            }
+            catch(Exception e)
+            {
+               throw e;
+            }
+         }
+
+         try
+         {
+            if (connection0 != null)
+            {
+               connection0.close();
+            }
+         }
+         catch(JMSException e)
+         {
+            log("Could not close connection " + connection0 + ", exception was " + e);
+            throw e;
+         }
+
+         try
+         {
+            if (connection1 != null)
+            {
+               connection1.close();
+            }
+         }
+         catch(JMSException e)
+         {
+            log("Could not close connection " + connection1 + ", exception was " + e);
+            throw e;
+         }
+
+      }
+   }
+
+   protected boolean isQueueExample()
+   {
+      return true;
+   }
+
+   public static void main(String[] args)
+   {
+      new DistributedQueueExample().run();
+   }
+
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/ExampleListener.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/ExampleListener.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/ExampleListener.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,82 @@
+/**
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.example.jms.distributedqueue;
+
+import javax.jms.Message;
+import javax.jms.MessageListener;
+
+/**
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ * @version <tt>$Revision: 536 $</tt>
+
+ * $Id: ExampleListener.java 536 2005-12-22 00:28:39 -0600 (Thu, 22 Dec 2005) ovidiu $
+ */
+public class ExampleListener implements MessageListener
+{
+   // Constants ------------------------------------------------------------------------------------
+
+   // Static ---------------------------------------------------------------------------------------
+
+   // Attributes -----------------------------------------------------------------------------------
+
+   private String name;
+   private Message message;
+
+   // Constructors ---------------------------------------------------------------------------------
+
+   public ExampleListener(String name)
+   {
+      this.name = name;
+   }
+
+   // MessageListener implementation ---------------------------------------------------------------
+
+   public synchronized void onMessage(Message message)
+   {
+      this.message = message;
+      notifyAll();
+   }
+
+   // Public ---------------------------------------------------------------------------------------
+
+   public synchronized Message getMessage()
+   {
+      return message;
+   }
+
+   public synchronized void waitForMessage(long timeout)
+   {
+      if (message != null)
+      {
+         return;
+      }
+
+      try
+      {
+         wait(timeout);
+      }
+      catch(InterruptedException e)
+      {
+         // OK
+      }
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   // Package protected ----------------------------------------------------------------------------
+
+   // Protected ------------------------------------------------------------------------------------
+
+   // Private --------------------------------------------------------------------------------------
+
+   // Inner classes --------------------------------------------------------------------------------
+
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/README.html
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/README.html	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/README.html	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,127 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+  <title>JBoss Messaging Example - JMS Distributed Topic</title>
+</head>
+<body>
+<br>
+<h1>JBoss Messaging Distributed Topic Example</h1>
+$Revision: 2748 $
+<h2>Overview</h2>
+<br>
+This example demonstrates how to write JMS code that connects to a
+JBoss Messaging cluster and sends messages to a distributed topic. The
+client code creates two distinct JMS connections to two different
+cluster nodes. Each connection is then used to create a subscriber for
+the distributed topic. The example is considered
+successful
+if both subscribers receive a message sent to the topic.<br>
+<br>
+This example relies on having access to a running JBoss Messaging
+cluster with at least two nodes. The JBoss Messaging cluster must be
+installed and started according to the userguide.
+<br>
+<span style="font-style: italic;"></span><br>
+<h2>Running the example</h2>
+<span style="font-family: monospace;"></span><span
+ style="font-family: monospace;"></span><br>
+1. Make sure that a JBoss Messaging cluster with at least two nodes is
+up and running.<br>
+<br>
+2. Go to the example's home directory<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">cd
+...\examples\distributed-topic</span><br>
+</div>
+<br>
+3. Run the example:<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">ant</span>
+<br>
+<br>
+<br>
+</div>
+The output of a successful run should be similar to:<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; background-color: rgb(204, 204, 204); margin-left: 40px;"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;">
+      <div style="margin-left: 40px;"><br>
+      </div>
+$ ant<br>
+Buildfile: build.xml<br>
+      <br>
+identify:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+###########################################################################<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+Running the DISTRIBUTED TOPIC
+example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+#<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+###########################################################################<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo] The
+topic:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; testDistributedTopic<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo] The client jar:
+../../../output/lib/jboss-messaging-client.jar<br>
+      <br>
+sanity-check:<br>
+      <br>
+init:<br>
+&nbsp;&nbsp;&nbsp; [mkdir] Created dir:
+C:\work\src\svn\messaging\docs\examples\distributed-topic\output<br>
+&nbsp;&nbsp;&nbsp; [mkdir] Created dir:
+C:\work\src\svn\messaging\docs\examples\common\output<br>
+      <br>
+compile:<br>
+&nbsp;&nbsp;&nbsp; [javac] Compiling 2 source files to
+C:\work\src\svn\messaging\docs\examples\common\output<br>
+&nbsp;&nbsp;&nbsp; [javac] Compiling 2 source files to
+C:\work\src\svn\messaging\docs\examples\distributed-topic\output<br>
+      <br>
+run:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] Distributed topic
+/topic/testDistributedTopic exists<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] The message was successfully published
+on the distributed topic<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] MessageListener 1 received message:
+Hello!<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] MessageListener 2 received message:
+Hello!<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] The example connected to JBoss
+Messaging version 1.3.0.GA (1.3)<br>
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] #####################<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] ###&nbsp;&nbsp;&nbsp;
+SUCCESS!&nbsp;&nbsp; ###<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] #####################<br>
+      <br>
+BUILD SUCCESSFUL<br>
+Total time: 4 seconds<br>
+      <br>
+      <br>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<div style="margin-left: 40px;"><br>
+</div>
+<br>
+<br>
+<br>
+<hr style="width: 100%; height: 2px;"><br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</body>
+</html>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/build.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/build.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/build.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+   To run the example, set JBOSS_HOME and run ant (with no parameters)
+
+   $Id: build.xml 3140 2007-09-26 08:44:19Z ataylor $
+
+ -->
+
+<project name="DistributedTopicExample" default="run">
+
+   <property environment="ENV"/>
+
+   <property file="../examples.properties"/>
+
+   <!-- These properties may be overriden by calling ants when this example is used in a smoke test -->
+   <property file="../examples.properties"/>
+   <property name="messaging.client.jar.path" value="../../"/>
+   <property name="messaging.client.jar.name" value="jboss-messaging-client.jar"/>
+   <property name="jboss.home" value="${ENV.JBOSS_HOME}"/>
+   <property name="jboss.configuration0" value="messaging-node0"/>
+   <property name="example.topic.name" value="testDistributedTopic"/>
+
+   <path id="common.compilation.classpath">
+      <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </path>
+
+   <path id="example.compilation.classpath">
+      <path refid="common.compilation.classpath"/>
+      <pathelement path="../common/output/classes"/>
+   </path>
+
+   <path id="execution.classpath">
+      <pathelement path="./etc"/>
+      <pathelement path="../common/output/classes"/>
+      <pathelement path="./output/classes"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration0}/lib/jboss-remoting.jar"/>
+      <fileset file="${jboss.home}/client/jbossall-client.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration0}/lib/log4j.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration0}/lib/javassist.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration0}/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration0}/deploy/jboss-aop-jdk50.deployer/trove.jar"/>
+   </path>
+
+   <target name="identify">
+      <echo message="###########################################################################"/>
+      <echo message="#                Running the DISTRIBUTED TOPIC example                    #"/>
+      <echo message="###########################################################################"/>
+      <echo message="The topic:      ${example.topic.name}"/>
+      <echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </target>
+
+   <target name="sanity-check" depends="identify">
+      <available property="client.jar.present" file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fail message="Could not find client jar ${messaging.client.jar.path}/${messaging.client.jar.name}"
+            unless="client.jar.present"/>
+   </target>
+
+   <target name="init" depends="sanity-check">
+      <mkdir dir="./output/classes"/>
+      <mkdir dir="../output/classes"/>
+      <mkdir dir="../common/output/classes"/>
+   </target>
+
+   <target name="compile" depends="init">
+      <javac destdir="../common/output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="../common/src"/>
+         <classpath refid="common.compilation.classpath"/>
+      </javac>
+      <javac destdir="./output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="./src"/>
+         <classpath refid="example.compilation.classpath"/>
+      </javac>
+   </target>
+
+   <target name="run" depends="compile">
+      <!--
+           DistributedTopicExample expects to find the name of the topic to connect to as value of
+           the 'example.topic.name' property, which *may* be defined by calling ant when this
+           example is used in a smoke test.
+      -->
+      <java classname="org.jboss.example.jms.distributedtopic.DistributedTopicExample"
+         classpathref="execution.classpath" fork="yes" failonerror="true">
+         <sysproperty key="example.topic.name" value="${example.topic.name}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=example"/>
+          -->
+      </java>
+   </target>
+
+   <target name="clean">
+      <delete dir="./output" quiet="true"/>
+      <delete dir="../common/output" quiet="true"/>
+   </target>
+
+</project>
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/etc/jndi.properties
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/etc/jndi.properties	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/etc/jndi.properties	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,5 @@
+### JBossNS properties
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+# Asuming ports-01 where naming listens on 1199
+java.naming.provider.url=jnp://localhost:1199
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/etc/log4j.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/etc/log4j.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/etc/log4j.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- $Id: log4j.xml 2744 2007-05-30 17:16:29Z sergeypk $ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p @%t [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+   </root>
+
+</log4j:configuration>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/src/org/jboss/example/jms/distributedtopic/DistributedTopicExample.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/src/org/jboss/example/jms/distributedtopic/DistributedTopicExample.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/src/org/jboss/example/jms/distributedtopic/DistributedTopicExample.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,183 @@
+/*
+* 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.
+*/
+package org.jboss.example.jms.distributedtopic;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.naming.InitialContext;
+
+import org.jboss.example.jms.common.ExampleSupport;
+
+/**
+ * The example sends a message to a distributed topic deployed on the JMS cluster. The message is
+ * subsequently received by two different subscribers, connected to two distinct cluster nodes.
+ *
+ * Since this example is also used as a smoke test, it is essential that the VM exits with exit
+ * code 0 in case of successful execution and a non-zero value on failure.
+ *
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 3092 $</tt>
+ *
+ * $Id: DistributedTopicExample.java 3092 2007-09-10 21:42:30Z clebert.suconic at jboss.com $
+ */
+public class DistributedTopicExample extends ExampleSupport
+{
+   public void example() throws Exception
+   {
+      String destinationName = getDestinationJNDIName();
+
+      InitialContext ic = null;
+
+      Connection connection0 = null;
+      Connection connection1 = null;
+
+      ConnectionFactory cf = null;
+      try
+      {
+         // connecting to the first node
+
+         ic = new InitialContext();
+
+         cf = (ConnectionFactory)ic.lookup("/ClusteredConnectionFactory");
+         Topic distributedTopic = (Topic)ic.lookup(destinationName);
+         log("Distributed topic " + destinationName + " exists");
+
+
+         // When connecting to a messaging cluster, the ConnectionFactory has the capability of
+         // transparently creating physical connections to different cluster nodes, in a round
+         // robin fashion ...
+
+         // ... so this is a connection to a cluster node
+         connection0 = cf.createConnection();
+
+         // ... and this is a connection to a different cluster node
+         connection1 = cf.createConnection();
+
+         // Let's make sure that (this example is also a smoke test)
+         assertNotEquals(getServerID(connection0), getServerID(connection1));
+
+         // Create a session, a producer and consumer for the distributed topic, using connection0
+
+         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         MessageConsumer subscriber0 = session0.createConsumer(distributedTopic);
+         ExampleListener messageListener0 = new ExampleListener("MessageListener 0");
+         subscriber0.setMessageListener(messageListener0);
+
+         MessageProducer publisher = session0.createProducer(distributedTopic);
+
+
+         // Create a session and a consumer for the distributed topic, using connection1
+
+         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         MessageConsumer subscriber1 = session1.createConsumer(distributedTopic);
+
+         ExampleListener messageListener1 = new ExampleListener("MessageListener 1");
+         subscriber1.setMessageListener(messageListener1);
+
+         // Starting the connections
+
+         connection0.start();
+         connection1.start();
+
+         // Sending the message
+
+         TextMessage message = session0.createTextMessage("Hello!");
+         publisher.send(message);
+
+         log("The message was successfully published on the distributed topic");
+
+         messageListener0.waitForMessage();
+         messageListener1.waitForMessage();
+
+         message = (TextMessage)messageListener0.getMessage();
+         log(messageListener0.getName() + " received message: " + message.getText());
+         assertEquals("Hello!", message.getText());
+
+         message = (TextMessage)messageListener1.getMessage();
+         log(messageListener1.getName() + " received message: " + message.getText());
+         assertEquals("Hello!", message.getText());
+
+         displayProviderInfo(connection0.getMetaData());
+
+      }
+      finally
+      {
+         if (ic != null)
+         {
+            try
+            {
+               ic.close();
+            }
+            catch(Exception e)
+            {
+               throw e;
+            }
+         }
+
+         try
+         {
+            if (connection0 != null)
+            {
+               connection0.close();
+            }
+         }
+         catch(JMSException e)
+         {
+            log("Could not close connection " + connection0 + ", exception was " + e);
+            throw e;
+         }
+
+         try
+         {
+            if (connection1 != null)
+            {
+               connection1.close();
+            }
+         }
+         catch(JMSException e)
+         {
+            log("Could not close connection " + connection1 + ", exception was " + e);
+            throw e;
+         }
+
+      }
+   }
+
+   protected boolean isQueueExample()
+   {
+      return false;
+   }
+
+   public static void main(String[] args)
+   {
+      new DistributedTopicExample().run();
+   }
+
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/src/org/jboss/example/jms/distributedtopic/ExampleListener.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/src/org/jboss/example/jms/distributedtopic/ExampleListener.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/distributed-topic/src/org/jboss/example/jms/distributedtopic/ExampleListener.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,82 @@
+/**
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.example.jms.distributedtopic;
+
+import javax.jms.Message;
+import javax.jms.MessageListener;
+
+/**
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ * @version <tt>$Revision: 2868 $</tt>
+
+ * $Id: ExampleListener.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+public class ExampleListener implements MessageListener
+{
+   // Constants -----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   private String name;
+   private Message message;
+
+   // Constructors --------------------------------------------------
+
+   public ExampleListener(String name)
+   {
+      this.name = name;
+   }
+
+   // MessageListener implementation --------------------------------
+
+   public synchronized void onMessage(Message message)
+   {
+      this.message = message;
+      notifyAll();
+   }
+
+   // Public --------------------------------------------------------
+
+   public synchronized Message getMessage()
+   {
+      return message;
+   }
+
+   public synchronized void waitForMessage()
+   {
+      if (message != null)
+      {
+         return;
+      }
+
+      try
+      {
+         wait(5000);
+      }
+      catch(InterruptedException e)
+      {
+         // OK
+      }
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/README.html
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/README.html	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/README.html	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,147 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+  <title>JBoss Messaging Example - EJB3 Message Driven Bean</title>
+</head>
+<body>
+<br>
+<h1>JBoss Messaging EJB3 Message Driven Bean Example</h1>
+$Revision: 2751 $
+<h2>Overview</h2>
+<br>
+This example deploys a simple EJB3 Message Driven Bean that processes
+messages sent to a test queue.&nbsp; Once it receives a message and
+"processes" it, the EJB3 MDB sends an acknowledgment message to a&nbsp;
+temporary destination created by the sender for this purpose. The
+example is considered&nbsp; successful if the sender receives the
+acknowledgment message.<br>
+<br>
+<span style="font-style: italic;"></span><br>
+<h2>Running the example</h2>
+1. Set up the JBOSS_HOME environment variable to point to the JBoss
+instance you deployed JBoss Messaging into. For example, if you
+deployed JBoss Messaging in <span style="font-family: monospace;">C:\jboss-4.2.0.GA\server\default\deploy</span>
+then your JBOSS_HOME value should be <span
+ style="font-family: monospace;">C:\</span><span
+ style="font-family: monospace;">jboss-4.2.0.GA</span><br>
+<span style="font-family: monospace;"><br>
+</span><br>
+2. Go to the example's home directory<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">cd
+...\examples\ejb3mdb</span><br>
+</div>
+<br>
+3. Run the example:<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">ant</span>
+<br>
+<br>
+<br>
+</div>
+The output of a successful run should be similar to:<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; background-color: rgb(204, 204, 204); margin-left: 40px;"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;">
+      <div style="margin-left: 40px;"><br>
+      </div>
+$ ant<br>
+Buildfile: build.xml<br>
+      <br>
+identify:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+X&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+Running the EJB3 MDB
+example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+X<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo] The queue: testQueue<br>
+      <br>
+sanity-check:<br>
+      <br>
+init:<br>
+&nbsp;&nbsp;&nbsp; [mkdir] Created dir:
+C:\work\src\cvs\jboss-head\jms\docs\examples\ejb3mdb\output\classes\META-INF<br>
+&nbsp;&nbsp;&nbsp; [mkdir] Created dir:
+C:\work\src\cvs\jboss-head\jms\docs\examples\ejb3mdb\output\lib\META-INF<br>
+&nbsp;&nbsp;&nbsp; [mkdir] Created dir:
+C:\work\src\cvs\jboss-head\jms\docs\examples\common\output<br>
+      <br>
+compile:<br>
+&nbsp;&nbsp;&nbsp; [javac] Compiling 2 source files to
+C:\work\src\cvs\jboss-head\jms\docs\examples\common\output<br>
+&nbsp;&nbsp;&nbsp; [javac] Compiling 2 source files to
+C:\work\src\cvs\jboss-head\jms\docs\examples\ejb3mdb\output\classes<br>
+      <br>
+jar:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [jar] Building jar:
+C:\work\src\cvs\jboss-head\jms\docs\examples\ejb3mdb\output\lib\mdb-example.ejb3<br>
+      <br>
+deploy:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [copy] Copying 1 file to
+C:\work\src\jboss-4.0.3SP1-src\build\output\jboss-4.0.3SP1\server\messaging\deploy<br>
+      <br>
+sleep:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo] Sleeping for 5 seconds ...<br>
+      <br>
+run:<br>
+      <br>
+send:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] Queue /queue/testQueue exists<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] The Hello! message was successfully
+sent to the testQueue queue<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] Received message: !olleH<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] The example connected to JBoss
+Messaging version 1.3.0.GA (1.3)<br>
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] #####################<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] ###&nbsp;&nbsp;&nbsp;
+SUCCESS!&nbsp;&nbsp; ###<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] #####################<br>
+      <br>
+undeploy:<br>
+&nbsp;&nbsp; [delete] Deleting:
+C:\work\src\jboss-4.2.0.GA\build\output\jboss-4.0.3SP1\server\messaging\deploy\mdb-example.ejb3<br>
+      <br>
+BUILD SUCCESSFUL<br>
+Total time: 10 seconds<br>
+      <br>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<br>
+<h2>Troubleshooting</h2>
+<br>
+<h3>2. I get <span style="font-family: monospace;">"javax.jms.JMSSecurityException:
+User null is NOT authenticated" <br>
+</span></h3>
+You probably didn't install JBoss Messaging correctly. A fresh JBoss
+Messaging installation requires changes in the security configuration
+of a <span style="font-family: monospace;">default </span>JBoss
+instance, specifically a properly configured "<small><span
+ style="font-family: courier new,courier,monospace;">messaging</span></small>"
+security domain.&nbsp; Follow the instructions from the "Installation"
+paragraph of the release documentation. <br>
+<br>
+<br style="font-family: courier new,courier,monospace;">
+<hr
+ style="width: 100%; height: 2px; font-family: courier new,courier,monospace;"><br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</body>
+</html>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/build.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/build.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/build.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+   To run the example, set JBOSS_HOME and run ant (with no parameters)
+
+   $Id: build.xml 3140 2007-09-26 08:44:19Z ataylor $
+
+ -->
+
+<project name="EJB3MDBExample" default="run">
+
+   <property environment="ENV"/>
+
+   <!-- These properties may be overriden by calling ants when this example is used in a smoke test -->
+   <property file="../examples.properties"/>
+   <property name="messaging.client.jar.path" value="../../"/>
+   <property name="messaging.client.jar.name" value="jboss-messaging-client.jar"/>
+   <property name="jboss.home" value="${ENV.JBOSS_HOME}"/>
+   <property name="jboss.configuration" value="messaging"/>
+   <property name="example.queue.name" value="testQueue"/>
+
+   <path id="common.compilation.classpath">
+      <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fileset file="${jboss.home}/client/jboss-ejb3x.jar"/>
+   </path>
+
+   <path id="example.compilation.classpath">
+      <path refid="common.compilation.classpath"/>
+      <pathelement path="../common/output/classes"/>
+   </path>
+
+   <path id="execution.classpath">
+      <pathelement path="./etc"/>
+      <pathelement path="../common/output/classes"/>
+      <pathelement path="./output/classes"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/jboss-remoting.jar"/>
+      <fileset file="${jboss.home}/client/jbossall-client.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/log4j.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/javassist.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/trove.jar"/>
+   </path>
+
+   <target name="identify">
+      <echo message="###########################################################################"/>
+      <echo message="#                     Running the EJB3 MDB example                        #"/>
+      <echo message="###########################################################################"/>
+      <echo message="The queue:      ${example.queue.name}"/>
+      <echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </target>
+
+   <target name="sanity-check" depends="identify">
+      <available property="client.jar.present" file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fail message="Could not find client jar ${messaging.client.jar.path}/${messaging.client.jar.name}"
+            unless="client.jar.present"/>
+      <available property="ejb3.support.installed" file="${jboss.home}/server/${jboss.configuration}/deploy/ejb3.deployer"/>
+      <fail message="EJB3 does not seem to be installed in ${jboss.home}/server/${jboss.configuration}! Install it and try again."
+            unless="ejb3.support.installed"/>
+   </target>
+
+   <target name="init" depends="sanity-check">
+      <mkdir dir="./output/classes/META-INF"/>
+      <mkdir dir="./output/lib/META-INF"/>
+      <mkdir dir="../common/output/classes"/>
+   </target>
+
+   <target name="compile" depends="init">
+      <javac destdir="../common/output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="../common/src"/>
+         <classpath refid="common.compilation.classpath"/>
+      </javac>
+      <javac destdir="./output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="./src"/>
+         <classpath refid="example.compilation.classpath"/>
+      </javac>
+   </target>
+
+   <target name="jar" depends="compile">
+      <copy todir="./output/classes/META-INF" filtering="true">
+         <fileset dir="./etc/META-INF" includes="*"/>
+         <filterset>
+            <filter token="QUEUE_NAME" value="${example.queue.name}"/>
+         </filterset>
+      </copy>
+      <jar destfile="./output/lib/mdb-example.ejb3"
+           basedir="./output/classes"
+           includes="META-INF/**,org/jboss/example/**/EJB3MDBExample.class"/>
+   </target>
+
+   <target name="deploy" depends="jar">
+      <copy file="./output/lib/mdb-example.ejb3"
+            todir="${jboss.home}/server/${jboss.configuration}/deploy"/>
+      <antcall target="sleep"><param name="sleep.interval" value="5"/></antcall>
+   </target>
+
+   <target name="run" depends="deploy">
+      <antcall target="send"/>
+      <antcall target="undeploy"/>
+   </target>
+
+   <target name="send">
+      <!-- MDBExample expects to find the name of the queue to connect to as value of the
+           'example.queue.name' property, which *may* be defined by calling ants when this example
+            is used in a smoke test -->
+      <java classname="org.jboss.example.jms.ejb3mdb.Sender"
+         classpathref="execution.classpath" fork="yes" failonerror="true">
+         <sysproperty key="example.queue.name" value="${example.queue.name}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=example"/>
+          -->
+      </java>
+   </target>
+
+   <target name="undeploy">
+      <delete file="${jboss.home}/server/${jboss.configuration}/deploy/mdb-example.ejb3" quiet="true"/>
+   </target>
+
+   <target name="clean" depends="undeploy">
+      <delete dir="./output" quiet="true"/>
+      <delete dir="../common/output" quiet="true"/>
+   </target>
+
+   <target name="sleep">
+      <echo message="Sleeping for ${sleep.interval} seconds ..."/>
+      <sleep seconds="${sleep.interval}"/>
+   </target>
+
+</project>
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/etc/META-INF/ejb-jar.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/etc/META-INF/ejb-jar.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/etc/META-INF/ejb-jar.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,25 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
+    "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
+
+<!-- $Id: ejb-jar.xml 892 2006-04-18 23:48:09Z ovidiu $ -->
+
+<!--
+    Note: This deployment descriptor (or any deployment descriptor) is NOT mandatory with EJB3 beans.
+          It is here to:
+          1. Demonstrate the use of deployment descriptors, in case you need to override
+             configuration at deployment.
+          2. Add a degree of flexibility to this example to be used with smoke tests.
+-->
+<ejb-jar>
+    <enterprise-beans>
+        <message-driven>
+            <ejb-name>EJB3MDBExample</ejb-name>
+            <ejb-class>org.jboss.example.jms.ejb3mdb.EJB3MDBExample</ejb-class>
+            <transaction-type>Container</transaction-type>
+            <message-driven-destination>
+               <destination-type>javax.jms.Queue</destination-type>
+            </message-driven-destination>
+        </message-driven>
+    </enterprise-beans>
+</ejb-jar>
\ No newline at end of file

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/etc/META-INF/jboss.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/etc/META-INF/jboss.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/etc/META-INF/jboss.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jboss PUBLIC
+   "-//JBoss//DTD JBOSS 3.0//EN"
+   "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
+
+<!-- $Id: jboss.xml 892 2006-04-18 23:48:09Z ovidiu $ -->
+
+<!--
+    Note: This deployment descriptor (or any deployment descriptor) is NOT mandatory with EJB3 beans.
+          It is here to:
+          1. Demonstrate the use of deployment descriptors, in case you need to override
+             configuration at deployment.
+          2. Add a degree of flexibility to this example to be used with smoke tests.
+-->
+<jboss>
+
+   <enterprise-beans>
+      <message-driven>
+         <ejb-name>EJB3MDBExample</ejb-name>
+         <destination-jndi-name>queue/@QUEUE_NAME@</destination-jndi-name>
+      </message-driven>
+   </enterprise-beans>
+
+</jboss>
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/etc/jndi.properties
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/etc/jndi.properties	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/etc/jndi.properties	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,4 @@
+### JBossNS properties
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/etc/log4j.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/etc/log4j.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/etc/log4j.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- $Id: log4j.xml 892 2006-04-18 23:48:09Z ovidiu $ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p @%t [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+   </root>
+
+</log4j:configuration>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/src/org/jboss/example/jms/ejb3mdb/EJB3MDBExample.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/src/org/jboss/example/jms/ejb3mdb/EJB3MDBExample.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/src/org/jboss/example/jms/ejb3mdb/EJB3MDBExample.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,104 @@
+/**
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.example.jms.ejb3mdb;
+
+import javax.ejb.ActivationConfigProperty;
+import javax.ejb.MessageDriven;
+
+import javax.naming.InitialContext;
+import javax.jms.TextMessage;
+import javax.jms.Session;
+import javax.jms.MessageListener;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.Message;
+import javax.jms.Connection;
+import javax.jms.MessageProducer;
+
+/**
+ * A MDB3 EJB example.
+ *
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2868 $</tt>
+
+ * $Id: EJB3MDBExample.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+ at MessageDriven(activationConfig =
+{
+      @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
+      @ActivationConfigProperty(propertyName="destination", propertyValue="queue/testQueue"),
+      @ActivationConfigProperty(propertyName="DLQMaxResent", propertyValue="10")
+})
+public class EJB3MDBExample implements MessageListener
+{
+   public void onMessage(Message m)
+   {
+      businessLogic(m);
+   }
+
+   private void businessLogic(Message m)
+   {
+      Connection conn = null;
+      Session session = null;
+
+      try
+      {
+         TextMessage tm = (TextMessage)m;
+
+         String text = tm.getText();
+         System.out.println("message " + text + " received");
+
+         // flip the string
+         String result = "";
+         for(int i = 0; i < text.length(); i++)
+         {
+            result = text.charAt(i) + result;
+         }
+
+         System.out.println("message processed, result: " + result);
+
+
+         InitialContext ic = new InitialContext();
+         ConnectionFactory cf = (ConnectionFactory)ic.lookup("java:/JmsXA");
+         ic.close();
+
+         conn = cf.createConnection();
+         conn.start();
+         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         Destination replyTo = m.getJMSReplyTo();
+         MessageProducer producer = session.createProducer(replyTo);
+         TextMessage reply = session.createTextMessage(result);
+
+         producer.send(reply);
+         producer.close();
+
+      }
+      catch(Exception e)
+      {
+         e.printStackTrace();
+         System.out.println("The Message Driven Bean failed!");
+      }
+      finally
+      {
+         if (conn != null)
+         {
+            try
+            {
+               conn.close();
+            }
+            catch(Exception e)
+            {
+               System.out.println("Could not close the connection!" +e);
+            }
+         }
+      }
+   }
+}
+
+
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/src/org/jboss/example/jms/ejb3mdb/Sender.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/src/org/jboss/example/jms/ejb3mdb/Sender.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/ejb3mdb/src/org/jboss/example/jms/ejb3mdb/Sender.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,133 @@
+/*
+* 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.
+*/
+package org.jboss.example.jms.ejb3mdb;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+import org.jboss.example.jms.common.ExampleSupport;
+
+/**
+ * This example deploys a simple EJB3 Message Driven Bean that processes messages sent to a test
+ * queue. Once it receives a message and "processes" it, the MDB sends an acknowledgment message to
+ * a temporary destination created by the sender for this purpose. The example is considered
+ * successful if the sender receives the acknowledgment message.
+ *
+ * Since this example is also used by the smoke test, it is essential that the VM exits with exit
+ * code 0 in case of successful execution and a non-zero value on failure.
+ *
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2977 $</tt>
+ *
+ * $Id: Sender.java 2977 2007-08-08 15:32:14Z timfox $
+ */
+public class Sender extends ExampleSupport
+{
+   public void example() throws Exception
+   {
+      String destinationName = getDestinationJNDIName();
+
+
+      InitialContext ic = new InitialContext();
+
+
+      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
+      Queue queue = (Queue)ic.lookup(destinationName);
+
+
+
+      log("Queue " + destinationName + " exists");
+
+
+
+      Connection connection = cf.createConnection();
+      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+      MessageProducer sender = session.createProducer(queue);
+
+
+
+      Queue temporaryQueue = session.createTemporaryQueue();
+      MessageConsumer consumer = session.createConsumer(temporaryQueue);
+
+
+
+      TextMessage message = session.createTextMessage("Hello!");
+      message.setJMSReplyTo(temporaryQueue);
+
+
+
+      sender.send(message);
+
+
+
+      log("The " + message.getText() + " message was successfully sent to the " + queue.getQueueName() + " queue");
+
+
+
+      connection.start();
+
+
+
+      message = (TextMessage)consumer.receive(5000);
+
+
+      if (message == null)
+      {
+         throw new Exception("Have not received any reply. The example failed!");
+      }
+
+
+      log("Received message: " + message.getText());
+
+
+
+      assertEquals("!olleH", message.getText());
+
+
+
+      displayProviderInfo(connection.getMetaData());
+
+
+
+      connection.close();
+   }
+
+
+
+
+   protected boolean isQueueExample()
+   {
+      return true;
+   }
+
+   public static void main(String[] args)
+   {
+      new Sender().run();
+   }
+
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/examples.properties
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/examples.properties	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/examples.properties	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,2 @@
+messaging.client.jar.path=../../../output/lib
+remoting.path=../../../src/etc/remoting

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/README.html
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/README.html	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/README.html	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,166 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta content="text/html; charset=ISO-8859-1"
+        http-equiv="content-type">
+  <title>JBoss Messaging Example - HTTP Transport</title>
+</head>
+<body>
+<br>
+<h1>JBoss Messaging HTTP Transport Example</h1>
+$Revision: 2751 $
+<h2>Overview</h2>
+<p>
+This example shows how to configure a ConnectionFactory to send
+messages using the HTTP protocol. The example will use
+such a ConnectionFactory to create two JMS connections: the first one
+to send a message to the queue and the second one to read the message
+from the queue. In both cases, the message will be sent over
+an HTTP connection. The example is considered successful
+if the client receives without any error the message that was
+previously sent to the queue.</p>
+<p>
+This example needs to have access to a running JBoss Messaging
+instance.
+The JBoss Messaging instance must be installed and started according to
+the
+"Installation" paragraph from the release documentation. However, the
+example will automatically deploy its own queue, unless a queue with
+the same name is already deployed.
+</p>
+<br>
+This example also needs to have access to <span
+ style="font-family: monospace;">jboss-messaging-client.jar</span>
+archive that comes with the release bundle. If you run this example
+from an unzipped installation bundle, the example run script is
+correctly configured to find the client jar. Otherwise, you must modify
+example's <span style="font-family: monospace;">build.xml</span>
+accordingly.<br>
+<br>
+<br>
+<h2>Running the example</h2>
+1. Set up the JBOSS_HOME environment variable to point to the JBoss
+instance you deployed JBoss Messaging into. For example, if you
+deployed JBoss Messaging in <span style="font-family: monospace;">C:\jboss-4.2.0.GA\server\messaging\deploy,</span>
+then your JBOSS_HOME value should be <span
+ style="font-family: monospace;">C:\jboss-4.2.0.GA</span><br>
+<br>
+2. Go to the example's home directory<br>
+<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; margin-left: 40px; background-color: rgb(255, 255, 255);"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;"><br>
+&nbsp;&nbsp; <span style="font-family: monospace;">cd
+...\examples\secure-socket</span><br>
+      <br>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<span style="font-family: monospace;"></span><br>
+3. Run the example:<br>
+<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; margin-left: 40px; background-color: rgb(255, 255, 255);"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;"><br>
+&nbsp;&nbsp; <span style="font-family: monospace;">ant</span><br>
+      <br>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<div style="margin-left: 40px;"><br>
+</div>
+<br>
+The output of a successful run should be similar to:<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; background-color: rgb(204, 204, 204); margin-left: 40px;"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;">
+<pre>
+$ ant
+Buildfile: build.xml
+
+identify:
+     [echo] ############################################################################
+     [echo] #                         Running the HTTP example                         #
+     [echo] ############################################################################
+     [echo] The queue:      testQueue
+     [echo] The client jar: ../../../output/lib/jboss-messaging-client.jar
+
+sanity-check:
+
+init:
+    [mkdir] Created dir: C:\java\messaging\docs\examples\http\output\classes
+    [mkdir] Created dir: C:\java\messaging\docs\examples\common\output\classes
+
+compile:
+    [javac] Compiling 5 source files to C:\java\messaging\docs\examples\common\output\classes
+    [javac] Compiling 1 source file to C:\java\messaging\docs\examples\http\output\classes
+
+deploy:
+     [copy] Copying 1 file to C:\jboss-4.2.0.GA\server\messaging\deploy
+
+sleep:
+     [echo] Sleeping for 10 seconds ...
+
+run:
+     [java] Queue /queue/testQueue exists
+     [java] The message was successfully sent to the testQueue queue
+     [java] Received message: Hello!
+     [java] The example connected to JBoss Messaging version 1.3.0.GA (1.3)
+     [java] 
+     [java] #####################
+     [java] ###    SUCCESS!   ###
+     [java] #####################
+
+undeploy:
+   [delete] Deleting: C:\jboss-4.2.0.GA\server\messaging\deploy\messaging-http-service.xml
+
+BUILD SUCCESSFUL
+Total time: 14 seconds</pre>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<div style="margin-left: 40px;"><br>
+</div>
+<br>
+<h2>Troubleshooting</h2>
+<h3>1. I get <span style="font-family: monospace;">"javax.jms.JMSSecurityException:
+User null is NOT authenticated" <br>
+</span></h3>
+You probably didn't install JBoss Messaging correctly. A fresh JBoss
+Messaging installation requires changes in the security configuration
+of a <span style="font-family: monospace;">default </span>JBoss
+instance, specifically a properly configured "<small><span
+ style="font-family: courier new,courier,monospace;">messaging</span></small>"
+security domain.&nbsp; Follow the instructions from the "Installation"
+paragraph of the release documentation. <br>
+<br>
+<br>
+<br>
+<br>
+<hr style="width: 100%; height: 2px;"><br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</body>
+</html>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/build.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/build.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/build.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+   To run the example, set JBOSS_HOME and run ant (with no parameters)
+
+   $Id: build.xml 3140 2007-09-26 08:44:19Z ataylor $
+
+ -->
+
+<project name="HttpExample" default="run">
+
+   <property environment="ENV"/>
+
+   <!-- These properties may be overriden by calling ants when this example is used in a smoke test -->
+   <property file="../examples.properties"/>
+   <property name="remoting.path" value="../config"/>
+   <property name="messaging.client.jar.path" value="../../"/>
+   <property name="messaging.client.jar.name" value="jboss-messaging-client.jar"/>
+   <property name="jboss.home" value="${ENV.JBOSS_HOME}"/>
+   <property name="jboss.configuration" value="messaging"/>
+   <property name="example.queue.name" value="testQueue"/>
+
+   <path id="common.compilation.classpath">
+      <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </path>
+
+   <path id="example.compilation.classpath">
+      <path refid="common.compilation.classpath"/>
+      <pathelement path="../common/output/classes"/>
+   </path>
+
+   <path id="execution.classpath">
+      <pathelement path="./etc"/>
+      <pathelement path="../common/output/classes"/>
+      <pathelement path="./output/classes"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/jboss-remoting.jar"/>
+      <fileset file="${jboss.home}/client/jbossall-client.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/log4j.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/javassist.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/trove.jar"/>
+   </path>
+
+   <target name="identify">
+      <echo message="############################################################################"/>
+      <echo message="#                         Running the HTTP example                         #"/>
+      <echo message="############################################################################"/>
+      <echo message="The queue:      ${example.queue.name}"/>
+      <echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </target>
+
+   <target name="sanity-check" depends="identify">
+      <available property="client.jar.present" file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fail message="Could not find client jar ${messaging.client.jar.path}/${messaging.client.jar.name}"
+            unless="client.jar.present"/>
+   </target>
+
+   <target name="init" depends="sanity-check">
+      <mkdir dir="./output/classes"/>
+      <mkdir dir="../common/output/classes"/>
+   </target>
+
+   <target name="compile" depends="init">
+      <javac destdir="../common/output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="../common/src"/>
+         <classpath refid="common.compilation.classpath"/>
+      </javac>
+      <javac destdir="./output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="./src"/>
+         <classpath refid="example.compilation.classpath"/>
+      </javac>
+   </target>
+
+   <target name="deploy">
+      <copy file="${remoting.path}/remoting-http-service.xml"
+            todir="${jboss.home}/server/${jboss.configuration}/deploy"/>
+      <copy file="./etc/messaging-http-service.xml"
+            todir="${jboss.home}/server/${jboss.configuration}/deploy"/>
+      <antcall target="sleep"><param name="sleep.interval" value="10"/></antcall>
+   </target>
+
+   <target name="run" depends="compile, deploy">
+      <!-- QueueExample expects to find the name of the queue to connect to as value of the
+           'example.queue.name' property, which *may* be defined by calling ants when this example
+            is used in a smoke test -->
+      <java classname="org.jboss.example.jms.http.HttpExample"
+            classpathref="execution.classpath" fork="yes" failonerror="true">
+         <sysproperty key="example.queue.name" value="${example.queue.name}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=example"/>
+         -->
+      </java>
+      <antcall target="undeploy"/>
+   </target>
+
+   <target name="undeploy">
+      <delete file="${jboss.home}/server/${jboss.configuration}/deploy/messaging-http-service.xml" quiet="true"/>
+      <delete file="${jboss.home}/server/${jboss.configuration}/deploy/remoting-http-service.xml" quiet="true"/>
+   </target>
+
+   <target name="clean" depends="undeploy">
+      <delete dir="./output" quiet="true"/>
+      <delete dir="../common/output" quiet="true"/>
+   </target>
+
+   <target name="sleep">
+      <echo message="Sleeping for ${sleep.interval} seconds ..."/>
+      <sleep seconds="${sleep.interval}"/>
+   </target>
+
+</project>
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/etc/jndi.properties
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/etc/jndi.properties	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/etc/jndi.properties	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,4 @@
+### JBossNS properties
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/etc/log4j.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/etc/log4j.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/etc/log4j.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- $Id: log4j.xml 952 2006-05-17 19:26:54Z ovidiu $ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p @%t [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+   </root>
+
+</log4j:configuration>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/etc/messaging-http-service.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/etc/messaging-http-service.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/etc/messaging-http-service.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+     HTTP Transport Example.
+
+     $Id: messaging-http-service.xml 2773 2007-06-12 13:31:30Z sergeypk $
+ -->
+
+<server>
+
+   <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
+      name="jboss.messaging.destination:service=HttpConnectionFactory"
+      xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=http</depends>
+      <attribute name="JNDIBindings">
+         <bindings>
+            <binding>/HttpConnectionFactory</binding>
+         </bindings>
+      </attribute>
+   </mbean>
+
+</server>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/src/org/jboss/example/jms/http/HttpExample.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/src/org/jboss/example/jms/http/HttpExample.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/http/src/org/jboss/example/jms/http/HttpExample.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,139 @@
+/*
+ * 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.
+ */
+package org.jboss.example.jms.http;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+import org.jboss.example.jms.common.ExampleSupport;
+
+
+/**
+ * The example creates a connection to the default provider and uses the connection to send a
+ * message to the queue "queue/testQueue". Then, the example creates a second connection to the
+ * provider and uses it to receive the message.
+ *
+ * Since this example is also used by the smoke test, it is essential that the VM exits with exit
+ * code 0 in case of successful execution and a non-zero value on failure.
+ *
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * @version <tt>$Revision: 2977 $</tt>
+ *
+ * $Id: HttpExample.java 2977 2007-08-08 15:32:14Z timfox $
+ */
+public class HttpExample extends ExampleSupport
+{
+   
+   public void example() throws Exception
+   {
+      String destinationName = getDestinationJNDIName();
+      
+      InitialContext ic = null;
+      ConnectionFactory cf = null;
+      Connection connection =  null;
+      Connection connection2 =  null;
+      
+      try
+      {
+         ic = new InitialContext();
+         
+         cf = (ConnectionFactory)ic.lookup("/HttpConnectionFactory");
+         Queue queue = (Queue)ic.lookup(destinationName);
+         log("Queue " + destinationName + " exists");
+         
+         connection = cf.createConnection();
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer sender = session.createProducer(queue);
+         
+         TextMessage message = session.createTextMessage("Hello!");
+         sender.send(message);
+         log("The message was successfully sent to the " + queue.getQueueName() + " queue");
+         
+         connection2 = cf.createConnection();
+         Session session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer consumer = session2.createConsumer(queue);
+         
+         connection2.start();
+         
+         message = (TextMessage)consumer.receive(2000);
+         log("Received message: " + message.getText());
+         assertEquals("Hello!", message.getText());
+         
+         displayProviderInfo(connection2.getMetaData());
+         
+      }
+      finally
+      {
+         if(ic != null)
+         {
+            try
+            {
+               ic.close();
+            }
+            catch(Exception e)
+            {
+               throw e;
+            }
+         }
+         
+         //ALWAYS close your connection in a finally block to avoid leaks
+         //Closing connection also takes care of closing its related objects e.g. sessions
+         closeConnection(connection);
+         closeConnection(connection2);
+      }
+   }
+   
+   private void closeConnection(Connection con)
+   {
+      try
+      {
+         if (con != null)
+         {
+            con.close();
+         }         
+      }
+      catch(JMSException jmse)
+      {
+         log("Could not close connection " + con +" exception was " +jmse);         
+      }
+   }
+   
+   
+   protected boolean isQueueExample()
+   {
+      return true;
+   }
+   
+   public static void main(String[] args)
+   {
+      new HttpExample().run();
+   }
+   
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/README.html
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/README.html	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/README.html	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,145 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+  <title>JBoss Messaging Example - Message Driven Bean</title>
+</head>
+<body>
+<br>
+<h1>JBoss Messaging Message Driven Bean Example</h1>
+$Revision: 2751 $
+<h2>Overview</h2>
+<br>
+This example deploys a simple Message Driven Bean that processes
+messages sent to a test queue.&nbsp; Once it receives a message and
+"processes" it, the MDB sends an acknowledgment message to a&nbsp;
+temporary destination created by the sender for this purpose. The
+example is considered&nbsp; successful if the sender receives the
+acknowledgment message.<br>
+<br>
+This example relies on having access to a running JBoss Messaging
+instance.
+The JBoss Messaging instance must be installed and started according to
+the
+"Installation" paragraph from the release documentation.&nbsp; However,
+the example will automatically deploy its own queue, unless a queue
+with the same name is already deployed.<br>
+<br>
+This example also relies on having access to <span
+ style="font-family: monospace;">jboss-messaging-client.jar</span>
+archive that comes with the release bundle. If you run this example
+from
+an unzipped installation bundle, the example run script is correctly
+configured to find the client jar. Otherwise, you must modify example's
+<span style="font-family: monospace;">build.xml</span>
+accordingly.&nbsp;<br>
+<br>
+<h2>Running the example</h2>
+1. Set up the JBOSS_HOME environment variable to point to the JBoss
+instance you deployed JBoss Messaging into. For example, if you
+deployed JBoss Messaging in <span style="font-family: monospace;">C:\jboss-4.2.0.GA\server\messaging\deploy,</span>
+then your JBOSS_HOME value should be <span
+ style="font-family: monospace;">C:\</span><span
+ style="font-family: monospace;">jboss-4.2.0.GA.</span><br>
+<span style="font-family: monospace;"></span><br>
+2. Go to the example's home directory<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">cd
+...\examples\mdb</span><br>
+</div>
+<br>
+3. Run the example:<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">ant</span>
+<br>
+<br>
+<br>
+</div>
+The output of a successful run should be similar to:<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; background-color: rgb(204, 204, 204); margin-left: 40px;"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;">
+<pre>$ ant
+Buildfile: build.xml
+
+identify:
+     [echo] ###########################################################################
+     [echo] #                        Running the MDB example                          #
+     [echo] ###########################################################################
+     [echo] The queue:      testQueue
+     [echo] The client jar: ../../../output/lib/jboss-messaging-client.jar
+
+sanity-check:
+
+init:
+    [mkdir] Created dir: C:\java\messaging\docs\examples\mdb\output\classes\META-INF
+    [mkdir] Created dir: C:\java\messaging\docs\examples\mdb\output\lib\META-INF
+    [mkdir] Created dir: C:\java\messaging\docs\examples\common\output\classes
+
+compile:
+    [javac] Compiling 5 source files to C:\java\messaging\docs\examples\common\output\classes
+    [javac] Compiling 2 source files to C:\java\messaging\docs\examples\mdb\output\classes
+
+jar:
+     [copy] Copying 2 files to C:\java\messaging\docs\examples\mdb\output\classes\META-INF
+      [jar] Building jar: C:\java\messaging\docs\examples\mdb\output\lib\mdb-example.jar
+
+deploy:
+     [copy] Copying 1 file to C:\jboss-4.2.0.GA\server\messaging\deploy
+
+sleep:
+     [echo] Sleeping for 5 seconds ...
+
+run:
+
+send:
+     [java] Queue /queue/testQueue exists
+     [java] The Hello! message was successfully sent to the testQueue queue
+     [java] Received message: !olleH
+     [java] The example connected to JBoss Messaging version 1.3.0.GA (1.3)
+     [java] 
+     [java] #####################
+     [java] ###    SUCCESS!   ###
+     [java] #####################
+
+undeploy:
+   [delete] Deleting: C:\jboss-4.2.0.GA\server\messaging\deploy\mdb-example.jar
+
+BUILD SUCCESSFUL
+Total time: 10 seconds
+</pre>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<br>
+<h2>Troublesooting</h2>
+<h3>1. I get <span style="font-family: monospace;">"javax.jms.JMSSecurityException:
+User null is NOT authenticated" <br>
+</span></h3>
+You probably didn't install JBoss Messaging correctly. A fresh JBoss
+Messaging installation requires changes in the security configuration
+of a <span style="font-family: monospace;">default </span>JBoss
+instance, specifically a properly configured "<small><span
+ style="font-family: courier new,courier,monospace;">messaging</span></small>"
+security domain.&nbsp; Follow the instructions from the "Installation"
+paragraph of the release documentation. <br>
+<br>
+
+<br style="font-family: courier new,courier,monospace;">
+<hr
+ style="width: 100%; height: 2px; font-family: courier new,courier,monospace;"><br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</body>
+</html>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/build.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/build.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/build.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+   To run the example, set JBOSS_HOME and run ant (with no parameters)
+
+   $Id: build.xml 3140 2007-09-26 08:44:19Z ataylor $
+
+ -->
+
+<project name="MDBExample" default="run">
+
+   <property environment="ENV"/>
+
+   <!-- These properties may be overriden by calling ants when this example is used in a smoke test -->
+   <property file="../examples.properties"/>
+   <property name="messaging.client.jar.path" value="../../"/>
+   <property name="messaging.client.jar.name" value="jboss-messaging-client.jar"/>
+   <property name="jboss.home" value="${ENV.JBOSS_HOME}"/>
+   <property name="jboss.configuration" value="messaging"/>
+   <property name="example.queue.name" value="testQueue"/>
+
+   <path id="common.compilation.classpath">
+      <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </path>
+
+   <path id="example.compilation.classpath">
+      <path refid="common.compilation.classpath"/>
+      <pathelement path="../common/output/classes"/>
+   </path>
+
+   <path id="execution.classpath">
+      <pathelement path="./etc"/>
+      <pathelement path="../common/output/classes"/>
+      <pathelement path="./output/classes"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/jboss-remoting.jar"/>
+      <fileset file="${jboss.home}/client/jbossall-client.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/log4j.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/javassist.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/trove.jar"/>
+   </path>
+
+   <target name="identify">
+      <echo message="###########################################################################"/>
+      <echo message="#                        Running the MDB example                          #"/>
+      <echo message="###########################################################################"/>
+      <echo message="The queue:      ${example.queue.name}"/>
+      <echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </target>
+
+   <target name="sanity-check" depends="identify">
+      <available property="client.jar.present" file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fail message="Could not find client jar ${messaging.client.jar.path}/${messaging.client.jar.name}"
+            unless="client.jar.present"/>
+   </target>
+
+   <target name="init" depends="sanity-check">
+      <mkdir dir="./output/classes/META-INF"/>
+      <mkdir dir="./output/lib/META-INF"/>
+      <mkdir dir="../common/output/classes"/>
+   </target>
+
+   <target name="compile" depends="init">
+      <javac destdir="../common/output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="../common/src"/>
+         <classpath refid="common.compilation.classpath"/>
+      </javac>
+      <javac destdir="./output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="./src"/>
+         <classpath refid="example.compilation.classpath"/>
+      </javac>
+   </target>
+
+   <target name="jar" depends="compile">
+      <copy todir="./output/classes/META-INF" filtering="true">
+         <fileset dir="./etc/META-INF" includes="*"/>
+         <filterset>
+            <filter token="QUEUE_NAME" value="${example.queue.name}"/>
+         </filterset>
+      </copy>
+      <jar destfile="./output/lib/mdb-example.jar"
+           basedir="./output/classes"
+           includes="META-INF/**,org/jboss/example/**/MDBExample.class">
+      </jar>
+   </target>
+
+   <target name="ear" depends="jar">
+      <jar destfile="./output/lib/mdb-example.ear">
+         <zipfileset dir="./output/lib" includes="mdb-example.jar"/>
+         <zipfileset dir="./etc/EAR-META-INF" prefix="META-INF"/>
+      </jar>
+   </target>
+
+   <target name="deploy" depends="ear">
+      <copy file="./output/lib/mdb-example.ear"
+            todir="${jboss.home}/server/${jboss.configuration}/deploy"/>
+      <antcall target="sleep"><param name="sleep.interval" value="5"/></antcall>
+   </target>
+
+   <target name="run" depends="deploy">
+      <antcall target="send"/>
+      <antcall target="undeploy"/>
+   </target>
+
+   <target name="send">
+      <!-- MDBExample expects to find the name of the queue to connect to as value of the
+           'example.queue.name' property, which *may* be defined by calling ants when this example
+            is used in a smoke test -->
+      <java classname="org.jboss.example.jms.mdb.Sender"
+         classpathref="execution.classpath" fork="yes" failonerror="true">
+         <sysproperty key="example.queue.name" value="${example.queue.name}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=example"/>
+          -->
+      </java>
+   </target>
+
+   <target name="undeploy">
+      <delete file="${jboss.home}/server/${jboss.configuration}/deploy/mdb-example.ear" quiet="true"/>
+   </target>
+
+   <target name="clean" depends="undeploy">
+      <delete dir="./output" quiet="true"/>
+      <delete dir="../common/output" quiet="true"/>
+   </target>
+
+   <target name="sleep">
+      <echo message="Sleeping for ${sleep.interval} seconds ..."/>
+      <sleep seconds="${sleep.interval}"/>
+   </target>
+
+</project>
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/EAR-META-INF/application.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/EAR-META-INF/application.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/EAR-META-INF/application.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE application PUBLIC
+        "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
+        "http://java.sun.com/dtd/application_1_3.dtd">
+
+<application>
+
+  <display-name>MDB Example</display-name>
+  <module>
+    <ejb>mdb-example.jar</ejb>
+  </module>
+
+</application>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/EAR-META-INF/jboss-app.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/EAR-META-INF/jboss-app.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/EAR-META-INF/jboss-app.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+
+<!DOCTYPE jboss-app
+    PUBLIC "-//JBoss//DTD J2EE Application 4.0//EN"
+    "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
+
+<jboss-app>
+   <loader-repository>org.jboss.messaging.examples:loader=mdb-example.ear</loader-repository>
+</jboss-app>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/META-INF/ejb-jar.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/META-INF/ejb-jar.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/META-INF/ejb-jar.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,16 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
+    "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
+
+<ejb-jar>
+    <enterprise-beans>
+        <message-driven>
+            <ejb-name>MDBExample</ejb-name>
+            <ejb-class>org.jboss.example.jms.mdb.MDBExample</ejb-class>
+            <transaction-type>Container</transaction-type>
+            <message-driven-destination>
+               <destination-type>javax.jms.Queue</destination-type>
+            </message-driven-destination>
+        </message-driven>
+    </enterprise-beans>
+</ejb-jar>
\ No newline at end of file

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/META-INF/jboss.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/META-INF/jboss.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/META-INF/jboss.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jboss PUBLIC
+   "-//JBoss//DTD JBOSS 3.0//EN"
+   "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
+<jboss>
+
+   <enterprise-beans>
+      <message-driven>
+         <ejb-name>MDBExample</ejb-name>
+         <destination-jndi-name>queue/@QUEUE_NAME@</destination-jndi-name>
+      </message-driven>
+   </enterprise-beans>
+
+</jboss>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/jndi.properties
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/jndi.properties	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/jndi.properties	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,4 @@
+### JBossNS properties
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/log4j.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/log4j.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/etc/log4j.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- $Id: log4j.xml 536 2005-12-22 06:28:39Z ovidiu $ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p @%t [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+   </root>
+
+</log4j:configuration>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/src/org/jboss/example/jms/mdb/MDBExample.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/src/org/jboss/example/jms/mdb/MDBExample.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/src/org/jboss/example/jms/mdb/MDBExample.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,167 @@
+/**
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.example.jms.mdb;
+
+import javax.ejb.EJBException;
+import javax.ejb.MessageDrivenBean;
+import javax.ejb.MessageDrivenContext;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+/**
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2868 $</tt>
+ 
+ * $Id: MDBExample.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+public class MDBExample implements MessageDrivenBean, MessageListener
+{
+   private MessageDrivenContext ctx;
+   
+   private ConnectionFactory cf = null;
+   
+   public void onMessage(Message m)
+   {
+      Session session = null;
+      Connection conn = null;
+      
+      try
+      {
+         TextMessage tm = (TextMessage)m;
+         
+         String text = tm.getText();
+         System.out.println("message " + text + " received");
+         String result = process(text);
+         System.out.println("message processed, result: " + result);
+         
+         conn = getConnection();
+         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         
+         Destination replyTo = m.getJMSReplyTo();
+         MessageProducer producer = session.createProducer(replyTo);
+         TextMessage reply = session.createTextMessage(result);
+         
+         producer.send(reply);
+         producer.close();
+         
+      }
+      catch(Exception e)
+      {
+         ctx.setRollbackOnly();
+         e.printStackTrace();
+         System.out.println("The Message Driven Bean failed!");
+      }
+      finally
+      {
+         if (conn != null)
+         {
+            try
+            {
+               closeConnection(conn);
+            }
+            catch(Exception e)
+            {
+               System.out.println("Could not close the connection!" +e);
+            }
+         }
+      }
+   }
+   
+   private String process(String text)
+   {
+      // flip the string
+      
+      String result = "";
+      
+      for(int i = 0; i < text.length(); i++)
+      {
+         result = text.charAt(i) + result;
+      }
+      return result;
+   }
+   
+   public Connection getConnection() throws Exception
+   {      
+      Connection connection = null;
+      
+      try
+      {
+         connection = cf.createConnection();
+         connection.start();        
+      }
+      catch(Exception e )
+      {
+         if(connection != null)
+         {
+            closeConnection(connection);
+         }
+         System.out.println("Failed to get connection...exception is " + e);
+         throw e;
+      }
+      
+      return connection;
+   }
+   
+   public void closeConnection(Connection con) throws Exception
+   {      
+      try
+      {
+         con.close();         
+      }
+      catch(JMSException e)
+      {
+         System.out.println("Could not close connection " + con + " exception was " + e);
+      }
+   }
+   
+   public void ejbCreate()
+   {
+      try
+      {
+         InitialContext ic = new InitialContext();
+         
+         cf = (ConnectionFactory)ic.lookup("java:/JmsXA");
+         
+         ic.close();
+      }
+      catch(Exception e)
+      {
+         e.printStackTrace();
+         throw new EJBException("Failure to get connection factory: " + e.getMessage());
+      }
+   }
+   
+   public void ejbRemove() throws EJBException
+   {
+      try
+      {
+         if(cf != null)
+         {
+            cf = null;
+         }
+      }
+      catch(Exception e)
+      {
+         throw new EJBException("ejbRemove", e);
+      }
+   }
+   
+   public void setMessageDrivenContext(MessageDrivenContext ctx)
+   {
+      this.ctx = ctx;
+   }
+   
+   
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/src/org/jboss/example/jms/mdb/Sender.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/src/org/jboss/example/jms/mdb/Sender.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb/src/org/jboss/example/jms/mdb/Sender.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,114 @@
+/*
+ * 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.
+ */
+package org.jboss.example.jms.mdb;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+import org.jboss.example.jms.common.ExampleSupport;
+
+/**
+ * This example deploys a simple Message Driven Bean that processes messages sent to a test queue.
+ * Once it receives a message and "processes" it, the MDB sends an acknowledgment message to a
+ * temporary destination created by the sender for this purpose. The example is considered
+ * successful if the sender receives the acknowledgment message.
+ *
+ * Since this example is also used by the smoke test, it is essential that the VM exits with exit
+ * code 0 in case of successful execution and a non-zero value on failure.
+ *
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2868 $</tt>
+ *
+ * $Id: Sender.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+public class Sender extends ExampleSupport
+{
+   public void example() throws Exception
+   {
+      String destinationName = getDestinationJNDIName();
+                  
+      InitialContext ic = new InitialContext();
+            
+      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
+      Queue queue = (Queue)ic.lookup(destinationName);
+                 
+      log("Queue " + destinationName + " exists");            
+      
+      Connection connection = null;
+      
+      try
+      {
+         connection = cf.createConnection();
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer sender = session.createProducer(queue);      
+               
+         Queue temporaryQueue = session.createTemporaryQueue();
+         MessageConsumer consumer = session.createConsumer(temporaryQueue);            
+         
+         TextMessage message = session.createTextMessage("Hello!");
+         message.setJMSReplyTo(temporaryQueue);            
+         
+         sender.send(message);
+                     
+         log("The " + message.getText() + " message was successfully sent to the " + queue.getQueueName() + " queue");
+   
+         connection.start();
+         
+         message = (TextMessage)consumer.receive(5000);
+              
+         if (message == null)
+         {
+            throw new Exception("Have not received any reply. The example failed!");
+         }
+               
+         log("Received message: " + message.getText());
+         
+         assertEquals("!olleH", message.getText());
+                     
+         displayProviderInfo(connection.getMetaData());
+      }
+      finally
+      {
+         if (connection != null)
+         {
+            connection.close();
+         }
+      }
+   }
+           
+   protected boolean isQueueExample()
+   {
+      return true;
+   }
+   
+   public static void main(String[] args)
+   {
+      new Sender().run();
+   }
+   
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/README.html
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/README.html	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/README.html	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,148 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+  <title>JBoss Messaging Example - Message Driven Bean Failure</title>
+</head>
+<body>
+<br>
+<h1>Message Driven Bean Behavior on Failure Example</h1>
+$Revision: 1459 $
+<h2>Overview</h2>
+<br>
+This example deploys a simple Message Driven Bean that processes
+messages sent to a test queue. The Message Driven Bean is coded in such
+a way that upon the first arrival of a message, it throws a
+RuntimeException, simulating a runtime processing failure. <br>
+<br>
+The expected behavior of the MDB Container is to try to redeliver the
+message, which is what it hopefully does. Since the example framework
+took the precaution to insure that there is only one single type of MDB
+container listening on the example queue, the messages will be
+redelivered to an MDB of the same type. Upon the second arrival, the
+MDB
+instance will "let the message pass", will correctly "process" it and
+forward the result to temporary queue created by the sender for exactly
+this purpose. The
+example is considered&nbsp; successful if the sender receives the
+acknowledgment message. The successful example proves that message
+redelivery on failure works.<br>
+<br>
+This example relies on having access to a running JBoss Messaging
+instance.
+The JBoss Messaging instance must be installed and started according to
+the
+"Installation" paragraph from the release documentation.&nbsp; However,
+the example will automatically deploy its own queue, unless a queue
+with the same name is already deployed.<br>
+<br>
+This example also relies on having access to <span
+ style="font-family: monospace;">jboss-messaging-client.jar</span>
+archive that comes with the release bundle. If you run this example
+from
+an unzipped installation bundle, the example run script is correctly
+configured to find the client jar. Otherwise, you must modify example's
+<span style="font-family: monospace;">build.xml</span>
+accordingly.&nbsp;<br>
+<br>
+<h2>Running the example</h2>
+1. Set up the JBOSS_HOME environment variable to point to the JBoss
+instance you deployed JBoss Messaging into. For example, if you
+deployed JBoss Messaging in <span style="font-family: monospace;">C:\jboss-4.2.0.GA\server\messaging\deploy,</span>
+then your JBOSS_HOME value should be <span
+ style="font-family: monospace;">C:\jboss-4.2.0.GA</span><br>
+<span style="font-family: monospace;"></span><br>
+2. Go to the example's home directory<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">cd
+...\examples\mdb-failure</span><br>
+</div>
+<br>
+3. Run the example:<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">ant</span>
+<br>
+<br>
+<br>
+</div>
+The output of a successful run should be similar to:<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; background-color: rgb(204, 204, 204); margin-left: 40px;"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;">
+<pre>
+$ ant
+Buildfile: build.xml
+
+identify:
+     [echo] ###########################################################################
+     [echo] #                    Running the MDB Failure example                      #
+     [echo] ###########################################################################
+     [echo] The queue:      testQueue
+     [echo] The client jar: ../../../output/lib/jboss-messaging-client.jar
+
+sanity-check:
+
+init:
+    [mkdir] Created dir: C:\java\messaging\docs\examples\mdb-failure\output\classes\META-INF
+    [mkdir] Created dir: C:\java\messaging\docs\examples\mdb-failure\output\lib\META-INF
+    [mkdir] Created dir: C:\java\messaging\docs\examples\common\output\classes
+
+compile:
+    [javac] Compiling 5 source files to C:\java\messaging\docs\examples\common\output\classes
+    [javac] Compiling 2 source files to C:\java\messaging\docs\examples\mdb-failure\output\classes
+    [javac] Note: C:\java\messaging\docs\examples\mdb-failure\src\org\jboss\example\jms\mdbfailure\MDBFailureExample.java uses unchecked or unsafe operations.
+    [javac] Note: Recompile with -Xlint:unchecked for details.
+
+jar:
+     [copy] Copying 2 files to C:\java\messaging\docs\examples\mdb-failure\output\classes\META-INF
+      [jar] Building jar: C:\java\messaging\docs\examples\mdb-failure\output\lib\mdb-failure-example.jar
+
+deploy:
+     [copy] Copying 1 file to C:\jboss-4.2.0.GA\server\messaging\deploy
+
+sleep:
+     [echo] Sleeping for 5 seconds ...
+
+run:
+
+send:
+     [java] Queue /queue/testQueue exists
+     [java] The "Hello!" message was successfully sent to the testQueue queue
+     [java] Received message: !olleH
+     [java] The example connected to JBoss Messaging version 1.3.0.GA (1.3)
+     [java] 
+     [java] #####################
+     [java] ###    SUCCESS!   ###
+     [java] #####################
+
+sleep:
+     [echo] Sleeping for 10 seconds ...
+
+undeploy:
+   [delete] Deleting: C:\jboss-4.2.0.GA\server\messaging\deploy\mdb-failure-example.jar
+
+BUILD SUCCESSFUL
+Total time: 19 seconds
+</pre>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<br>
+<br style="font-family: courier new,courier,monospace;">
+<hr
+ style="width: 100%; height: 2px; font-family: courier new,courier,monospace;"><br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</body>
+</html>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/build.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/build.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/build.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+   To run the example, set JBOSS_HOME and run ant (with no parameters)
+
+   $Id: build.xml 974 2006-05-23 03:35:38Z ovidiu $
+
+ -->
+
+<project name="MDBFailureExample" default="run">
+
+   <property environment="ENV"/>
+
+   <property name="undeploy.quiet" value="false"/>
+   <property name="undeploy.failonerror" value="true"/>
+
+   <!-- These properties may be overriden by calling ants when this example is used in a smoke test -->
+   <property file="../examples.properties"/>
+   <property name="messaging.client.jar.path" value="../../"/>
+   <property name="messaging.client.jar.name" value="jboss-messaging-client.jar"/>
+   <property name="jboss.home" value="${ENV.JBOSS_HOME}"/>
+   <property name="jboss.configuration" value="messaging"/>
+   <property name="example.queue.name" value="testQueue"/>
+
+   <path id="common.compilation.classpath">
+      <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </path>
+
+   <path id="example.compilation.classpath">
+      <path refid="common.compilation.classpath"/>
+      <pathelement path="../common/output/classes"/>
+   </path>
+
+   <path id="execution.classpath">
+      <pathelement path="./etc"/>
+      <pathelement path="../common/output/classes"/>
+      <pathelement path="./output/classes"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/jboss-remoting.jar"/>
+      <fileset file="${jboss.home}/client/jbossall-client.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/log4j.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/javassist.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/trove.jar"/>
+   </path>
+
+   <target name="identify">
+      <echo message="###########################################################################"/>
+      <echo message="#                    Running the MDB Failure example                      #"/>
+      <echo message="###########################################################################"/>
+      <echo message="The queue:      ${example.queue.name}"/>
+      <echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </target>
+
+   <target name="sanity-check" depends="identify">
+      <available property="client.jar.present" file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fail message="Could not find client jar ${messaging.client.jar.path}/${messaging.client.jar.name}"
+            unless="client.jar.present"/>
+   </target>
+
+   <target name="init" depends="sanity-check">
+      <mkdir dir="./output/classes/META-INF"/>
+      <mkdir dir="./output/lib/META-INF"/>
+      <mkdir dir="../common/output/classes"/>
+   </target>
+
+   <target name="compile" depends="init">
+      <javac destdir="../common/output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="../common/src"/>
+         <classpath refid="common.compilation.classpath"/>
+      </javac>
+      <javac destdir="./output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="./src"/>
+         <classpath refid="example.compilation.classpath"/>
+      </javac>
+   </target>
+
+   <target name="jar" depends="compile">
+      <copy todir="./output/classes/META-INF" filtering="true">
+         <fileset dir="./etc/META-INF" includes="*"/>
+         <filterset>
+            <filter token="QUEUE_NAME" value="${example.queue.name}"/>
+         </filterset>
+      </copy>
+      <jar destfile="./output/lib/mdb-failure-example.jar"
+           basedir="./output/classes"
+           includes="META-INF/**,org/jboss/example/**/MDBFailureExample.class"/>
+   </target>
+
+   <target name="deploy" depends="jar">
+      <copy file="./output/lib/mdb-failure-example.jar"
+            todir="${jboss.home}/server/${jboss.configuration}/deploy"/>
+      <antcall target="sleep"><param name="sleep.interval" value="5"/></antcall>
+   </target>
+
+   <target name="run" depends="deploy">
+      <antcall target="send"/>
+      <antcall target="sleep"><param name="sleep.interval" value="10"/></antcall>
+      <antcall target="undeploy">
+         <param name="undeploy.quiet" value="false"/>
+         <param name="undeploy.failonerror" value="true"/>
+      </antcall>
+   </target>
+
+   <target name="send">
+      <!-- MDBFailureExample expects to find the name of the queue to connect to as value of the
+           'example.queue.name' property, which *may* be defined by calling ants when this example
+            is used in a smoke test -->
+      <java classname="org.jboss.example.jms.mdbfailure.Sender"
+         classpathref="execution.classpath" fork="yes" failonerror="true">
+         <sysproperty key="example.queue.name" value="${example.queue.name}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=example"/>
+          -->
+      </java>
+   </target>
+
+   <target name="undeploy">
+      <delete file="${jboss.home}/server/${jboss.configuration}/deploy/mdb-failure-example.jar"
+              quiet="${undeploy.quiet}" failonerror="${undeploy.failonerror}"/>
+   </target>
+
+   <target name="clean" depends="undeploy">
+      <delete dir="./output" quiet="true"/>
+      <delete dir="../common/output" quiet="true"/>
+   </target>
+
+   <target name="sleep">
+      <echo message="Sleeping for ${sleep.interval} seconds ..."/>
+      <sleep seconds="${sleep.interval}"/>
+   </target>
+
+</project>
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/etc/META-INF/ejb-jar.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/etc/META-INF/ejb-jar.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/etc/META-INF/ejb-jar.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,26 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
+    "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
+
+<ejb-jar>
+    <enterprise-beans>
+        <message-driven>
+            <ejb-name>MDBFailureExample</ejb-name>
+            <ejb-class>org.jboss.example.jms.mdbfailure.MDBFailureExample</ejb-class>
+            <transaction-type>Container</transaction-type>
+            <message-driven-destination>
+               <destination-type>javax.jms.Queue</destination-type>
+            </message-driven-destination>
+        </message-driven>
+    </enterprise-beans>
+
+ <assembly-descriptor>
+        <container-transaction>
+            <method>
+                <ejb-name>MDBFailureExample</ejb-name>
+                <method-name>*</method-name>
+            </method>
+            <trans-attribute>Required</trans-attribute>
+        </container-transaction>
+    </assembly-descriptor>
+</ejb-jar>
\ No newline at end of file

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/etc/META-INF/jboss.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/etc/META-INF/jboss.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/etc/META-INF/jboss.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jboss PUBLIC
+   "-//JBoss//DTD JBOSS 3.0//EN"
+   "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
+<jboss>
+
+   <enterprise-beans>
+      <message-driven>
+         <ejb-name>MDBFailureExample</ejb-name>
+         <destination-jndi-name>queue/@QUEUE_NAME@</destination-jndi-name>
+      </message-driven>
+   </enterprise-beans>
+
+</jboss>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/etc/jndi.properties
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/etc/jndi.properties	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/etc/jndi.properties	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,4 @@
+### JBossNS properties
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/etc/log4j.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/etc/log4j.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/etc/log4j.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- $Id: log4j.xml 536 2005-12-22 06:28:39Z ovidiu $ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p @%t [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+   </root>
+
+</log4j:configuration>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/src/org/jboss/example/jms/mdbfailure/MDBFailureExample.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/src/org/jboss/example/jms/mdbfailure/MDBFailureExample.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/src/org/jboss/example/jms/mdbfailure/MDBFailureExample.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,207 @@
+/**
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.example.jms.mdbfailure;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.ejb.EJBException;
+import javax.ejb.MessageDrivenBean;
+import javax.ejb.MessageDrivenContext;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+/**
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 849 $</tt>
+
+ * $Id: MDBFailureExample.java 849 2006-03-31 17:17:09Z ltexier $
+ */
+public class MDBFailureExample implements MessageDrivenBean, MessageListener
+{
+
+   private MessageDrivenContext ctx;
+
+   private ConnectionFactory cf = null;
+
+   private static Set messageIDs = new HashSet();
+
+   public void onMessage(Message m)
+   {
+      Session session = null;
+      Connection conn = null;
+
+      try
+      {
+
+         TextMessage tm = (TextMessage)m;
+
+         String text = tm.getText();
+
+         System.out.println("message " + text + " received");
+
+         System.out.println("message " + (tm.getJMSRedelivered() ? "" : "NOT ")+ "marked as \"redelivered\"");
+
+
+         // if it is the first time any of the MDB instances from the pool sees the message, the
+         // message will cause the MDB instance to "crash"
+
+         synchronized(messageIDs)
+         {
+            if (!messageIDs.contains(tm.getJMSMessageID()))
+            {
+               messageIDs.add(m.getJMSMessageID());
+
+               System.out.println("The message has \"broken\" our MDB ...");
+
+               // "crashing" the MDB. The exception won't be caught by our catch clause and it will
+               // bubble up
+
+               throw new RuntimeException("Unfortunate events happen ...");
+
+            }
+            else
+            {
+               System.out.println("The message is already \"known\", so let it be processed");
+            }
+         }
+
+         String result = process(text);
+         System.out.println("message processed, result: " + result);
+
+         conn = getConnection();
+         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         Destination replyTo = m.getJMSReplyTo();
+         MessageProducer producer = session.createProducer(replyTo);
+         TextMessage reply = session.createTextMessage(result);
+
+         producer.send(reply);
+         producer.close();
+
+      }
+      catch(JMSException e)
+      {
+         ctx.setRollbackOnly();
+         e.printStackTrace();
+         System.out.println("The Message Driven Bean failed!");
+      }
+      finally
+      {
+         if (conn != null)
+         {
+            try
+            {
+                closeConnection(conn);
+            }
+            catch(Exception e)
+            {
+                System.out.println("Could not close the connection!" +e);
+            }
+         }
+      }
+   }
+
+   private String process(String text)
+   {
+      // flip the string
+
+      String result = "";
+
+      for(int i = 0; i < text.length(); i++)
+      {
+         result = text.charAt(i) + result;
+      }
+      return result;
+   }
+
+   public Connection getConnection() throws JMSException
+   {
+
+        Connection connection = null;
+
+        try
+        {
+            connection = cf.createConnection();
+            connection.start();
+
+        }
+        catch(JMSException e)
+        {
+           if(connection != null)
+           {
+               closeConnection(connection);
+           }
+           System.out.println("Failed to get connection... exception is " + e);
+           throw e;
+        }
+
+        return connection;
+    }
+
+    public void closeConnection(Connection con) throws JMSException
+    {
+
+       try
+       {
+           con.close();
+
+       }
+       catch(JMSException jmse)
+       {
+           System.out.println("Could not close connection " + con +" exception was " +jmse);
+           throw jmse;
+       }
+    }
+
+    public void ejbCreate()
+    {
+       try
+       {
+          InitialContext ic = new InitialContext();
+
+          cf = (ConnectionFactory)ic.lookup("java:/JmsXA");
+
+          ic.close();
+       }
+       catch(Exception e)
+       {
+          e.printStackTrace();
+          throw new EJBException("Failure to get connection factory: " + e.getMessage());
+       }
+    }
+
+    public void ejbRemove() throws EJBException
+    {
+       try
+       {
+          if(cf != null)
+          {
+              cf = null;
+          }
+       }
+       catch(Exception e)
+       {
+          throw new EJBException("ejbRemove", e);
+       }
+    }
+
+    public void setMessageDrivenContext(MessageDrivenContext ctx)
+    {
+       this.ctx = ctx;
+    }
+
+
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/src/org/jboss/example/jms/mdbfailure/Sender.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/src/org/jboss/example/jms/mdbfailure/Sender.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/mdb-failure/src/org/jboss/example/jms/mdbfailure/Sender.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,142 @@
+/*
+* 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.
+*/
+package org.jboss.example.jms.mdbfailure;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+import org.jboss.example.jms.common.ExampleSupport;
+
+/**
+ * This example deploys a simple Message Driven Bean that processes messages sent to a test queue.
+ * The MDB container is configured to use CMT.
+ *
+ * We send a special tagged message (we do this by adding a custom property to the message) to the
+ * MDB. The MDB is programmed to "fail" when handling such a message, by throwing a
+ * RuntimeException, but not before "clearing" the failure-inducing tag.
+ *
+ * The expected behavior for the JMS provider is to redeliver the message, this time without the
+ * "failure tag". The MDB is supposed to process it and put it on response queue, from were it will
+ * be read by the client.
+ *
+ * The example is considered successful if the client receives the "processed" message.
+ *
+ * Since this example is also used by the smoke test, it is essential that the VM exits with exit
+ * code 0 in case of successful execution and a non-zero value on failure.
+ *
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 884 $</tt>
+ *
+ * $Id: Sender.java 884 2006-04-12 01:04:10Z ovidiu $
+ */
+public class Sender extends ExampleSupport
+{
+   public void example() throws Exception
+   {
+
+      String destinationName = getDestinationJNDIName();
+
+      InitialContext ic = new InitialContext();
+
+      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
+      Queue queue = (Queue)ic.lookup(destinationName);
+
+
+
+      log("Queue " + destinationName + " exists");
+
+
+
+      Connection connection = cf.createConnection();
+      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+      MessageProducer sender = session.createProducer(queue);
+
+
+
+      Queue temporaryQueue = session.createTemporaryQueue();
+      MessageConsumer consumer = session.createConsumer(temporaryQueue);
+
+
+
+      TextMessage message = session.createTextMessage("Hello!");
+      message.setJMSReplyTo(temporaryQueue);
+
+
+
+      sender.send(message);
+
+
+
+      log("The \"" + message.getText() + "\" message was successfully sent to the " + queue.getQueueName() + " queue");
+
+
+
+      connection.start();
+
+
+
+      message = (TextMessage)consumer.receive(5000);
+
+
+      if (message == null)
+      {
+         throw new Exception("Have not received any reply. The example failed!");
+      }
+
+
+      log("Received message: " + message.getText());
+
+
+
+      assertEquals("!olleH", message.getText());
+
+
+
+      displayProviderInfo(connection.getMetaData());
+
+
+      connection.close();
+   }
+
+
+
+
+   protected boolean isQueueExample()
+   {
+      return true;
+   }
+
+
+
+
+   public static void main(String[] args)
+   {
+      new Sender().run();
+   }
+
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/README.html
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/README.html	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/README.html	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,132 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+  <title>JBoss Messaging Example - JMS Queue</title>
+</head>
+<body>
+<br>
+<h1>JBoss Messaging Queue Example</h1>
+$Revision: 2750 $
+<h2>Overview</h2>
+<br>
+This example creates a JMS Connection to a JBoss Messaging instance
+and uses it to create a session and a message producer, which sends a
+message to the queue "queue/testQueue".&nbsp; Then, the example uses
+the same connection to create a consumer that that reads
+a single message from the queue. The example is considered successful
+if the message consumer receives without any error the message that was
+sent by the producer. <br>
+<br>
+This example relies on having access to a running JBoss Messaging
+instance.
+The JBoss Messaging instance must be installed and started according to
+the
+"Installation" paragraph from the release documentation. However, the
+example will automatically deploy its own queue, unless a queue with
+the same name is already deployed. <br>
+<br>
+This example also relies on having access to <span
+ style="font-family: monospace;">jboss-messaging-client.jar</span>
+archive that comes with the release bundle. If you run this example
+from an unzipped installation bundle, the example run script is
+correctly configured to find the client jar. Otherwise, you must modify
+example's <span style="font-family: monospace;">build.xml</span>
+accordingly.<br>
+<br>
+<span style="font-style: italic;"></span>
+<h2>Running the example</h2>
+1. Set up the JBOSS_HOME environment variable to point to the JBoss
+instance you deployed JBoss Messaging into. For example, if you
+deployed JBoss Messaging in <span style="font-family: monospace;">C:\jboss-4.2.0.GA\server\messaging\deploy,</span>
+then your JBOSS_HOME value should be <span
+ style="font-family: monospace;">C:\</span><span
+ style="font-family: monospace;">jboss-4.2.0.GA</span><br>
+<span style="font-family: monospace;"></span><span
+ style="font-family: monospace;"></span><br>
+2. Go to the example's home directory<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">cd
+...\examples\queue</span><br>
+</div>
+<br>
+3. Run the example:<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">ant</span>
+<br>
+<br>
+<br>
+</div>
+The output of a successful run should be similar to:<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; background-color: rgb(204, 204, 204); margin-left: 40px;"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;">
+<pre>
+Buildfile: build.xml
+
+identify:
+     [echo] ###########################################################################
+     [echo] #                       Running the QUEUE example                         #
+     [echo] ###########################################################################
+     [echo] The queue:      testQueue
+     [echo] The client jar: ../../../output/lib/jboss-messaging-client.jar
+
+sanity-check:
+
+init:
+    [mkdir] Created dir: C:\java\messaging\docs\examples\queue\output\classes
+    [mkdir] Created dir: C:\java\messaging\docs\examples\common\output\classes
+
+compile:
+    [javac] Compiling 5 source files to C:\java\messaging\docs\examples\common\output\classes
+    [javac] Compiling 1 source file to C:\java\messaging\docs\examples\queue\output\classes
+
+run:
+     [java] Queue /queue/testQueue exists
+     [java] The message was successfully sent to the testQueue queue
+     [java] Received message: Hello!
+     [java] The example connected to JBoss Messaging version 1.3.0.GA (1.3)
+     [java] 
+     [java] #####################
+     [java] ###    SUCCESS!   ###
+     [java] #####################
+
+BUILD SUCCESSFUL
+Total time: 4 seconds
+</pre>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<div style="margin-left: 40px;"><br>
+</div>
+<br>
+<br>
+<h2>Troublesooting</h2>
+<h3>1. I get <span style="font-family: monospace;">"javax.jms.JMSSecurityException:
+User null is NOT authenticated" <br>
+</span></h3>
+You probably didn't install JBoss Messaging correctly. A fresh JBoss
+Messaging installation requires changes in the security configuration
+of a <span style="font-family: monospace;">default </span>JBoss
+instance, specifically a properly configured "<small><span
+ style="font-family: courier new,courier,monospace;">messaging</span></small>"
+security domain.&nbsp; Follow the instructions from the "Installation"
+paragraph of the release documentation. <br>
+<br>
+<br>
+<hr style="width: 100%; height: 2px;"><br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</body>
+</html>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/build.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/build.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/build.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+   To run the example, set JBOSS_HOME and run ant (with no parameters)
+
+   $Id: build.xml 3140 2007-09-26 08:44:19Z ataylor $
+
+ -->
+
+<project name="QueueExample" default="run">
+
+   <property environment="ENV"/>
+
+   <!-- These properties may be overriden by calling ants when this example is used in a smoke test -->
+   <property file="../examples.properties"/>
+   <property name="messaging.client.jar.path" value="../../"/>
+   <property name="messaging.client.jar.name" value="jboss-messaging-client.jar"/>
+   <property name="jboss.home" value="${ENV.JBOSS_HOME}"/>
+   <property name="jboss.configuration" value="messaging"/>
+   <property name="example.queue.name" value="testQueue"/>
+
+   <path id="common.compilation.classpath">
+      <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </path>
+
+   <path id="example.compilation.classpath">
+      <path refid="common.compilation.classpath"/>
+      <pathelement path="../common/output/classes"/>
+   </path>
+
+   <path id="execution.classpath">
+      <pathelement path="./etc"/>
+      <pathelement path="../common/output/classes"/>
+      <pathelement path="./output/classes"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/jboss-remoting.jar"/>
+      <fileset file="${jboss.home}/client/jbossall-client.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/log4j.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/javassist.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/trove.jar"/>
+   </path>
+
+   <target name="identify">
+      <echo message="###########################################################################"/>
+      <echo message="#                       Running the QUEUE example                         #"/>
+      <echo message="###########################################################################"/>
+      <echo message="The queue:      ${example.queue.name}"/>
+      <echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </target>
+
+   <target name="sanity-check" depends="identify">
+      <available property="client.jar.present" file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fail message="Could not find client jar ${messaging.client.jar.path}/${messaging.client.jar.name}"
+            unless="client.jar.present"/>
+   </target>
+
+   <target name="init" depends="sanity-check">
+      <mkdir dir="./output/classes"/>
+      <mkdir dir="../common/output/classes"/>
+   </target>
+
+   <target name="compile" depends="init">
+      <javac destdir="../common/output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="../common/src"/>
+         <classpath refid="common.compilation.classpath"/>
+      </javac>
+      <javac destdir="./output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="./src"/>
+         <classpath refid="example.compilation.classpath"/>
+      </javac>
+   </target>
+
+   <target name="run" depends="compile">
+      <!-- QueueExample expects to find the name of the queue to connect to as value of the
+           'example.queue.name' property, which *may* be defined by calling ants when this example
+            is used in a smoke test -->
+      <java classname="org.jboss.example.jms.queue.QueueExample"
+            classpathref="execution.classpath" fork="yes" failonerror="true">
+         <sysproperty key="example.queue.name" value="${example.queue.name}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=example"/>
+         -->
+      </java>
+   </target>
+
+   <target name="clean">
+      <delete dir="./output" quiet="true"/>
+      <delete dir="../common/output" quiet="true"/>
+   </target>
+
+</project>
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/etc/jndi.properties
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/etc/jndi.properties	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/etc/jndi.properties	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,4 @@
+### JBossNS properties
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/etc/log4j.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/etc/log4j.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/etc/log4j.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- $Id: log4j.xml 2318 2007-02-15 02:11:43Z ovidiu.feodorov at jboss.com $ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p @%t [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+  <root>
+      <appender-ref ref="CONSOLE"/>
+   </root>
+
+</log4j:configuration>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/src/org/jboss/example/jms/queue/QueueExample.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/src/org/jboss/example/jms/queue/QueueExample.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue/src/org/jboss/example/jms/queue/QueueExample.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,137 @@
+/*
+ * 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.
+ */
+package org.jboss.example.jms.queue;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+import org.jboss.example.jms.common.ExampleSupport;
+
+/**
+ * This example creates a JMS Connection to a JBoss Messaging instance and uses it to create a
+ * session and a message producer, which sends a message to the queue "queue/testQueue".  Then, the
+ * example uses the same connection to create a consumer that that reads a single message from the
+ * queue. The example is considered successful if the message consumer receives without any error
+ * the message that was sent by the producer.
+ * 
+ * Since this example is also used by the smoke test, it is essential that the VM exits with exit
+ * code 0 in case of successful execution and a non-zero value on failure.
+ *
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:luc.texier at jboss.org">Luc Texier</a>
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * @version <tt>$Revision: 2868 $</tt>
+ *
+ * $Id: QueueExample.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+public class QueueExample extends ExampleSupport
+{
+   
+   public void example() throws Exception
+   {
+      String destinationName = getDestinationJNDIName();
+      
+      InitialContext ic = null;
+      ConnectionFactory cf = null;
+      Connection connection =  null;
+
+      try
+      {         
+         ic = new InitialContext();
+         
+         cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
+         Queue queue = (Queue)ic.lookup(destinationName);
+         log("Queue " + destinationName + " exists");
+         
+         connection = cf.createConnection();
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer sender = session.createProducer(queue);
+         
+         TextMessage message = session.createTextMessage("Hello!");
+         sender.send(message);
+         log("The message was successfully sent to the " + queue.getQueueName() + " queue");
+         
+         MessageConsumer consumer =  session.createConsumer(queue);
+         
+         connection.start();
+         
+         message = (TextMessage)consumer.receive(2000);
+
+         log("Received message: " + message.getText());
+         assertEquals("Hello!", message.getText());
+         
+         displayProviderInfo(connection.getMetaData());
+                 
+      }
+      finally
+      {         
+         if(ic != null)
+         {
+            try
+            {
+               ic.close();
+            }
+            catch(Exception e)
+            {
+               throw e;
+            }
+         }
+         
+         // ALWAYS close your connection in a finally block to avoid leaks.
+         // Closing connection also takes care of closing its related objects e.g. sessions.
+         closeConnection(connection);
+      }
+   }
+   
+   private void closeConnection(Connection con)
+   {      
+      try
+      {
+         if (con != null)
+         {
+            con.close();
+         }         
+      }
+      catch(JMSException jmse)
+      {
+         log("Could not close connection " + con +" exception was " + jmse);
+      }
+   }
+      
+   protected boolean isQueueExample()
+   {
+      return true;
+   }
+   
+   public static void main(String[] args)
+   {
+      new QueueExample().run();
+   }
+   
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/README.html
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/README.html	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/README.html	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,220 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+  <title>JBoss Messaging Example - Queue failover</title>
+</head>
+<body>
+<br>
+<h1>JBoss Messaging Queue Failover Example</h1>
+$Revision: 1017 $
+<h2>Overview</h2>
+<br>
+This example demonstrates the transparent failover of a JMS consumer. A
+connection is made on one node of the cluster and two messages are
+sent. A consumer is created and one of the messages is consumed. The
+node the connection is connected to then fails and the connection fails
+over onto the second node. The second message is then consumed using
+the same consumer.<span style="font-weight: bold;"></span>
+<br>
+<br>
+This example relies on having access to a running JBoss Messaging
+cluster with at least two nodes. The JBoss Messaging cluster must be
+installed and started according to the userguide.
+<br>
+This example also relies on having access to the <span
+ style="font-family: monospace;">jboss-messaging-client.jar</span>
+archive included with the release bundle. If you run this example
+from
+an unzipped installation bundle, the example run script is correctly
+configured to find the client jar. Otherwise, you must modify example's
+<span style="font-family: monospace;">build.xml</span> accordingly.<br>
+<span style="font-style: italic;"></span><br>
+<h2>Running the example</h2>
+<span style="font-family: monospace;"></span><span
+ style="font-family: monospace;"></span><br>
+1. Make sure that a JBoss Messaging cluster with at least two nodes is
+up and running.<br>
+<br>
+2. Go to the example's home directory<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">cd
+...\examples\queue-failover</span><br>
+</div>
+<br>
+3. Run the example:<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">ant</span>
+<br>
+<br>
+<br>
+</div>
+The output of a successful run should be similar to:<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; background-color: rgb(204, 204, 204); margin-left: 40px;"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;">
+      <div style="margin-left: 40px;"><br>
+      </div>
+$ ant<br>
+Buildfile: build.xml<br>
+      <br>
+identify:
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+###########################################################################
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+Running the QUEUE FAILOVER example
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;&nbsp; #
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+###########################################################################
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo] The
+queue:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; testDistributedQueue
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo] The client jar:
+../../../output/lib/jboss-messaging-client.jar
+      <br>
+      <br>
+sanity-check:
+      <br>
+      <br>
+init:
+      <br>
+      <br>
+compile:
+      <br>
+      <br>
+jar:
+      <br>
+      <br>
+deploy:
+      <br>
+      <br>
+sleep:
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo] Sleeping for 5 seconds ...
+      <br>
+      <br>
+run:
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] Distributed queue
+/queue/testDistributedQueue exists
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] The messages were successfully sent to
+the distributed queue
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] Received message: Hello1!
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] 11:12:22,359 ERROR @Timer-0
+[SocketClientInvoker] Got marshalling exception, exiting
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] java.io.IOException: Connection reset
+by peer: socket write error
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp;&nbsp;&nbsp;&nbsp; at
+java.net.SocketOutputStream.socketWrite0(Native Method)
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp;&nbsp;&nbsp;&nbsp; at
+java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp;&nbsp;&nbsp;&nbsp; at
+java.net.SocketOutputStream.write(SocketOutputStream.java:136)
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp;&nbsp;&nbsp;&nbsp; at
+java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp;&nbsp;&nbsp;&nbsp; at
+java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp;&nbsp;&nbsp;&nbsp; at
+java.io.DataOutputStream.flush(DataOutputStream.java:106)
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp;&nbsp;&nbsp;&nbsp; at
+org.jboss.serial.io.JBossObjectOutputStream.flush(JBossObjectOutputStream.java:248)
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp;&nbsp;&nbsp;&nbsp; at
+org.jboss.jms.server.remoting.JMSWireFormat.serialize(JMSWireFormat.java:1035)
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp;&nbsp;&nbsp;&nbsp; at
+org.jboss.jms.server.remoting.JMSWireFormat.write(JMSWireFormat.java:413)
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp;&nbsp;&nbsp;&nbsp; at
+org.jboss.remoting.transport.socket.MicroSocketClientInvoker.versionedWrite(MicroSocketClientInvoker.java:518)
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp;&nbsp;&nbsp;&nbsp; at
+org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:340)
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp;&nbsp;&nbsp;&nbsp; at
+org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:125)
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp;&nbsp;&nbsp;&nbsp; at
+org.jboss.remoting.ConnectionValidator.checkConnection(ConnectionValidator.java:184)
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp;&nbsp;&nbsp;&nbsp; at
+org.jboss.remoting.ConnectionValidator.run(ConnectionValidator.java:114)
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp;&nbsp;&nbsp;&nbsp; at
+java.util.TimerThread.mainLoop(Timer.java:512)
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp;&nbsp;&nbsp;&nbsp; at
+java.util.TimerThread.run(Timer.java:462)
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] 11:12:24,406 INFO&nbsp; @Thread-3
+[HAAspect] HAAspect.ClusteredClientConnectionFactoryDelegate[1]
+completed client-side failover
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] Received message: Hello2!
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] The example connected to JBoss
+Messaging version 1.2.0.Beta1 (1.2)
+      <br>
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] #####################
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] ###&nbsp;&nbsp;&nbsp;
+SUCCESS!&nbsp;&nbsp; ###
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] #####################
+      <br>
+      <br>
+undeploy:
+      <br>
+&nbsp;&nbsp; [delete] Deleting:
+C:\dev\jboss-4.0.5.GA\server\messaging-node0\deploy\application-server-killer.jar
+      <br>
+      <br>
+BUILD SUCCESSFUL
+      <br>
+Total time: 41 seconds
+      <br>
+      <br>
+      <br>
+      <br>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<div style="margin-left: 40px;"><br>
+</div>
+<br>
+<br>
+<br>
+<hr style="width: 100%; height: 2px;"><br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</body>
+</html>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/build.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/build.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/build.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+   To run the example, set JBOSS_HOME and run ant (with no parameters)
+
+   $Id: build.xml 974 2006-05-22 21:35:38 -0600 (Mon, 22 May 2006) ovidiu $
+
+ -->
+
+<project name="QueueFailoverExample" default="run">
+
+   <property environment="ENV"/>
+
+   <!-- These properties may be overriden by calling ants when this example is used in a smoke test -->
+   <property file="../examples.properties"/>
+   <property name="messaging.client.jar.path" value="../../"/>
+   <property name="messaging.client.jar.name" value="jboss-messaging-client.jar"/>
+   <property name="jboss.home" value="${ENV.JBOSS_HOME}"/>
+   <property name="jboss.configuration0" value="messaging-node0"/>
+   <property name="example.queue.name" value="testDistributedQueue"/>
+
+   <path id="common.compilation.classpath">
+      <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </path>
+
+   <path id="example.compilation.classpath">
+      <path refid="common.compilation.classpath"/>
+      <pathelement path="../common/output/classes"/>
+   </path>
+
+   <path id="execution.classpath">
+      <pathelement path="./etc"/>
+      <pathelement path="../common/output/classes"/>
+      <pathelement path="./output/classes"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration0}/lib/jboss-remoting.jar"/>
+      <fileset file="${jboss.home}/client/jbossall-client.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration0}/lib/log4j.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration0}/lib/javassist.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration0}/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration0}/deploy/jboss-aop-jdk50.deployer/trove.jar"/>
+   </path>
+
+   <target name="identify">
+      <echo message="###########################################################################"/>
+      <echo message="#                Running the QUEUE FAILOVER example                       #"/>
+      <echo message="###########################################################################"/>
+      <echo message="The queue:      ${example.queue.name}"/>
+      <echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </target>
+
+   <target name="sanity-check" depends="identify">
+      <available property="client.jar.present" file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fail message="Could not find client jar ${messaging.client.jar.path}/${messaging.client.jar.name}"
+            unless="client.jar.present"/>
+   </target>
+
+   <target name="init" depends="sanity-check">
+      <mkdir dir="./output/lib"/>
+      <mkdir dir="./output/classes"/>
+      <mkdir dir="../common/output/classes"/>
+   </target>
+
+   <target name="compile" depends="init">
+      <javac destdir="../common/output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="../common/src"/>
+         <classpath refid="common.compilation.classpath"/>
+      </javac>
+      <javac destdir="./output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="./src"/>
+         <classpath refid="example.compilation.classpath"/>
+      </javac>
+   </target>
+
+   <target name="jar" depends="compile">
+      <jar destfile="./output/lib/application-server-killer.jar">
+         <fileset dir="../common/etc" includes="META-INF/**"/>
+         <fileset dir="../common/output/classes" includes="org/jboss/example/jms/common/bean/*.class"/>
+      </jar>
+   </target>
+
+   <target name="deploy" depends="jar">
+      <copy file="./output/lib/application-server-killer.jar"
+            todir="${jboss.home}/server/messaging-node0/deploy"/>
+      <antcall target="sleep"><param name="sleep.interval" value="5"/></antcall>
+   </target>
+
+
+   <target name="run" depends="deploy">
+      <java classname="org.jboss.example.jms.failover.QueueFailoverExample"
+         classpathref="execution.classpath" fork="yes" failonerror="true">
+         <sysproperty key="example.queue.name" value="${example.queue.name}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=example"/>
+          -->
+      </java>
+       <antcall target="undeploy"/>
+   </target>
+
+   <target name="undeploy">
+      <delete file="${jboss.home}/server/messaging-node0/deploy/application-server-killer.jar" quiet="true"/>
+   </target>
+
+   <target name="clean" depends="undeploy">
+      <delete dir="./output" quiet="true"/>
+      <delete dir="../common/output" quiet="true"/>
+   </target>
+
+   <target name="sleep">
+      <echo message="Sleeping for ${sleep.interval} seconds ..."/>
+      <sleep seconds="${sleep.interval}"/>
+   </target>
+
+</project>
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/etc/jndi.properties
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/etc/jndi.properties	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/etc/jndi.properties	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,5 @@
+### JBossNS properties
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+#Assuming ports-01 which binds jndi on 1199
+java.naming.provider.url=jnp://localhost:1199
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/etc/log4j.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/etc/log4j.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/etc/log4j.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- $Id: log4j.xml 536 2005-12-22 00:28:39 -0600 (Thu, 22 Dec 2005) ovidiu $ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p @%t [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+   </root>
+
+</log4j:configuration>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/src/org/jboss/example/jms/failover/QueueFailoverExample.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/src/org/jboss/example/jms/failover/QueueFailoverExample.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/queue-failover/src/org/jboss/example/jms/failover/QueueFailoverExample.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,162 @@
+/*
+* 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.
+*/
+package org.jboss.example.jms.failover;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+import org.jboss.example.jms.common.ExampleSupport;
+
+/**
+ * The example creates a connection to a clustered messaging instance and sends a message to a
+ * clustered queue. The example then kills the cluster node the connection was created to and then
+ * shows how the client code can receive the message with using the *same* connection (that, in
+ * the mean time, have transparently failed over to another cluster node).
+ *
+ * Since this example is also used as a smoke test, it is essential that the VM exits with exit
+ * code 0 in case of successful execution and a non-zero value on failure.
+ *
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 1001 $</tt>
+ *
+ * $Id: TopicExample.java 1001 2006-06-24 09:05:40Z timfox $
+ */
+public class QueueFailoverExample extends ExampleSupport
+{
+   public void example() throws Exception
+   {
+      String destinationName = getDestinationJNDIName();
+
+      InitialContext ic = null;
+
+      Connection connection = null;
+
+
+      ConnectionFactory cf = null;
+      
+      try
+      {
+         // Create a connection to the clustered messaging instance
+
+         ic = new InitialContext();
+
+         cf = (ConnectionFactory)ic.lookup("/ClusteredConnectionFactory");
+
+         Queue distributedQueue = (Queue)ic.lookup(destinationName);
+         log("Distributed queue " + destinationName + " exists");
+
+         // When connecting to a messaging cluster, the ConnectionFactory has the capability of
+         // transparently creating physical connections to different cluster nodes, in a round
+         // robin fashion ...
+
+         connection = cf.createConnection();
+
+         connection.start();
+
+         // Send 2 messages to the queue
+
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         MessageProducer producer = session.createProducer(distributedQueue);
+
+         TextMessage message1 = session.createTextMessage("Hello1!");
+
+         producer.send(message1);
+
+         TextMessage message2 = session.createTextMessage("Hello2!");
+
+         producer.send(message2);
+
+         log("The messages were successfully sent to the distributed queue");
+
+         // Now receive one of the messages
+
+         MessageConsumer consumer = session.createConsumer(distributedQueue);
+
+         TextMessage rm1 = (TextMessage)consumer.receive(2000);
+
+         log("Received message: " + rm1.getText());
+
+         assertEquals("Hello1!", rm1.getText());
+
+         // Kill the active node
+         killActiveNode();
+         
+         Thread.sleep(5000);
+
+         // receive the second message on the failed over node
+
+         TextMessage rm2 = (TextMessage)consumer.receive(2000);
+         log("Received message: " + rm2.getText());
+
+
+         assertEquals("Hello2!", rm2.getText());
+
+         displayProviderInfo(connection.getMetaData());
+      }
+      finally
+      {
+         if (ic != null)
+         {
+            try
+            {
+               ic.close();
+            }
+            catch(Exception e)
+            {
+               throw e;
+            }
+         }
+
+         try
+         {
+            if (connection != null)
+            {
+               connection.close();
+            }
+         }
+         catch(JMSException e)
+         {
+            log("Could not close connection " + connection + ", exception was " + e);
+            throw e;
+         }
+
+      }
+   }
+
+   protected boolean isQueueExample()
+   {
+      return true;
+   }
+
+   public static void main(String[] args)
+   {
+      new QueueFailoverExample().run();
+   }
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/README.html
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/README.html	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/README.html	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,251 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+  <title>JBoss Messaging Example - Secure Socket example</title>
+</head>
+<body>
+<br>
+<h1>JBoss Messaging Secure Socket Connection Example</h1>
+$Revision: 2751 $
+<h2>Overview</h2>
+<br>
+This example shows how to use a secure ConnectionFactory, which creates
+a SSL socket connection between client and server. The example will use
+such a ConnectionFactory to create two JMS connections: the first one
+to send a message to the queue and the second one to read the message
+from the queue. In both cases, the message will be securely sent over
+an encrypted connection. The example is considered successful
+if the client receives without any error the message that was
+previously sent to the queue.<br>
+<br>
+This example needs to have access to a running JBoss Messaging
+instance.
+The JBoss Messaging instance must be installed and started according to
+the
+"Installation" paragraph from the release documentation. However, the
+example will automatically deploy its own queue, unless a queue with
+the same name is already deployed. <br>
+<span style="font-style: italic;"></span></div>
+<br>
+This example also needs to have access to <span
+ style="font-family: monospace;">jboss-messaging-client.jar</span>
+archive that comes with the release bundle. If you run this example
+from an unzipped installation bundle, the example run script is
+correctly configured to find the client jar. Otherwise, you must modify
+example's <span style="font-family: monospace;">build.xml</span>
+accordingly.<br>
+<br>
+<br>
+<h2>Running the example</h2>
+1. Set up the JBOSS_HOME environment variable to point to the JBoss
+instance you deployed JBoss Messaging into. For example, if you
+deployed JBoss Messaging in <span style="font-family: monospace;">C:\jboss-4.2.0.GA\server\messaging\deploy,</span>
+then your JBOSS_HOME value should be <span
+ style="font-family: monospace;">C:\jboss-4.2.0.GA</span><br>
+<br>
+2. Go to the example's home directory<br>
+<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; margin-left: 40px; background-color: rgb(255, 255, 255);"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;"><br>
+&nbsp;&nbsp; <span style="font-family: monospace;">cd
+...\examples\secure-socket</span><br>
+      <br>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<span style="font-family: monospace;"></span><br>
+3. Run the example:<br>
+<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; margin-left: 40px; background-color: rgb(255, 255, 255);"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;"><br>
+&nbsp;&nbsp; <span style="font-family: monospace;">ant</span><br>
+      <br>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<div style="margin-left: 40px;"><br>
+</div>
+<br>
+The output of a successful run should be similar to:<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; background-color: rgb(204, 204, 204); margin-left: 40px;"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;"><br>
+$ ant<br>
+Buildfile: build.xml<br>
+      <br>
+identify:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+############################################################################<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+Running the SECURE SOCKET
+example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+#<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+############################################################################<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo] The queue: testQueue<br>
+      <br>
+sanity-check:<br>
+      <br>
+init:<br>
+&nbsp;&nbsp;&nbsp; [mkdir] Created dir:
+C:\work\src\cvs\jboss-head\jms\docs\examples\secure-socket\output<br>
+&nbsp;&nbsp;&nbsp; [mkdir] Created dir:
+C:\work\src\cvs\jboss-head\jms\docs\examples\common\output<br>
+      <br>
+compile:<br>
+&nbsp;&nbsp;&nbsp; [javac] Compiling 2 source files to
+C:\work\src\cvs\jboss-head\jms\docs\examples\common\output<br>
+&nbsp;&nbsp;&nbsp; [javac] Compiling 1 source file to
+C:\work\src\cvs\jboss-head\jms\docs\examples\secure-socket\output<br>
+      <br>
+deploy:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [copy] Copying 1 file to
+C:\jboss-4.2.0.GA\server\messaging\deploy\jboss-messaging.sar<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [copy] Copying 1 file to
+C:\jboss-4.2.0.GA\server\messaging\deploy<br>
+      <br>
+sleep:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo] Sleeping for 10 seconds ...<br>
+      <br>
+run:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] Queue /queue/testQueue exists<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] The message was successfully sent to
+the testQueue queue<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] Received message: Hello!<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] The example connected to JBoss
+Messaging version 1.3.0.GA (1.0)<br>
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] #####################<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] ###&nbsp;&nbsp;&nbsp;
+SUCCESS!&nbsp;&nbsp; ###<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] #####################<br>
+      <br>
+BUILD SUCCESSFUL<br>
+Total time: 15 seconds<br>
+      <br>
+      <br>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<div style="margin-left: 40px;"><br>
+</div>
+<br>
+<h2>Configuration details</h2>
+<br>
+The example client looks up a specially-configured connection factory (<span
+ style="font-family: monospace;">"/SecureConnectionFactory"</span>)
+that is deployed by the example run script. The secure
+ConnectionFactory relies on a "secured" Remoting Connector to provide
+the SSL connection. The definition of the required services is
+specified in the <span style="font-family: monospace;">etc/messaging-secure-socket-service.xml
+</span>deployment descriptor. <br>
+
+      <br>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<div style="margin-left: 40px;"><br>
+</div>
+<br>
+The SSLSocketBuilder needs a keystore with a public/private key pair.
+The example provides one (<span style="font-family: monospace;">etc/messaging.keystore</span>)
+which is deployed with the rest of the artifacts. In case you need to
+create your own keystore, this is how you do it:<br>
+<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; margin-left: 40px; background-color: rgb(255, 255, 255);"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;"><br>
+      <pre> keytool -genkey -alias messaging.keypair -keyalg RSA -keystore messaging.keystore -validity 3650</pre>
+      <br>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<div style="margin-left: 40px;"><br>
+</div>
+<br>
+<p>By default, the client will try to contact a Certificate Authority
+to
+insure the authenticity of the public key it uses to encrypt the
+communication. However, the example's certificate is self-signed, so no
+Certificate Authority will
+recognize it. In order to get the SSL client to trust it and the
+example to complete successfully, we use a client truststore (<span
+ style="font-family: monospace;">/etc/messaging.truststore</span>). In
+case you need to create your own truststore, this is how you do it:<br>
+</p>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; margin-left: 40px; background-color: rgb(255, 255, 255);"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;"><br>
+      <pre> keytool -export -alias messaging.keypair -keystore messaging.keystore -rfc -file messaging.cer<br> keytool -import -alias messaging.keypair -file messaging.cer -keystore messaging.truststore</pre>
+      <br>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<div style="margin-left: 40px;"><br>
+</div>
+<p> </p>
+<p>In order for the truststore to be recognized, the client's
+environment must contain the <tt>javax.net.ssl.trustStore</tt> and <tt>javax.net.ssl.trustStorePassword</tt>
+properties.<br>
+</p>
+<br>
+<h2>Troubleshooting</h2>
+<h3>1. I get <span style="font-family: monospace;">"javax.jms.JMSSecurityException:
+User null is NOT authenticated" <br>
+</span></h3>
+You probably didn't install JBoss Messaging correctly. A fresh JBoss
+Messaging installation requires changes in the security configuration
+of a <span style="font-family: monospace;">default </span>JBoss
+instance, specifically a properly configured "<small><span
+ style="font-family: courier new,courier,monospace;">messaging</span></small>"
+security domain.&nbsp; Follow the instructions from the "Installation"
+paragraph of the release documentation. <br>
+<br>
+<br>
+<br>
+<br>
+<hr style="width: 100%; height: 2px;"><br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</body>
+</html>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/build.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/build.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/build.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+   To run the example, set JBOSS_HOME and run ant (with no parameters)
+
+   $Id: build.xml 3140 2007-09-26 08:44:19Z ataylor $
+
+ -->
+
+<project name="SecureSocketExample" default="run">
+
+   <property environment="ENV"/>
+
+   <!-- These properties may be overriden by calling ants when this example is used in a smoke test -->
+   <property file="../examples.properties"/>
+   <property name="remoting.path" value="../config"/>
+   <property name="messaging.client.jar.path" value="../.."/>
+   <property name="messaging.client.jar.name" value="jboss-messaging-client.jar"/>
+   <property name="jboss.home" value="${ENV.JBOSS_HOME}"/>
+   <property name="jboss.configuration" value="messaging"/>
+   <property name="example.queue.name" value="testQueue"/>
+
+   <path id="common.compilation.classpath">
+      <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </path>
+
+   <path id="example.compilation.classpath">
+      <path refid="common.compilation.classpath"/>
+      <pathelement path="../common/output/classes"/>
+   </path>
+
+   <path id="execution.classpath">
+      <pathelement path="./etc"/>
+      <pathelement path="../common/output/classes"/>
+      <pathelement path="./output/classes"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/jboss-remoting.jar"/>
+      <fileset file="${jboss.home}/client/jbossall-client.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/log4j.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/javassist.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/trove.jar"/>
+   </path>
+
+   <target name="identify">
+      <echo message="############################################################################"/>
+      <echo message="#                   Running the SECURE SOCKET example                      #"/>
+      <echo message="############################################################################"/>
+      <echo message="The queue:      ${example.queue.name}"/>
+      <echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </target>
+
+   <target name="sanity-check" depends="identify">
+      <available property="client.jar.present" file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fail message="Could not find client jar ${messaging.client.jar.path}/${messaging.client.jar.name}"
+            unless="client.jar.present"/>
+      <available property="messaging.deployment.dir.present" file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-messaging.sar"/>
+      <fail message="Could not find the Messaging deployment directory ${jboss.home}/server/${jboss.configuration}/deploy/jboss-messaging.sar"
+            unless="messaging.deployment.dir.present"/>
+   </target>
+
+   <target name="init" depends="sanity-check">
+      <mkdir dir="./output/classes"/>
+      <mkdir dir="../common/output/classes"/>
+   </target>
+
+   <target name="compile" depends="init">
+      <javac destdir="../common/output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="../common/src"/>
+         <classpath refid="common.compilation.classpath"/>
+      </javac>
+      <javac destdir="./output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="./src"/>
+         <classpath refid="example.compilation.classpath"/>
+      </javac>
+   </target>
+
+   <target name="deploy">
+      <copy file="./etc/messaging.keystore"
+            todir="${jboss.home}/server/${jboss.configuration}/deploy/jboss-messaging.sar"/>
+      <copy file="${remoting.path}/remoting-sslbisocket-service.xml"
+            todir="${jboss.home}/server/${jboss.configuration}/deploy"/>
+      <copy file="./etc/messaging-secure-socket-service.xml"
+            todir="${jboss.home}/server/${jboss.configuration}/deploy"/>
+      <antcall target="sleep"><param name="sleep.interval" value="5"/></antcall>
+   </target>
+
+   <target name="run" depends="compile, deploy">
+      <!-- QueueExample expects to find the name of the queue to connect to as value of the
+           'example.queue.name' property, which *may* be defined by calling ants when this example
+            is used in a smoke test -->
+      <java classname="org.jboss.example.jms.securesocket.SecureSocketExample"
+            classpathref="execution.classpath" fork="yes" failonerror="true">
+         <sysproperty key="javax.net.ssl.trustStorePassword" value="secureexample"/>
+         <sysproperty key="javax.net.ssl.trustStore" value="./etc/messaging.truststore"/>
+         <sysproperty key="example.queue.name" value="${example.queue.name}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=example"/>
+         -->
+      </java>
+      <antcall target="undeploy"/>
+   </target>
+
+   <target name="undeploy">
+      <delete file="${jboss.home}/server/${jboss.configuration}/deploy/remoting-sslbisocket-service.xml" quiet="true"/>
+      <delete file="${jboss.home}/server/${jboss.configuration}/deploy/messaging-secure-socket-service.xml" quiet="true"/>
+      <delete file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-messaging.sar/messaging.keystore" quiet="true"/>
+   </target>
+
+   <target name="clean" depends="undeploy">
+      <delete dir="./output" quiet="true"/>
+      <delete dir="../common/output" quiet="true"/>
+   </target>
+
+   <target name="sleep">
+      <echo message="Sleeping for ${sleep.interval} seconds ..."/>
+      <sleep seconds="${sleep.interval}"/>
+   </target>
+
+</project>
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/jndi.properties
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/jndi.properties	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/jndi.properties	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,4 @@
+### JBossNS properties
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/log4j.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/log4j.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/log4j.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- $Id: log4j.xml 948 2006-05-17 01:24:49Z ovidiu $ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p @%t [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+   </root>
+
+</log4j:configuration>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/messaging-secure-socket-service.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/messaging-secure-socket-service.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/messaging-secure-socket-service.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+     Secure Socket Transport Example: the deployment descriptor for the secure socket factory
+     service, secure connector and secure connection factory.
+
+     $Id: messaging-secure-socket-service.xml 2773 2007-06-12 13:31:30Z sergeypk $
+ -->
+
+<server>
+
+   <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
+      name="jboss.messaging.destination:service=SecureConnectionFactory"
+      xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=sslbisocket</depends>
+      <attribute name="JNDIBindings">
+         <bindings>
+            <binding>/SecureConnectionFactory</binding>
+         </bindings>
+      </attribute>
+   </mbean>
+
+</server>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/messaging.keystore
===================================================================
(Binary files differ)


Property changes on: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/messaging.keystore
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/messaging.truststore
===================================================================
(Binary files differ)


Property changes on: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/etc/messaging.truststore
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/src/org/jboss/example/jms/securesocket/SecureSocketExample.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/src/org/jboss/example/jms/securesocket/SecureSocketExample.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/secure-socket/src/org/jboss/example/jms/securesocket/SecureSocketExample.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,140 @@
+/*
+ * 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.
+ */
+package org.jboss.example.jms.securesocket;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+import org.jboss.example.jms.common.ExampleSupport;
+
+/**
+ * The example creates a connection to the default provider and uses the connection to send a
+ * message to the queue "queue/testQueue". Then, the example creates a second connection to the
+ * provider and uses it to receive the message.
+ *
+ * Since this example is also used by the smoke test, it is essential that the VM exits with exit
+ * code 0 in case of successful execution and a non-zero value on failure.
+ *
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * @version <tt>$Revision: 2977 $</tt>
+ *
+ * $Id: SecureSocketExample.java 2977 2007-08-08 15:32:14Z timfox $
+ */
+public class SecureSocketExample extends ExampleSupport
+{
+   
+   public void example() throws Exception
+   {
+      String destinationName = getDestinationJNDIName();
+      
+      InitialContext ic = null;
+      ConnectionFactory cf = null;
+      Connection connection =  null;
+      Connection connection2 =  null;
+      
+      try
+      {         
+         ic = new InitialContext();
+         
+         cf = (ConnectionFactory)ic.lookup("/SecureConnectionFactory");
+         Queue queue = (Queue)ic.lookup(destinationName);
+         log("Queue " + destinationName + " exists");
+         
+         connection = cf.createConnection();
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer sender = session.createProducer(queue);
+         
+         TextMessage message = session.createTextMessage("Hello!");
+         sender.send(message);
+         log("The message was successfully sent to the " + queue.getQueueName() + " queue");
+         
+         connection2 = cf.createConnection();
+         Session session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer consumer =  session2.createConsumer(queue);
+         
+         connection2.start();
+         
+         message = (TextMessage)consumer.receive(2000);
+         log("Received message: " + message.getText());
+         assertEquals("Hello!", message.getText());
+         
+         displayProviderInfo(connection2.getMetaData());                  
+      }
+      finally
+      {
+         if(ic != null)
+         {
+            try
+            {
+               ic.close();
+            }
+            catch(Exception e)
+            {
+               throw e;
+            }
+         }
+         
+         //ALWAYS close your connection in a finally block to avoid leaks
+         //Closing connection also takes care of closing its related objects e.g. sessions
+         closeConnection(connection);
+         
+         closeConnection(connection2);
+         
+      }
+      
+   }
+   
+   private void closeConnection(Connection con)
+   {
+      try
+      {
+         if (con != null)
+         {
+            con.close();
+         }
+      }
+      catch(JMSException jmse)
+      {
+         log("Could not close connection " + con +" exception was " +jmse);
+      }
+   }
+   
+   
+   protected boolean isQueueExample()
+   {
+      return true;
+   }
+   
+   public static void main(String[] args)
+   {
+      new SecureSocketExample().run();
+   }
+   
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/README.html
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/README.html	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/README.html	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,158 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+  <title>JBoss Messaging Example - Stateless Session Bean</title>
+</head>
+<body>
+<br>
+<h1>Sending JMS messages from a Stateless Session Bean<br>
+</h1>
+$Revision: 2751 $
+<h2>Overview</h2>
+<br>
+This example deploys a stateless session bean that then sends and
+receives messages from a queue. This is a very simple example that
+demonstrates using JBoss Messaging in a managed environment. The
+session bean sends a message to a test queue and then pulls the message
+from the queue using a different connection. The
+example is considered successful if the message is received correctly.<br>
+<br>
+This example relies on having access to a running JBoss Messaging
+instance.
+The JBoss Messaging instance must be installed and started according to
+the
+"Installation" paragraph from the release documentation.&nbsp; However,
+the example will automatically deploy its own queue, unless a queue
+with the same name is already deployed. <br>
+<br>
+This example also relies on having access to <span
+ style="font-family: monospace;">jboss-messaging-client.jar</span>
+archive that comes with the release bundle. If you run this example
+from
+an unzipped installation bundle, the example run script is correctly
+configured to find the client jar. Otherwise, you must modify example's
+<span style="font-family: monospace;">build.xml</span>
+accordingly.&nbsp;<br>
+<br>
+<h2>Running the example</h2>
+1. Set up the JBOSS_HOME environment variable to point to the JBoss
+instance you deployed JBoss Messaging into. For example, if you
+deployed JBoss Messaging in <span style="font-family: monospace;">C:\jboss-4.2.0.GA\server\default\deploy,</span>
+then your JBOSS_HOME value should be <span
+ style="font-family: monospace;">C:\</span><span
+ style="font-family: monospace;">jboss-4.2.0.GA.</span><br>
+<span style="font-family: monospace;"></span><br>
+2. Go to the example's home directory<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">cd
+...\examples\stateless</span><br>
+</div>
+<br>
+3. Run the example:<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">ant</span>
+<br>
+<br>
+<br>
+</div>
+The output of a successful run should be similar to:<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; background-color: rgb(204, 204, 204); margin-left: 40px;"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;">
+      <div style="margin-left: 40px;"><br>
+      </div>
+$ ant<br>
+Buildfile: build.xml<br>
+      <br>
+identify:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+X&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+Running the STATELESS SESSION BEAN
+example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+X<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo] The queue: testQueue<br>
+      <br>
+sanity-check:<br>
+      <br>
+init:<br>
+&nbsp;&nbsp;&nbsp; [mkdir] Created dir:
+C:\work\src\cvs\jboss-head\jms\docs\examples\stateless\output\classes\META-INF<br>
+&nbsp;&nbsp;&nbsp; [mkdir] Created dir:
+C:\work\src\cvs\jboss-head\jms\docs\examples\stateless\output\lib<br>
+      <br>
+compile:<br>
+&nbsp;&nbsp;&nbsp; [javac] Compiling 4 source files to
+C:\work\src\cvs\jboss-head\jms\docs\examples\stateless\output\classes<br>
+      <br>
+jar:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [copy] Copying 2 files to
+C:\work\src\cvs\jboss-head\jms\docs\examples\stateless\output\classes\META-INF<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [jar] Building jar:
+C:\work\src\cvs\jboss-head\jms\docs\examples\stateless\output\lib\stateless-example.jar<br>
+      <br>
+deploy:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [copy] Copying 1 file to
+C:\work\src\jboss-4.2.0.GA\build\output\jboss-4.0.3SP1\server\messaging\deploy<br>
+      <br>
+sleep:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo] Sleeping for 5 seconds ...<br>
+      <br>
+run:<br>
+      <br>
+send-and-receive:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] The Hello! message was successfully
+sent to the /queue/testQueue queue<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] Queue browse result: Hello!<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] Received Hello!<br>
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] #####################<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] ###&nbsp;&nbsp;&nbsp;
+SUCCESS!&nbsp;&nbsp; ###<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] #####################<br>
+      <br>
+undeploy:<br>
+&nbsp;&nbsp; [delete] Deleting:
+C:\work\src\jboss-4.2.0.GA\build\output\jboss-4.0.3SP1\server\messaging\deploy\stateless-example.jar<br>
+      <br>
+BUILD SUCCESSFUL<br>
+Total time: 9 seconds<br>
+      <br>
+      <br>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<br>
+<h2>Troublesooting</h2>
+<h3>1. I get <span style="font-family: monospace;">"javax.jms.JMSSecurityException:
+User null is NOT authenticated" <br>
+</span></h3>
+You probably didn't install JBoss Messaging correctly. A fresh JBoss
+Messaging installation requires changes in the security configuration
+of a <span style="font-family: monospace;">default </span>JBoss
+instance, specifically a properly configured "<small><span
+ style="font-family: courier new,courier,monospace;">messaging</span></small>"
+security domain.&nbsp; Follow the instructions from the "Installation"
+paragraph of the release documentation. <br>
+<br>
+<br>
+<hr style="width: 100%; height: 2px;"><br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</body>
+</html>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/build.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/build.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/build.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+   To run the example, set JBOSS_HOME and run ant (with no parameters)
+
+   $Id: build.xml 3140 2007-09-26 08:44:19Z ataylor $
+
+ -->
+
+<project name="StatelessExample" default="run">
+
+   <property environment="ENV"/>
+
+   <!-- These properties may be overriden by calling ants when this example is used in a smoke test -->
+   <property file="../examples.properties"/>
+   <property name="messaging.client.jar.path" value="../../"/>
+   <property name="messaging.client.jar.name" value="jboss-messaging-client.jar"/>
+   <property name="jboss.home" value="${ENV.JBOSS_HOME}"/>
+   <property name="jboss.configuration" value="messaging"/>
+   <property name="example.queue.name" value="testQueue"/>
+
+   <path id="common.compilation.classpath">
+      <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </path>
+
+   <path id="example.compilation.classpath">
+      <path refid="common.compilation.classpath"/>
+      <pathelement path="../common/output/classes"/>
+   </path>
+
+   <path id="execution.classpath">
+      <pathelement path="./etc"/>
+      <pathelement path="../common/output/classes"/>
+      <pathelement path="./output/classes"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/jboss-remoting.jar"/>
+      <fileset file="${jboss.home}/client/jbossall-client.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/log4j.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/javassist.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/trove.jar"/>
+   </path>
+
+   <target name="identify">
+      <echo message="###########################################################################"/>
+      <echo message="#              Running the STATELESS SESSION BEAN example                 #"/>
+      <echo message="###########################################################################"/>
+      <echo message="The queue:      ${example.queue.name}"/>
+      <echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </target>
+
+   <target name="sanity-check" depends="identify">
+      <available property="client.jar.present" file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fail message="Could not find client jar ${messaging.client.jar.path}/${messaging.client.jar.name}"
+            unless="client.jar.present"/>
+   </target>
+
+   <target name="init" depends="sanity-check">
+      <mkdir dir="./output/classes/META-INF"/>
+      <mkdir dir="./output/lib"/>
+      <mkdir dir="../common/output/classes"/>
+   </target>
+
+   <target name="compile" depends="init">
+      <javac destdir="../common/output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="../common/src"/>
+         <classpath refid="common.compilation.classpath"/>
+      </javac>
+      <javac destdir="./output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="./src"/>
+         <classpath refid="example.compilation.classpath"/>
+      </javac>
+   </target>
+
+   <target name="jar" depends="compile">
+      <copy todir="./output/classes/META-INF">
+         <fileset dir="./etc/META-INF" includes="*"/>
+      </copy>
+      <jar destfile="./output/lib/stateless-example.jar"
+           basedir="./output/classes"
+           includes="META-INF/**,org/jboss/example/jms/stateless/bean/*.class"/>
+   </target>
+
+   <target name="deploy" depends="jar">
+      <copy file="./output/lib/stateless-example.jar"
+            todir="${jboss.home}/server/${jboss.configuration}/deploy"/>
+      <antcall target="sleep"><param name="sleep.interval" value="5"/></antcall>
+   </target>
+
+   <target name="run" depends="deploy">
+      <antcall target="send-and-receive"/>
+      <antcall target="undeploy"/>
+   </target>
+
+   <target name="send-and-receive">
+      <!-- The client expects to find the name of the queue to connect to as value of the
+           'example.queue.name' property, which *may* be defined by calling ants when this example
+            is used in a smoke test -->
+      <java classname="org.jboss.example.jms.stateless.client.Client"
+            classpathref="execution.classpath" fork="yes" failonerror="true">
+         <sysproperty key="example.queue.name" value="${example.queue.name}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=example"/>
+          -->
+      </java>
+   </target>
+
+   <target name="undeploy">
+      <delete file="${jboss.home}/server/${jboss.configuration}/deploy/stateless-example.jar"
+              quiet="true"/>
+   </target>
+
+   <target name="clean" depends="undeploy">
+      <delete dir="./output" quiet="true"/>
+      <delete dir="../common/output" quiet="true"/>
+   </target>
+
+   <target name="sleep">
+      <echo message="Sleeping for ${sleep.interval} seconds ..."/>
+      <sleep seconds="${sleep.interval}"/>
+   </target>
+
+</project>
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/etc/META-INF/ejb-jar.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/etc/META-INF/ejb-jar.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/etc/META-INF/ejb-jar.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,16 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
+    "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
+
+<ejb-jar>
+    <enterprise-beans>
+        <session>
+            <ejb-name>StatelessSessionExample</ejb-name>
+            <home>org.jboss.example.jms.stateless.bean.StatelessSessionExampleHome</home>
+            <remote>org.jboss.example.jms.stateless.bean.StatelessSessionExample</remote>
+            <ejb-class>org.jboss.example.jms.stateless.bean.StatelessSessionExampleBean</ejb-class>
+            <session-type>Stateless</session-type>
+            <transaction-type>Container</transaction-type>
+        </session>
+    </enterprise-beans>
+</ejb-jar>
\ No newline at end of file

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/etc/META-INF/jboss.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/etc/META-INF/jboss.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/etc/META-INF/jboss.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jboss PUBLIC
+   "-//JBoss//DTD JBOSS 3.0//EN"
+   "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
+<jboss>
+   <enterprise-beans>
+      <session>
+         <ejb-name>StatelessSessionExample</ejb-name>
+         <jndi-name>ejb/StatelessSessionExample</jndi-name>
+      </session>
+   </enterprise-beans>
+</jboss>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/etc/jndi.properties
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/etc/jndi.properties	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/etc/jndi.properties	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,4 @@
+### JBossNS properties
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/etc/log4j.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/etc/log4j.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/etc/log4j.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- $Id: log4j.xml 563 2005-12-30 22:04:19Z ovidiu $ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p @%t [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+   </root>
+
+</log4j:configuration>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/bean/StatelessSessionExample.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/bean/StatelessSessionExample.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/bean/StatelessSessionExample.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,29 @@
+/**
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.example.jms.stateless.bean;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.EJBObject;
+
+/**
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2868 $</tt>
+
+ * $Id: StatelessSessionExample.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+
+public interface StatelessSessionExample extends EJBObject
+{
+   public void drain(String queueName) throws RemoteException, Exception;
+   
+   public void send(String txt, String queueName) throws RemoteException, Exception;
+   
+   public int browse(String queueName) throws RemoteException, Exception;
+   
+   public String receive(String queueName) throws RemoteException, Exception;
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/bean/StatelessSessionExampleBean.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/bean/StatelessSessionExampleBean.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/bean/StatelessSessionExampleBean.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,253 @@
+/**
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.example.jms.stateless.bean;
+
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+
+import javax.ejb.EJBException;
+import javax.ejb.SessionBean;
+import javax.ejb.SessionContext;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.QueueBrowser;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+/**
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2868 $</tt>
+ 
+ * $Id: StatelessSessionExampleBean.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+public class StatelessSessionExampleBean implements SessionBean
+{   
+
+   private ConnectionFactory cf = null;
+   
+   public void drain(String queueName) throws Exception
+   {
+      InitialContext ic = new InitialContext();
+      Queue queue = (Queue)ic.lookup(queueName);
+      ic.close();
+      
+      Session session = null;
+      Connection conn = null;
+      
+      try
+      {
+         conn = getConnection();
+         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer consumer = session.createConsumer(queue);
+         Message m = null;
+         do
+         {
+            m = consumer.receive(1L);
+         }
+         while(m != null);
+      }
+      finally
+      {
+         if (conn != null)
+         {
+            closeConnection(conn);
+         }
+      }
+   }
+   
+   public void send(String txt, String queueName) throws Exception
+   {
+      InitialContext ic = new InitialContext();
+      
+      Queue queue = (Queue)ic.lookup(queueName);
+      
+      ic.close();
+      
+      Session session = null;
+      Connection conn = null;
+      
+      try
+      {
+         conn = getConnection();
+         
+         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         
+         MessageProducer producer = session.createProducer(queue);
+         
+         TextMessage tm = session.createTextMessage(txt);
+         
+         producer.send(tm);
+         
+         System.out.println("message " + txt + " sent to " + queueName);         
+      }
+      finally
+      {
+         if (conn != null)
+         {
+            closeConnection(conn);
+         }
+      }
+   }
+   
+   public int browse(String queueName) throws Exception
+   {
+      InitialContext ic = new InitialContext();
+      Queue queue = (Queue)ic.lookup(queueName);
+      ic.close();
+      
+      Session session = null;
+      Connection conn = null;
+      
+      try
+      {
+         conn = getConnection();
+         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         QueueBrowser browser = session.createBrowser(queue);
+         
+         ArrayList list = new ArrayList();
+         for(Enumeration e = browser.getEnumeration(); e.hasMoreElements(); )
+         {
+            list.add(e.nextElement());
+         }
+         
+         return list.size();
+      }
+      finally
+      {
+         if (conn != null)
+         {
+            closeConnection(conn);
+         }
+      }
+   }
+   
+   public String receive(String queueName) throws Exception
+   {
+      InitialContext ic = new InitialContext();
+      Queue queue = (Queue)ic.lookup(queueName);
+      ic.close();
+      
+      Session session = null;
+      Connection conn = null;
+      
+      try
+      {
+         conn = getConnection();
+         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         
+         MessageConsumer consumer = session.createConsumer(queue);
+         
+         System.out.println("blocking to receive message from queue " + queueName + " ...");
+         TextMessage tm = (TextMessage)consumer.receive(5000);
+         
+         if (tm == null)
+         {
+            throw new Exception("No message!");
+         }
+         
+         System.out.println("Message " + tm.getText() + " received");
+         
+         return tm.getText();         
+      }
+      finally
+      {
+         if (conn != null)
+         {
+            closeConnection(conn);
+         }
+      }
+   }
+   
+   public Connection getConnection() throws Exception
+   {
+      
+      Connection connection = null;
+      
+      try
+      {
+         connection = cf.createConnection();
+         
+         connection.start();         
+      }
+      catch(Exception e )
+      {
+         if(connection != null)
+         {
+            closeConnection(connection);
+         }
+         System.out.println("Failed to get connection...exception is " + e);
+         throw e;
+      }
+      
+      return connection;
+   }
+   
+   public void closeConnection(Connection con) throws Exception
+   {      
+      try
+      {
+         con.close();         
+      }
+      catch(JMSException jmse)
+      {
+         System.out.println("Could not close connection " + con +" exception was " + jmse);
+         throw jmse;
+      }
+   }
+   
+   public void setSessionContext(SessionContext ctx) throws EJBException, RemoteException
+   {      
+   }
+   
+   public void ejbCreate()
+   {
+      try
+      {
+         InitialContext ic = new InitialContext();
+         
+         cf = (ConnectionFactory)ic.lookup("java:/JmsXA");
+         
+         ic.close();
+      }
+      catch(Exception e)
+      {
+         e.printStackTrace();
+         throw new EJBException("Initalization failure: " + e.getMessage());
+      }
+   }
+   
+   public void ejbRemove() throws EJBException
+   {
+      try
+      {
+         if(cf != null)
+         {
+            cf = null;
+         }
+      }
+      catch(Exception e)
+      {
+         throw new EJBException("ejbRemove ", e);
+      }
+   }
+   
+   public void ejbActivate() throws EJBException, RemoteException
+   {
+   }
+   
+   public void ejbPassivate() throws EJBException, RemoteException
+   {
+   }
+      
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/bean/StatelessSessionExampleHome.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/bean/StatelessSessionExampleHome.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/bean/StatelessSessionExampleHome.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,25 @@
+/**
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.example.jms.stateless.bean;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+/**
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2868 $</tt>
+
+ * $Id: StatelessSessionExampleHome.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+
+public interface StatelessSessionExampleHome extends EJBHome
+{
+   public StatelessSessionExample create() throws RemoteException, CreateException;
+}
+
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/client/Client.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/client/Client.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless/src/org/jboss/example/jms/stateless/client/Client.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,84 @@
+/*
+ * 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.
+ */
+package org.jboss.example.jms.stateless.client;
+
+import javax.naming.InitialContext;
+
+import org.jboss.example.jms.common.ExampleSupport;
+import org.jboss.example.jms.stateless.bean.StatelessSessionExample;
+import org.jboss.example.jms.stateless.bean.StatelessSessionExampleHome;
+
+/**
+ * This example deploys a simple Stateless Session Bean that is used as a proxy to send and receive
+ * JMS messages in a managed environment.
+ *
+ * Since this example is also used by the smoke test, it is essential that the VM exits with exit
+ * code 0 in case of successful execution and a non-zero value on failure.
+ *
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2977 $</tt>
+ *
+ * $Id: Client.java 2977 2007-08-08 15:32:14Z timfox $
+ */
+public class Client extends ExampleSupport
+{
+   public void example() throws Exception
+   {            
+      InitialContext ic = new InitialContext();
+                  
+      StatelessSessionExampleHome home =
+         (StatelessSessionExampleHome)ic.lookup("ejb/StatelessSessionExample");            
+      
+      StatelessSessionExample bean = home.create();
+                  
+      String queueName = getDestinationJNDIName();
+      String text = "Hello!";                  
+      
+      bean.drain(queueName);
+                       
+      bean.send("Hello!", queueName);
+      log("The " + text + " message was successfully sent to the " + queueName + " queue");
+          
+      int num = bean.browse(queueName);
+                  
+      assertEquals(1, num);
+          
+      log("Queue browse result: " + num);            
+      
+      String result = bean.receive(queueName);
+      log("Received " + result);            
+      
+      assertEquals("Hello!", result);            
+      
+      bean.remove();
+   }
+   
+   protected boolean isQueueExample()
+   {
+      return true;
+   }
+   
+   public static void main(String[] args)
+   {
+      new Client().run();
+   }   
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/README.html
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/README.html	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/README.html	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,122 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta content="text/html; charset=ISO-8859-1"
+    http-equiv="content-type">
+  <title>JBoss Messaging Example - Stateless Clustered Session Bean</title>
+</head>
+<body>
+
+<h1>Sending JMS messages from a Stateless Clustered Session Bean</h1>
+
+<p>$Revision: 2751 $</p>
+
+<h2>Overview</h2>
+<p>
+This example deploys in a cluster a stateless session bean that can then
+send and receive messages from a queue. This is a very simple example that
+demonstrates using JBoss Messaging in a clustered environment.
+The client uses HA-JNDI to look up the session bean. It then invokes the
+session bean to send a message to a test queue and afterwards consumes the same message.
+</p>
+<p>
+This example relies on having access to a running JBoss Messaging cluster.
+The JBoss Messaging cluster must be installed and started according to
+the "JBoss Messaging Clustered Installation" chapter from the release
+documentation.&nbsp; However, the example will automatically deploy its own
+queue, unless a queue with the same name is already deployed.
+</p>
+<p>
+This example also relies on having access to <tt>jboss-messaging-client.jar</tt>
+archive that comes with the release bundle. If you run this example
+from an unzipped installation bundle, the example run script is correctly
+configured to find the client jar. Otherwise, you must modify example's
+<tt>build.xml</tt> accordingly.
+</p>
+
+<h2>Running the example</h2>
+<p>
+1. Set up the JBOSS_HOME environment variable to point to the JBoss
+instance you deployed JBoss Messaging into. For example, if you
+deployed JBoss Messaging in <tt>C:\jboss-4.2.0.GA\server\messaging-node0\deploy</tt>,
+then your JBOSS_HOME value should be <tt>C:\jboss-4.2.0.GA</tt>.
+</p>
+<p>
+2. Go to the example's home directory
+</p>
+<blockquote>
+  <pre>cd ...\examples\stateless</pre>
+</blockquote>
+<p>
+3. Run the example:
+</p>
+<blockquote>
+  <pre>ant</pre>
+</blockquote>
+<p>
+The output of a successful run should be similar to:
+</p>
+<blockquote>
+  <pre>$ ant
+Buildfile: build.xml
+
+identify:
+     [echo] ###########################################################################
+     [echo] #         Running the STATELESS CLUSTERED SESSION BEAN example            #
+     [echo] ###########################################################################
+     [echo] The queue:      testFarmQueue
+     [echo] The client jar: ../../../output/lib/jboss-messaging-client.jar
+
+sanity-check:
+
+init:
+    [mkdir] Created dir: C:\java\messaging\docs\examples\stateless-clustered\output\classes\META-INF
+    [mkdir] Created dir: C:\java\messaging\docs\examples\stateless-clustered\output\lib
+
+compile:
+    [javac] Compiling 4 source files to C:\java\messaging\docs\examples\stateless-clustered\output\classes
+    [javac] Note: C:\java\messaging\docs\examples\stateless-clustered\src\org\jboss\example\jms\statelessclustered\bean\StatelessClusteredSessionExampleBean.java uses unchecked or unsafe operations.
+    [javac] Note: Recompile with -Xlint:unchecked for details.
+
+jar:
+     [copy] Copying 2 files to C:\java\messaging\docs\examples\stateless-clustered\output\classes\META-INF
+      [jar] Building jar: C:\java\messaging\docs\examples\stateless-clustered\output\lib\stateless-clustered-example.jar
+
+deploy:
+     [copy] Copying 1 file to C:\jboss-4.2.0.GA\server\messaging-node0\farm
+     [copy] Copying 1 file to C:\jboss-4.2.0.GA\server\messaging-node0\farm
+
+sleep:
+     [echo] Sleeping for 15 seconds ...
+
+run:
+
+send-and-receive:
+     [java] The Hello! message was successfully sent to the /queue/testFarmQueue queue
+     [java] Queue browse result: 1
+     [java] blocking to receive message from queue /queue/testFarmQueue ...
+     [java] Message Hello! received
+     [java] 
+     [java] #####################
+     [java] ###    SUCCESS!   ###
+     [java] #####################
+
+undeploy:
+   [delete] Deleting: C:\jboss-4.2.0.GA\server\messaging-node0\farm\stateless-clustered-example.jar
+   [delete] Deleting: C:\jboss-4.2.0.GA\server\messaging-node0\farm\destinations-farm-service.xml
+
+BUILD SUCCESSFUL
+Total time: 19 seconds
+</pre></blockquote>
+
+<h2>Troublesooting</h2>
+<h3>1. I get <tt>"javax.jms.JMSSecurityException: User null is NOT authenticated"</tt></h3>
+<p>
+You probably didn't install JBoss Messaging correctly. A fresh JBoss
+Messaging installation requires changes in the security configuration
+of the JBoss instance, specifically a properly configured "<tt>messaging</tt>"
+security domain. Follow the instructions from the "Installation" paragraph of
+the release documentation.
+</p>
+</body>
+</html>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/build.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/build.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/build.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+   To run the example, set JBOSS_HOME and run ant (with no parameters)
+
+   $Id: build.xml 3140 2007-09-26 08:44:19Z ataylor $
+
+ -->
+
+<project name="StatelessClusteredExample" default="run">
+
+   <property environment="ENV"/>
+
+   <!-- These properties may be overriden by calling ants when this example is used in a smoke test -->
+   <property file="../examples.properties"/>
+   <property name="messaging.client.jar.path" value="../../"/>
+   <property name="messaging.client.jar.name" value="jboss-messaging-client.jar"/>
+   <property name="jboss.home" value="${ENV.JBOSS_HOME}"/>
+   <property name="jboss.configuration" value="messaging-node0"/>
+   <property name="example.queue.name" value="testFarmQueue"/>
+
+   <path id="common.compilation.classpath">
+      <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </path>
+
+   <path id="example.compilation.classpath">
+      <path refid="common.compilation.classpath"/>
+      <pathelement path="../common/output/classes"/>
+   </path>
+
+   <path id="execution.classpath">
+      <pathelement path="./etc"/>
+      <pathelement path="../common/output/classes"/>
+      <pathelement path="./output/classes"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/jboss-remoting.jar"/>
+      <fileset file="${jboss.home}/client/jbossall-client.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/log4j.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/javassist.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/trove.jar"/>
+   </path>
+
+   <target name="identify">
+      <echo message="###########################################################################"/>
+      <echo message="#         Running the STATELESS CLUSTERED SESSION BEAN example            #"/>
+      <echo message="###########################################################################"/>
+      <echo message="The queue:      ${example.queue.name}"/>
+      <echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </target>
+
+   <target name="sanity-check" depends="identify">
+      <available property="client.jar.present" file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fail message="Could not find client jar ${messaging.client.jar.path}/${messaging.client.jar.name}"
+            unless="client.jar.present"/>
+   </target>
+
+   <target name="init" depends="sanity-check">
+      <mkdir dir="./output/classes/META-INF"/>
+      <mkdir dir="./output/lib"/>
+      <mkdir dir="../common/output/classes"/>
+   </target>
+
+   <target name="compile" depends="init">
+      <javac destdir="../common/output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="../common/src"/>
+         <classpath refid="common.compilation.classpath"/>
+      </javac>
+      <javac destdir="./output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="./src"/>
+         <classpath refid="example.compilation.classpath"/>
+      </javac>
+   </target>
+
+   <target name="jar" depends="compile">
+      <copy todir="./output/classes/META-INF">
+         <fileset dir="./etc/META-INF" includes="*"/>
+      </copy>
+      <jar destfile="./output/lib/stateless-clustered-example.jar"
+           basedir="./output/classes"
+           includes="META-INF/**,org/jboss/example/jms/statelessclustered/bean/*.class"/>
+   </target>
+
+   <target name="deploy" depends="jar">
+      <copy file="./etc/destinations-farm-service.xml"
+            todir="${jboss.home}/server/${jboss.configuration}/farm"/>
+      <copy file="./output/lib/stateless-clustered-example.jar"
+            todir="${jboss.home}/server/${jboss.configuration}/farm"/>
+      <antcall target="sleep"><param name="sleep.interval" value="15"/></antcall>
+   </target>
+
+   <target name="run" depends="deploy">
+      <antcall target="send-and-receive"/>
+      <antcall target="undeploy"/>
+   </target>
+
+   <target name="send-and-receive">
+      <!-- The client expects to find the name of the queue to connect to as value of the
+           'example.queue.name' property, which *may* be defined by calling ants when this example
+            is used in a smoke test -->
+      <java classname="org.jboss.example.jms.statelessclustered.client.Client"
+            classpathref="execution.classpath" fork="yes" failonerror="true">
+         <sysproperty key="example.queue.name" value="${example.queue.name}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=example"/>
+          -->
+      </java>
+   </target>
+
+   <target name="undeploy">
+      <delete file="${jboss.home}/server/${jboss.configuration}/farm/stateless-clustered-example.jar"
+              quiet="true"/>
+      <delete file="${jboss.home}/server/${jboss.configuration}/farm/destinations-farm-service.xml"
+              quiet="true"/>
+   </target>
+
+   <target name="clean" depends="undeploy">
+      <delete dir="./output" quiet="true"/>
+      <delete dir="../common/output" quiet="true"/>
+   </target>
+
+   <target name="sleep">
+      <echo message="Sleeping for ${sleep.interval} seconds ..."/>
+      <sleep seconds="${sleep.interval}"/>
+   </target>
+
+</project>
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/META-INF/ejb-jar.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/META-INF/ejb-jar.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/META-INF/ejb-jar.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,16 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
+    "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
+
+<ejb-jar>
+    <enterprise-beans>
+        <session>
+            <ejb-name>StatelessClusteredSessionExample</ejb-name>
+            <home>org.jboss.example.jms.statelessclustered.bean.StatelessClusteredSessionExampleHome</home>
+            <remote>org.jboss.example.jms.statelessclustered.bean.StatelessClusteredSessionExample</remote>
+            <ejb-class>org.jboss.example.jms.statelessclustered.bean.StatelessClusteredSessionExampleBean</ejb-class>
+            <session-type>Stateless</session-type>
+            <transaction-type>Container</transaction-type>
+        </session>
+    </enterprise-beans>
+</ejb-jar>
\ No newline at end of file

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/META-INF/jboss.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/META-INF/jboss.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/META-INF/jboss.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jboss PUBLIC
+   "-//JBoss//DTD JBOSS 3.0//EN"
+   "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
+<jboss>
+   <enterprise-beans>
+      <session>
+         <ejb-name>StatelessClusteredSessionExample</ejb-name>
+         <jndi-name>ejb/StatelessClusteredSessionExample</jndi-name>
+         <clustered>True</clustered>
+      </session>
+   </enterprise-beans>
+</jboss>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/destinations-farm-service.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/destinations-farm-service.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/destinations-farm-service.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+   <mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=testFarmQueue"
+      xmbean-dd="xmdesc/Queue-xmbean.xml">
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends>jboss.messaging:service=PostOffice</depends>
+      <attribute name="Clustered">true</attribute>
+   </mbean>
+</server>
\ No newline at end of file

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/jndi.properties
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/jndi.properties	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/jndi.properties	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,4 @@
+### JBossNS properties - HA-JNDI
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=localhost:1100,localhost:1200
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/log4j.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/log4j.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/etc/log4j.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- $Id: log4j.xml 2742 2007-05-30 17:07:08Z sergeypk $ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p @%t [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+   </root>
+
+</log4j:configuration>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/bean/StatelessClusteredSessionExample.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/bean/StatelessClusteredSessionExample.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/bean/StatelessClusteredSessionExample.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,29 @@
+/**
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.example.jms.statelessclustered.bean;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.EJBObject;
+
+/**
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2868 $</tt>
+
+ * $Id: StatelessClusteredSessionExample.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+
+public interface StatelessClusteredSessionExample extends EJBObject
+{
+   public void drain(String queueName) throws RemoteException, Exception;
+   
+   public void send(String txt, String queueName) throws RemoteException, Exception;
+   
+   public int browse(String queueName) throws RemoteException, Exception;
+   
+   public String receive(String queueName) throws RemoteException, Exception;
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/bean/StatelessClusteredSessionExampleBean.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/bean/StatelessClusteredSessionExampleBean.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/bean/StatelessClusteredSessionExampleBean.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,254 @@
+/**
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.example.jms.statelessclustered.bean;
+
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+
+import javax.ejb.EJBException;
+import javax.ejb.SessionBean;
+import javax.ejb.SessionContext;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.QueueBrowser;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+/**
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2868 $</tt>
+ 
+ * $Id: StatelessClusteredSessionExampleBean.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+public class StatelessClusteredSessionExampleBean implements SessionBean
+{
+   private ConnectionFactory cf = null;
+
+   public void drain(String queueName) throws Exception
+   {
+      InitialContext ic = new InitialContext();
+      Queue queue = (Queue)ic.lookup(queueName);
+      ic.close();
+      
+      Session session = null;
+      Connection conn = null;
+      
+      try
+      {
+         conn = getConnection();
+         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer consumer = session.createConsumer(queue);
+         int drainedCount = 0;
+         Message m = null;
+         do
+         {
+            m = consumer.receive(1L);
+            if (m != null) drainedCount++;
+         }
+         while(m != null);
+         System.out.println("Drained " + drainedCount + " messages from queue " + queueName);
+      }
+      finally
+      {
+         if (conn != null)
+         {
+            closeConnection(conn);
+         }
+      }
+   }
+   
+   public void send(String txt, String queueName) throws Exception
+   {
+      InitialContext ic = new InitialContext();
+      Queue queue = (Queue)ic.lookup(queueName);
+      
+      ic.close();
+      
+      Session session = null;
+      Connection conn = null;
+      
+      try
+      {
+         conn = getConnection();
+         
+         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         
+         MessageProducer producer = session.createProducer(queue);
+         
+         TextMessage tm = session.createTextMessage(txt);
+         
+         producer.send(tm);
+         
+         System.out.println("message " + txt + " sent to " + queueName);         
+      }
+      finally
+      {
+         if (conn != null)
+         {
+            closeConnection(conn);
+         }
+      }
+   }
+   
+   public int browse(String queueName) throws Exception
+   {
+      InitialContext ic = new InitialContext();
+      Queue queue = (Queue)ic.lookup(queueName);
+      ic.close();
+      
+      Session session = null;
+      Connection conn = null;
+      
+      try
+      {
+         conn = getConnection();
+         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         QueueBrowser browser = session.createBrowser(queue);
+         
+         ArrayList list = new ArrayList();
+         for(Enumeration e = browser.getEnumeration(); e.hasMoreElements(); )
+         {
+            list.add(e.nextElement());
+         }
+         
+         return list.size();
+      }
+      finally
+      {
+         if (conn != null)
+         {
+            closeConnection(conn);
+         }
+      }
+   }
+   
+   public String receive(String queueName) throws Exception
+   {
+      InitialContext ic = new InitialContext();
+      Queue queue = (Queue)ic.lookup(queueName);
+      ic.close();
+      
+      Session session = null;
+      Connection conn = null;
+      
+      try
+      {
+         conn = getConnection();
+         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         
+         MessageConsumer consumer = session.createConsumer(queue);
+         
+         System.out.println("blocking to receive message from queue " + queueName + " ...");
+         TextMessage tm = (TextMessage)consumer.receive(5000);
+         
+         if (tm == null)
+         {
+            throw new Exception("No message!");
+         }
+         
+         System.out.println("Message " + tm.getText() + " received");
+         
+         return tm.getText();         
+      }
+      finally
+      {
+         if (conn != null)
+         {
+            closeConnection(conn);
+         }
+      }
+   }
+   
+   public Connection getConnection() throws Exception
+   {
+      
+      Connection connection = null;
+      
+      try
+      {
+         connection = cf.createConnection();
+         
+         connection.start();         
+      }
+      catch(Exception e )
+      {
+         if(connection != null)
+         {
+            closeConnection(connection);
+         }
+         System.out.println("Failed to get connection...exception is " + e);
+         throw e;
+      }
+      
+      return connection;
+   }
+   
+   public void closeConnection(Connection con) throws Exception
+   {      
+      try
+      {
+         con.close();         
+      }
+      catch(JMSException jmse)
+      {
+         System.out.println("Could not close connection " + con +" exception was " + jmse);
+         throw jmse;
+      }
+   }
+   
+   public void setSessionContext(SessionContext ctx) throws EJBException, RemoteException
+   {      
+   }
+   
+   public void ejbCreate()
+   {
+      try
+      {
+         InitialContext ic = new InitialContext(); // Non-HA
+         
+         cf = (ConnectionFactory)ic.lookup("java:/JmsXA");
+         
+         ic.close();
+      }
+      catch(Exception e)
+      {
+         e.printStackTrace();
+         throw new EJBException("Initalization failure: " + e.getMessage(), e);
+      }
+   }
+   
+   public void ejbRemove() throws EJBException
+   {
+      try
+      {
+         if(cf != null)
+         {
+            cf = null;
+         }
+      }
+      catch(Exception e)
+      {
+         throw new EJBException("ejbRemove ", e);
+      }
+   }
+   
+   public void ejbActivate() throws EJBException, RemoteException
+   {
+   }
+   
+   public void ejbPassivate() throws EJBException, RemoteException
+   {
+   }
+      
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/bean/StatelessClusteredSessionExampleHome.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/bean/StatelessClusteredSessionExampleHome.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/bean/StatelessClusteredSessionExampleHome.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,25 @@
+/**
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.example.jms.statelessclustered.bean;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+/**
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2868 $</tt>
+
+ * $Id: StatelessClusteredSessionExampleHome.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+
+public interface StatelessClusteredSessionExampleHome extends EJBHome
+{
+   public StatelessClusteredSessionExample create() throws RemoteException, CreateException;
+}
+
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/client/Client.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/client/Client.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/stateless-clustered/src/org/jboss/example/jms/statelessclustered/client/Client.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,114 @@
+/*
+ * 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.
+ */
+package org.jboss.example.jms.statelessclustered.client;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.MessageConsumer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+import org.jboss.example.jms.common.ExampleSupport;
+import org.jboss.example.jms.statelessclustered.bean.StatelessClusteredSessionExample;
+import org.jboss.example.jms.statelessclustered.bean.StatelessClusteredSessionExampleHome;
+
+/**
+ * This example deploys a simple clustered Stateless Session Bean that is used as a proxy to send
+ * and receive JMS messages in a managed environment.
+ *
+ * Since this example is also used by the smoke test, it is essential that the VM exits with exit
+ * code 0 in case of successful execution and a non-zero value on failure.
+ *
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2868 $</tt>
+ *
+ * $Id: Client.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+public class Client extends ExampleSupport
+{
+   public void example() throws Exception
+   {            
+      InitialContext ic = new InitialContext();
+      
+      StatelessClusteredSessionExampleHome home =
+         (StatelessClusteredSessionExampleHome)ic.lookup("ejb/StatelessClusteredSessionExample");            
+      
+      StatelessClusteredSessionExample bean = home.create();
+
+      String queueName = getDestinationJNDIName();
+      String text = "Hello!";
+
+      bean.drain(queueName);
+
+      bean.send("Hello!", queueName);
+      log("The " + text + " message was successfully sent to the " + queueName + " queue");
+
+      int num = bean.browse(queueName);
+      bean.remove();
+
+      log("Queue browse result: " + num);
+
+      Queue queue = (Queue)ic.lookup(queueName);
+
+      // Not using ClusteredConnectionFactory since that would require message
+      // redistribution to be enabled, and we don't want to bother with the configuration
+      // at this time.
+      ConnectionFactory cf = (ConnectionFactory) ic.lookup("/ConnectionFactory");
+      Connection conn = cf.createConnection();
+
+      try
+      {
+         conn.start();
+         Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);         
+         MessageConsumer consumer = session.createConsumer(queue);
+         
+         System.out.println("blocking to receive message from queue " + queueName + " ...");
+         TextMessage tm = (TextMessage)consumer.receive(5000);
+         
+         if (tm == null)
+         {
+            throw new Exception("No message!");
+         }
+         
+         System.out.println("Message " + tm.getText() + " received");
+         
+         assertEquals("Hello!", tm.getText());
+      }
+      finally
+      {
+         conn.close();
+      }
+
+   }
+   
+   protected boolean isQueueExample()
+   {
+      return true;
+   }
+   
+   public static void main(String[] args)
+   {
+      new Client().run();
+   }   
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/README.html
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/README.html	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/README.html	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,143 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+  <title>JBoss Messaging Example - JMS Topic</title>
+</head>
+<body>
+<br>
+<h1>JBoss Messaging Topic Example</h1>
+$Revision: 2751 $
+<h2>Overview</h2>
+<br>
+This example creates a JMS Connection to a JBoss Messaging instance
+and uses it to create a session, a publisher and a subscriber. The
+publisher sends a message to the topic. The example is considered
+successful
+if the topic subscriber receives the message.<br>
+<br>
+This example relies on having access to a running JBoss Messaging
+instance.
+The JBoss Messaging instance must be installed and started according to
+the
+"Installation" paragraph from the release documentation.&nbsp; However,
+the example will automatically deploy its own topic, unless a topic
+with the same name is already deployed. <br>
+<br>
+This example also relies on having access to <span
+ style="font-family: monospace;">jboss-messaging-client.jar</span>
+archive that comes with the release bundle. If you run this example
+from
+an unzipped installation bundle, the example run script is correctly
+configured to find the client jar. Otherwise, you must modify example's
+<span style="font-family: monospace;">build.xml</span> accordingly.<br>
+<span style="font-style: italic;"></span><br>
+<h2>Running the example</h2>
+1. Set up the JBOSS_HOME environment variable to point to the JBoss
+instance you deployed JBoss Messaging into. For example, if you
+deployed JBoss Messaging in <span style="font-family: monospace;">C:\jboss-4.2.0.GA\server\default\deploy,</span>
+then your JBOSS_HOME value should be <span
+ style="font-family: monospace;">C:\</span><span
+ style="font-family: monospace;">jboss-4.2.0.GA.</span><br>
+<span style="font-family: monospace;"></span><br>
+2. Go to the example's home directory<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">cd
+...\examples\topic</span><br>
+</div>
+<br>
+3. Run the example:<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">ant</span>
+<br>
+<br>
+<br>
+</div>
+The output of a successful run should be similar to:<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; background-color: rgb(204, 204, 204); margin-left: 40px;"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;">
+      <div style="margin-left: 40px;"><br>
+      </div>
+$ ant<br>
+Buildfile: build.xml<br>
+      <br>
+identify:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+X&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+Running the TOPIC
+example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+X<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo] The topic: testTopic<br>
+      <br>
+sanity-check:<br>
+      <br>
+init:<br>
+&nbsp;&nbsp;&nbsp; [mkdir] Created dir:
+C:\work\src\cvs\jboss-head\jms\docs\examples\topic\output<br>
+&nbsp;&nbsp;&nbsp; [mkdir] Created dir:
+C:\work\src\cvs\jboss-head\jms\docs\examples\common\output<br>
+      <br>
+compile:<br>
+&nbsp;&nbsp;&nbsp; [javac] Compiling 2 source files to
+C:\work\src\cvs\jboss-head\jms\docs\examples\common\output<br>
+&nbsp;&nbsp;&nbsp; [javac] Compiling 2 source files to
+C:\work\src\cvs\jboss-head\jms\docs\examples\topic\output<br>
+      <br>
+run:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] Topic /topic/testTopic exists<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] The message was successfully published
+on the topic<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] Received message: Hello!<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] The example connected to JBoss
+Messaging version 1.2.0.GA (1.2)<br>
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] #####################<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] ###&nbsp;&nbsp;&nbsp;
+SUCCESS!&nbsp;&nbsp; ###<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] #####################<br>
+      <br>
+BUILD SUCCESSFUL<br>
+Total time: 4 seconds<br>
+      <br>
+      <br>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<div style="margin-left: 40px;"><br>
+</div>
+<br>
+<br>
+<h2>Troublesooting</h2>
+<h3>1. I get <span style="font-family: monospace;">"javax.jms.JMSSecurityException:
+User null is NOT authenticated" <br>
+</span></h3>
+You probably didn't install JBoss Messaging correctly. A fresh JBoss
+Messaging installation requires changes in the security configuration
+of a <span style="font-family: monospace;">default </span>JBoss
+instance, specifically a properly configured "<small><span
+ style="font-family: courier new,courier,monospace;">messaging</span></small>"
+security domain.&nbsp; Follow the instructions from the "Installation"
+paragraph of the release documentation. <br>
+<br>
+<br>
+<hr style="width: 100%; height: 2px;"><br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</body>
+</html>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/build.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/build.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/build.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+   To run the example, set JBOSS_HOME and run ant (with no parameters)
+
+   $Id: build.xml 3140 2007-09-26 08:44:19Z ataylor $
+
+ -->
+
+<project name="TopicExample" default="run" >
+
+   <property environment="ENV"/>
+
+   <!-- These properties may be overriden by calling ants when this example is used in a smoke test -->
+   <property file="../examples.properties"/>
+   <property name="messaging.client.jar.path" value="../../"/>
+   <property name="messaging.client.jar.name" value="jboss-messaging-client.jar"/>
+   <property name="jboss.home" value="${ENV.JBOSS_HOME}"/>
+   <property name="jboss.configuration" value="messaging"/>
+   <property name="example.topic.name" value="testTopic"/>
+
+   <path id="common.compilation.classpath">
+      <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </path>
+
+   <path id="example.compilation.classpath">
+      <path refid="common.compilation.classpath"/>
+      <pathelement path="../common/output"/>
+   </path>
+
+   <path id="execution.classpath">
+      <pathelement path="./etc"/>
+      <pathelement path="../common/output"/>
+      <pathelement path="./output"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/jboss-remoting.jar"/>
+      <fileset file="${jboss.home}/client/jbossall-client.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/log4j.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/javassist.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/trove.jar"/>
+   </path>
+
+   <target name="identify">
+      <echo message="###########################################################################"/>
+      <echo message="#                       Running the TOPIC example                         #"/>
+      <echo message="###########################################################################"/>
+      <echo message="The topic:      ${example.topic.name}"/>
+      <echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </target>
+
+   <target name="sanity-check" depends="identify">
+      <available property="client.jar.present" file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fail message="Could not find client jar ${messaging.client.jar.path}/${messaging.client.jar.name}"
+            unless="client.jar.present"/>
+   </target>
+
+   <target name="init" depends="sanity-check">
+      <mkdir dir="./output"/>
+      <mkdir dir="../common/output"/>
+   </target>
+
+   <target name="compile" depends="init">
+      <javac destdir="../common/output" debug="on" debuglevel="lines,vars,source">
+         <src path="../common/src"/>
+         <classpath refid="common.compilation.classpath"/>
+      </javac>
+      <javac destdir="./output" debug="on" debuglevel="lines,vars,source">
+         <src path="./src"/>
+         <classpath refid="example.compilation.classpath"/>
+      </javac>
+   </target>
+
+   <target name="run" depends="compile">
+      <!-- TopicExample expects to find the name of the topic to connect to as value of the
+           'example.topic.name' property, which *may* be defined by calling ants when this example
+            is used in a smoke test -->
+      <java classname="org.jboss.example.jms.topic.TopicExample"
+         classpathref="execution.classpath" fork="yes" failonerror="true">
+         <sysproperty key="example.topic.name" value="${example.topic.name}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=example"/>
+          -->
+      </java>
+   </target>
+
+   <target name="clean">
+      <delete dir="./output" quiet="true"/>
+      <delete dir="../common/output" quiet="true"/>
+   </target>
+
+</project>
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/etc/jndi.properties
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/etc/jndi.properties	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/etc/jndi.properties	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,4 @@
+### JBossNS properties
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/etc/log4j.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/etc/log4j.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/etc/log4j.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- $Id: log4j.xml 536 2005-12-22 06:28:39Z ovidiu $ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p @%t [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+   </root>
+
+</log4j:configuration>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/src/org/jboss/example/jms/topic/ExampleListener.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/src/org/jboss/example/jms/topic/ExampleListener.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/src/org/jboss/example/jms/topic/ExampleListener.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,49 @@
+/**
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.example.jms.topic;
+
+import javax.jms.Message;
+import javax.jms.MessageListener;
+
+/**
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2868 $</tt>
+ 
+ * $Id: ExampleListener.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+public class ExampleListener implements MessageListener
+{   
+   private Message message;
+      
+   public synchronized void onMessage(Message message)
+   {
+      this.message = message;
+      notifyAll();
+   }
+   
+   public synchronized Message getMessage()
+   {
+      return message;
+   }
+      
+   protected synchronized void waitForMessage()
+   {
+      if (message != null)
+      {
+         return;
+      }
+      
+      try
+      {
+         wait(5000);
+      }
+      catch(InterruptedException e)
+      {
+         // OK
+      }
+   }
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/src/org/jboss/example/jms/topic/TopicExample.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/src/org/jboss/example/jms/topic/TopicExample.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/topic/src/org/jboss/example/jms/topic/TopicExample.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,135 @@
+/*
+ * 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.
+ */
+package org.jboss.example.jms.topic;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.naming.InitialContext;
+
+import org.jboss.example.jms.common.ExampleSupport;
+
+/**
+ * The example creates a connection to the default provider and uses the connection to send a
+ * message to the topic "queue/testTopic". The message must be received by a topic subscriber.
+ *
+ * Since this example is also used by the smoke test, it is essential that the VM exits with exit
+ * code 0 in case of successful execution and a non-zero value on failure.
+ *
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:luc.texier at jboss.org">Luc Texier</a>
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * @version <tt>$Revision: 2868 $</tt>
+ *
+ * $Id: TopicExample.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+public class TopicExample extends ExampleSupport
+{
+   public void example() throws Exception
+   {
+      String destinationName = getDestinationJNDIName();
+      
+      InitialContext ic = null;
+      Connection connection = null;
+      
+      try
+      {         
+         ic = new InitialContext();
+         
+         ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
+         Topic topic = (Topic)ic.lookup(destinationName);
+         log("Topic " + destinationName + " exists");
+         
+         connection = cf.createConnection();
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer publisher = session.createProducer(topic);
+         MessageConsumer subscriber = session.createConsumer(topic);
+         
+         ExampleListener messageListener = new ExampleListener();
+         subscriber.setMessageListener(messageListener);
+         connection.start();
+         
+         TextMessage message = session.createTextMessage("Hello!");
+         publisher.send(message);
+         log("The message was successfully published on the topic");
+         
+         messageListener.waitForMessage();
+         
+         message = (TextMessage)messageListener.getMessage();
+         log("Received message: " + message.getText());
+         assertEquals("Hello!", message.getText());
+         
+         displayProviderInfo(connection.getMetaData());
+         
+      }
+      finally
+      {
+         if (ic != null)
+         {
+            try
+            {
+               ic.close();
+            }
+            catch(Exception e)
+            {
+               throw e;
+            }
+         }
+         
+         // ALWAYS close your connection in a finally block to avoid leaks.
+         // Closing connection also takes care of closing its related objects e.g. sessions.
+         closeConnection(connection);
+      }
+   }
+   
+   private void closeConnection(Connection con) throws JMSException
+   {
+      
+      try
+      {
+         if (con != null)
+         {
+            con.close();
+         }
+      }
+      catch(JMSException jmse)
+      {
+         log("Could not close connection " + con +" exception was " + jmse);
+      }
+   }
+   
+   protected boolean isQueueExample()
+   {
+      return false;
+   }
+   
+   public static void main(String[] args)
+   {
+      new TopicExample().run();
+   }
+   
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/README.html
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/README.html	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/README.html	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,181 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+  <title>JBoss Messaging Example - WebService Environment</title>
+</head>
+<body>
+<br>
+<h1>Sending JMS messages from a WebService<br>
+</h1>
+<h2>Overview</h2>
+<br>
+This example deploys a WebServices that sends messages to a queue.
+The same client will then read the message from the queue, validating
+if the WebService could complete the message send.
+<br>
+This example relies on having access to a running JBoss Messaging
+instance.
+The JBoss Messaging instance must be installed and started according to
+the
+"Installation" paragraph from the release documentation.&nbsp; However,
+the example will automatically deploy its own queue, unless a queue
+with the same name is already deployed. <br>
+<br>
+This example also relies on having access to <span
+ style="font-family: monospace;">jboss-messaging-client.jar</span>
+archive that comes with the release bundle. If you run this example
+from
+an unzipped installation bundle, the example run script is correctly
+configured to find the client jar. Otherwise, you must modify example's
+<span style="font-family: monospace;">build.xml</span>
+accordingly. <br>
+<br>
+This example will also generate client classes using wsdltools from
+JBoss Web Services.<br>
+<br>
+<h2>Running the example</h2>
+1. Set up the JBOSS_HOME environment variable to point to the JBoss
+instance you deployed JBoss Messaging into. For example, if you
+deployed JBoss Messaging in <span style="font-family: monospace;">C:\jboss-4.2.0.GA\server\messaging\deploy,</span>
+then your JBOSS_HOME value should be <span
+ style="font-family: monospace;">C:\</span><span
+ style="font-family: monospace;">jboss-4.2.0.GA</span><br>
+<span style="font-family: monospace;"></span><br>
+2. Go to the example's home directory<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">cd
+...\examples\web-services</span><br>
+</div>
+<br>
+3. Run the example:<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">ant</span>
+<br>
+<br>
+<br>
+</div>
+The output of a successful run should be similar to:<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; background-color: rgb(204, 204, 204); margin-left: 40px;"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;">
+      <div style="margin-left: 40px;"><br>
+      </div>
+example at example:/workspace/jboss-messaging-1.3.0.GA/examples/web-services$
+ant<br>
+Buildfile: build.xml<br>
+      <br>
+identify:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+###########################################################################<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+Running the WebServices
+example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+#<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+###########################################################################<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo] The
+queue:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; testQueue<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo] The client jar:
+../..//jboss-messaging-client.jar<br>
+      <br>
+sanity-check:<br>
+      <br>
+init:<br>
+      <br>
+compile:<br>
+      <br>
+war:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [jar] Building jar:
+/workspace/jboss-messaging-1.3.0.GA/examples/web-services/output/lib/jms-web-service.war<br>
+      <br>
+deploy:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [copy] Copying 1 file to
+/jboss-4.2.0.GA/server/messaging/deploy<br>
+      <br>
+sleep:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo] Sleeping for 5 seconds ...<br>
+      <br>
+run-wsdl-client:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [get] Getting:
+http://127.0.0.1:8080/jms-web-service/JMSWebServiceExample?wsdl<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [get] To:
+/workspace/jboss-messaging-1.3.0.GA/examples/web-services/output/service.wsdl<br>
+&nbsp; [wstools] log4j:WARN No appenders could be found for logger
+(org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory).<br>
+&nbsp; [wstools] log4j:WARN Please initialize the log4j system properly.<br>
+      <br>
+compile-client:<br>
+&nbsp;&nbsp;&nbsp; [mkdir] Created dir:
+/workspace/jboss-messaging-1.2.0.SP2/examples/web-services/output/client-classes<br>
+&nbsp;&nbsp;&nbsp; [javac] Compiling 5 source files to
+/workspace/jboss-messaging-1.2.0.SP2/examples/web-services/output/client-classes<br>
+      <br>
+run:<br>
+      <br>
+send-and-receive:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] log4j:WARN No appenders could be found
+for logger
+(org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder).<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] log4j:WARN Please initialize the log4j
+system properly.<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] Message was received ok!<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java]<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] #####################<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] ###&nbsp;&nbsp;&nbsp;
+SUCCESS!&nbsp;&nbsp; ###<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] #####################<br>
+      <br>
+undeploy:<br>
+&nbsp;&nbsp; [delete] Deleting:
+/jboss-4.2.0.GA/server/messaging/deploy/jms-web-service.war<br>
+      <br>
+BUILD SUCCESSFUL<br>
+Total time: 12 seconds<br>
+      <br>
+      <br>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<br>
+<h2>Troublesooting</h2>
+<h3>1. I get <span style="font-family: monospace;">"javax.jms.JMSSecurityException:
+User null is NOT authenticated" <br>
+</span></h3>
+You probably didn't install JBoss Messaging correctly. A fresh JBoss
+Messaging installation requires changes in the security configuration
+of a <span style="font-family: monospace;">default </span>JBoss
+instance, specifically a properly configured "<small><span
+ style="font-family: courier new,courier,monospace;">messaging</span></small>"
+security domain.&nbsp; Follow the instructions from the "Installation"
+paragraph of the release documentation. <br>
+<h3>2. <span style="font-family: monospace;">wstools doesn't work</span></h3>
+You could aways using "ant -debug" to verify what Exceptions wstools is
+generating. A common error is a NullPointerException due to a xerces
+update required by JBoss Web Services. You could have more information
+at this <a
+ href="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBWSFAQXercesNPE">page</a>:<br>
+<br>
+<a href="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBWSFAQXercesNPE">http://wiki.jboss.org/wiki/Wiki.jsp?page=JBWSFAQXercesNPE</a><br>
+<br>
+<br>
+<br>
+<br>
+<hr style="width: 100%; height: 2px;"><br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</span>
+</body>
+</html>

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/build.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/build.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/build.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+   To run the example, set JBOSS_HOME and run ant (with no parameters)
+
+   $Id: build.xml 3140 2007-09-26 08:44:19Z ataylor $
+
+ -->
+
+<project name="WebServicesExample" default="run">
+
+   <property environment="ENV"/>
+
+   <!-- These properties may be overriden by calling ants when this example is used in a smoke test -->
+   <property file="../examples.properties"/>
+   <property name="messaging.client.jar.path" value="../../"/>
+   <property name="messaging.client.jar.name" value="jboss-messaging-client.jar"/>
+   <property name="jboss.home" value="${ENV.JBOSS_HOME}"/>
+   <property name="jboss.configuration" value="messaging"/>
+   <property name="example.queue.name" value="testQueue"/>
+
+   <path id="common.compilation.classpath">
+      <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </path>
+
+   <property name="jboss.client" value="${jboss.home}/client"/>
+
+   <path id="runtime.classpath">
+      <path refid="common.compilation.classpath"/>
+      <pathelement path="./etc"/>
+      <pathelement path="../common/output/classes"/>
+      <pathelement path="./output/classes"/>
+      <pathelement location="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+
+      <!-- all this stuff for WebServices -->
+      <pathelement location="${jboss.home}/lib/endorsed/xercesImpl.jar"/>
+      <pathelement location="${jboss.client}/activation.jar"/>
+      <pathelement location="${jboss.client}/commons-logging.jar"/>
+      <pathelement location="${jboss.client}/javassist.jar"/>
+      <pathelement location="${jboss.client}/jbossall-client.jar"/>
+      <pathelement location="${jboss.client}/jbossws-client.jar"/>
+      <pathelement location="${jboss.client}/log4j.jar"/>
+      <pathelement location="${jboss.client}/mail.jar"/>
+      <pathelement location="${jboss.client}/jboss-xml-binding.jar"/>
+      <pathelement location="${jboss.client}/jboss-jaxws.jar"/>
+      <pathelement location="${jboss.client}/jboss-jaxrpc.jar"/>
+      <pathelement location="${jboss.client}/jboss-saaj.jar"/>
+      <pathelement location="${jboss.client}/wsdl4j.jar"/>
+      <pathelement location="${jboss.client}/jaxb-api.jar"/>
+   </path>
+
+   <path id="client.classpath">
+      <path refid="common.compilation.classpath"/>
+      <pathelement path="./etc"/>
+      <pathelement path="../common/output/classes"/>
+      <pathelement path="./output/client-classes"/>
+
+      <!-- all this stuff for WebServices -->
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/jboss-remoting.jar"/>
+      <pathelement location="${jboss.client}/activation.jar"/>
+      <pathelement location="${jboss.client}/commons-logging.jar"/>
+      <pathelement location="${jboss.client}/javassist.jar"/>
+      <pathelement location="${jboss.client}/jbossall-client.jar"/>
+      <pathelement location="${jboss.client}/jbossws-client.jar"/>
+      <pathelement location="${jboss.client}/log4j.jar"/>
+      <pathelement location="${jboss.client}/mail.jar"/>
+      <pathelement location="${jboss.client}/jboss-xml-binding.jar"/>
+      <pathelement location="${jboss.client}/jboss-jaxws.jar"/>
+      <pathelement location="${jboss.client}/jboss-jaxrpc.jar"/>
+      <pathelement location="${jboss.client}/jboss-saaj.jar"/>
+      <pathelement location="${jboss.client}/wsdl4j.jar"/>
+      <pathelement location="${jboss.client}/jaxb-api.jar"/>
+      <pathelement location="${jboss.home}/lib/endorsed/xercesImpl.jar"/>
+
+
+      <pathelement location="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <pathelement location="${jboss.home}/client/jbossall-client.jar"/>
+      <pathelement location="${jboss.home}/server/${jboss.configuration}/lib/log4j.jar"/>
+      <pathelement location="${jboss.home}/server/${jboss.configuration}/lib/javassist.jar"/>
+      <pathelement location="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+      <pathelement location="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/trove.jar"/>
+
+
+   </path>
+
+   <target name="identify">
+      <echo message="###########################################################################"/>
+      <echo message="#              Running the WebServices example                            #"/>
+      <echo message="###########################################################################"/>
+      <echo message="The queue:      ${example.queue.name}"/>
+      <echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </target>
+
+   <target name="sanity-check" depends="identify">
+      <available property="client.jar.present" file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fail message="Could not find client jar ${messaging.client.jar.path}/${messaging.client.jar.name}"
+            unless="client.jar.present"/>
+   </target>
+
+   <target name="init" depends="sanity-check">
+      <mkdir dir="./output/classes/META-INF"/>
+      <mkdir dir="./output/lib"/>
+      <mkdir dir="../common/output/classes"/>
+   </target>
+
+   <target name="compile" depends="init">
+      <javac destdir="../common/output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="../common/src"/>
+         <classpath refid="common.compilation.classpath"/>
+      </javac>
+      <javac destdir="./output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="./src"/>
+         <classpath refid="runtime.classpath"/>
+      </javac>
+   </target>
+
+   <target name="run-wsdl-client" depends="compile">
+      <taskdef name="wstools" classname="org.jboss.ws.tools.ant.wstools">
+        <classpath refid="runtime.classpath"/>
+      </taskdef>
+
+      <mkdir dir="./output/client"/>
+
+      <get src="http://127.0.0.1:8080/jms-web-service/JMSWebServiceExample?wsdl" dest="./output/service.wsdl" />
+
+      <wstools config="./etc/client-config/client-config.xml"
+               dest="./output/client"/>
+   </target>
+
+
+   <target name="war" depends="compile">
+      <jar destfile="./output/lib/jms-web-service.war">
+         <zipfileset dir="./output/classes" prefix="WEB-INF/classes"/>
+         <zipfileset dir="./etc/WEB-INF" prefix="WEB-INF"/>
+      </jar>
+   </target>
+
+   <target name="deploy" depends="war">
+      <copy file="./output/lib/jms-web-service.war"
+            todir="${jboss.home}/server/${jboss.configuration}/deploy"/>
+      <antcall target="sleep"><param name="sleep.interval" value="10"/></antcall>
+   </target>
+
+   <target name="compile-client">
+      <mkdir dir="./output/client-classes"/>
+      <javac destdir="./output/client-classes" debug="on" debuglevel="lines,vars,source">
+         <src path="./output/client"/>
+         <src path="./src-client"/>
+         <classpath refid="runtime.classpath"/>
+      </javac>
+   </target>
+
+
+   <target name="run" depends="deploy, run-wsdl-client, compile-client">
+      <antcall target="send-and-receive"/>
+      <antcall target="undeploy"/>
+   </target>
+
+   <target name="send-and-receive">
+      <!-- The client expects to find the name of the queue to connect to as value of the
+           'example.queue.name' property, which *may* be defined by calling ants when this example
+            is used in a smoke test -->
+      <java classname="org.jboss.example.jms.webservices.client.Client"
+            classpathref="client.classpath" fork="yes" failonerror="true">
+         <sysproperty key="example.queue.name" value="${example.queue.name}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=example"/>
+          -->
+      </java>
+   </target>
+
+   <target name="undeploy">
+      <delete file="${jboss.home}/server/${jboss.configuration}/deploy/jms-web-service.war"
+              quiet="true"/>
+   </target>
+
+   <target name="clean" depends="undeploy">
+      <delete dir="./output" quiet="true"/>
+      <delete dir="../common/output" quiet="true"/>
+   </target>
+
+   <target name="sleep">
+      <echo message="Sleeping for ${sleep.interval} seconds ..."/>
+      <sleep seconds="${sleep.interval}"/>
+   </target>
+
+</project>
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/etc/WEB-INF/web.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/etc/WEB-INF/web.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/etc/WEB-INF/web.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
+   <servlet>
+      <servlet-name>JMSWebServiceExample</servlet-name> 
+      <servlet-class>org.jboss.example.jms.webservices.endpoint.WebServiceExampleImpl</servlet-class>
+   </servlet>
+   <servlet-mapping>
+      <servlet-name>JMSWebServiceExample</servlet-name>
+      <url-pattern>/JMSWebServiceExample</url-pattern>
+   </servlet-mapping>
+</web-app>
\ No newline at end of file

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/etc/client-config/client-config.xml
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/etc/client-config/client-config.xml	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/etc/client-config/client-config.xml	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,8 @@
+<!-- This is a WebServices config file used by wsstools as showed on JBoss WebServices documentation -->
+
+<configuration>
+      <wsdl-java location="./output/service.wsdl">
+        <mapping location="jaxrpc-mapping.xml" />
+      </wsdl-java>
+</configuration>
+

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/etc/jndi.properties
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/etc/jndi.properties	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/etc/jndi.properties	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,4 @@
+### JBossNS properties
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src/org/jboss/example/jms/webservices/endpoint/WebServiceExample.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src/org/jboss/example/jms/webservices/endpoint/WebServiceExample.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src/org/jboss/example/jms/webservices/endpoint/WebServiceExample.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,56 @@
+/*
+   * 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.
+   */
+
+package org.jboss.example.jms.webservices.endpoint;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ * @version <tt>$Revision: 2699 $</tt>
+ *          $Id: WebServiceExample.java 2699 2007-05-17 05:59:03Z clebert.suconic at jboss.com $
+ */
+public interface WebServiceExample extends Remote
+{
+
+   // Constants ------------------------------------------------------------------------------------
+
+   // Attributes -----------------------------------------------------------------------------------
+
+   // Static ---------------------------------------------------------------------------------------
+
+   // Constructors ---------------------------------------------------------------------------------
+
+   // Public ---------------------------------------------------------------------------------------
+
+   public String sendMessage(String queueName, String message) throws RemoteException;
+
+   // Package protected ----------------------------------------------------------------------------
+
+   // Protected ------------------------------------------------------------------------------------
+
+   // Private --------------------------------------------------------------------------------------
+
+   // Inner classes --------------------------------------------------------------------------------
+
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src/org/jboss/example/jms/webservices/endpoint/WebServiceExampleImpl.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src/org/jboss/example/jms/webservices/endpoint/WebServiceExampleImpl.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src/org/jboss/example/jms/webservices/endpoint/WebServiceExampleImpl.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,106 @@
+/*
+   * 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.
+   */
+
+package org.jboss.example.jms.webservices.endpoint;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.naming.InitialContext;
+import javax.jms.Destination;
+import javax.jms.ConnectionFactory;
+import javax.jms.Connection;
+import javax.jms.Session;
+import javax.jms.MessageProducer;
+import java.rmi.RemoteException;
+
+
+/**
+ * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ * @version <tt>$Revision: 3972 $</tt>
+ *          $Id: WebServiceExampleImpl.java 3972 2008-03-28 10:43:24Z jmesnil $
+ */
+ at WebService(serviceName="JMSSampleService", name="JMSSample")
+public class WebServiceExampleImpl implements WebServiceExample
+{
+
+   // Constants ------------------------------------------------------------------------------------
+
+   // Attributes -----------------------------------------------------------------------------------
+
+   // Static ---------------------------------------------------------------------------------------
+
+   // Constructors ---------------------------------------------------------------------------------
+
+   // Public ---------------------------------------------------------------------------------------
+
+   @WebMethod(operationName = "sendMessage")
+   public String sendMessage(String queueName, String message) throws RemoteException
+   {
+
+      Connection conn = null;
+      try
+      {
+         System.out.println("sending queue = " + queueName + " message = " + message);
+
+         InitialContext ctx = new InitialContext();
+         Destination dest = (Destination)ctx.lookup(queueName);
+
+         ConnectionFactory factory = (ConnectionFactory)ctx.lookup("/ConnectionFactory");
+         conn = factory.createConnection();
+
+         Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         MessageProducer producer = sess.createProducer(dest);
+         producer.send(sess.createTextMessage(message));
+
+
+         return "ok!";
+      }
+      catch (Exception e)
+      {
+         throw new RemoteException(e.getMessage());
+      }
+      finally
+      {
+         try
+         {
+            if (conn != null)
+            {
+               conn.close();
+            }
+         }
+         catch (Exception ignored)
+         {
+            ignored.printStackTrace();
+         }
+      }
+   }
+
+   // Package protected ----------------------------------------------------------------------------
+
+   // Protected ------------------------------------------------------------------------------------
+
+   // Private --------------------------------------------------------------------------------------
+
+   // Inner classes --------------------------------------------------------------------------------
+
+}

Added: projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src-client/org/jboss/example/jms/webservices/client/Client.java
===================================================================
--- projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src-client/org/jboss/example/jms/webservices/client/Client.java	                        (rev 0)
+++ projects/docs/enterprise/4.3.2/examples/jboss-messaging-examples/examples/web-service/src-client/org/jboss/example/jms/webservices/client/Client.java	2008-07-08 22:35:09 UTC (rev 75511)
@@ -0,0 +1,119 @@
+/*
+   * 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.
+   */
+
+package org.jboss.example.jms.webservices.client;
+
+import org.jboss.example.jms.common.ExampleSupport;
+import org.jboss.example.jms.webservices.endpoint.JMSSample;
+import org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.client.ServiceImpl;
+import javax.xml.rpc.ServiceFactory;
+import javax.xml.rpc.ServiceException;
+import javax.xml.namespace.QName;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.jms.Destination;
+import javax.jms.ConnectionFactory;
+import javax.jms.Session;
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.io.File;
+import java.rmi.RemoteException;
+
+import javax.jms.*;
+import javax.jms.IllegalStateException;
+
+/**
+ * This Client will use auto generated classes from WebServices. You need to compile this class using ant.
+ * 
+ * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ * @version <tt>$Revision: 3972 $</tt>
+ *          $Id: Client.java 3972 2008-03-28 10:43:24Z jmesnil $
+ */
+public class Client extends ExampleSupport
+{
+   private static final String MESSAGE_TEXT = "Hello from a WebService!";
+
+   public void example() throws Exception
+   {
+      sendMessage();
+
+      receiveMessage();
+
+      System.out.println("Message was received ok!");
+   }
+
+   private void sendMessage()
+      throws ServiceException, MalformedURLException, RemoteException
+   {
+      ServiceFactoryImpl factory = (ServiceFactoryImpl) ServiceFactory.newInstance();
+
+      URL wsdlLocation = new URL("http://127.0.0.1:8080/jms-web-service/JMSWebServiceExample?wsdl");
+      QName serviceName = new QName("http://endpoint.webservices.jms.example.jboss.org/", "JMSSampleService");
+
+      File fileMapping = new File("./output/client/jaxrpc-mapping.xml");
+
+      ServiceImpl service = (ServiceImpl)factory.createService(wsdlLocation, serviceName, fileMapping.toURL());
+
+      JMSSample proxy = (JMSSample)service.getPort(JMSSample.class);
+
+      proxy.sendMessage(getDestinationJNDIName(), MESSAGE_TEXT);
+   }
+
+   private void receiveMessage()
+      throws NamingException, JMSException
+   {
+      InitialContext ctx = new InitialContext();
+      Destination dest = (Destination)ctx.lookup(getDestinationJNDIName());
+
+      ConnectionFactory cf = (ConnectionFactory)ctx.lookup("/ConnectionFactory");
+      Connection conn = cf.createConnection();
+      conn.start();
+
+      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+      MessageConsumer consumer = sess.createConsumer(dest);
+      TextMessage msg = (TextMessage)consumer.receive(10000);
+
+      conn.close();
+
+      if (msg == null)
+      {
+         throw new IllegalStateException("Couldn't receive message");
+      }
+
+      if (!msg.getText().equals(MESSAGE_TEXT))
+      {
+         throw new IllegalStateException("Couldn't receive message");
+      }
+   }
+
+   protected boolean isQueueExample()
+   {
+      return true;
+   }
+
+   public static void main(String[] args) throws Exception
+   {
+      new Client().run();
+   }
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list