[Jboss-cvs] JBoss Messaging SVN: r1245 - in trunk: . docs lib src src/etc/xmdesc src/main/org/jboss/jms/client src/main/org/jboss/jms/client/container src/main/org/jboss/jms/client/delegate src/main/org/jboss/jms/client/remoting src/main/org/jboss/jms/server src/main/org/jboss/jms/server/connectionmanager src/main/org/jboss/jms/server/endpoint src/main/org/jboss/jms/server/remoting src/main/org/jboss/jms/tx src/main/org/jboss/messaging/core/plugin tests/src/org/jboss/test/messaging/jms tests/src/org/jboss/test/messaging/jms/server tests/src/org/jboss/test/messaging/jms/server/destination tests/src/org/jboss/test/messaging/tools tests/src/org/jboss/test/messaging/tools/jmx/rmi util

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Aug 31 15:22:57 EDT 2006


Author: timfox
Date: 2006-08-31 15:22:33 -0400 (Thu, 31 Aug 2006)
New Revision: 1245

Removed:
   trunk/docs/JBossMQConfiguration.sxd
   trunk/docs/JBossMessagingClientSide.sxd
   trunk/docs/JBossMessagingConsumer.sxd
   trunk/docs/JBossMessagingCore.txt
   trunk/docs/JBossMessagingCoreGraphics.sxd
   trunk/docs/JBossMessagingJMSFacade-MessageConsumer.sxd
   trunk/docs/JBossMessagingJMSFacade.sxd
   trunk/docs/JBossMessagingJMSFacade2.sxd
   trunk/lib/jboss-remoting.jar
   trunk/lib/jboss-serialization.jar
   trunk/src/cts/
Modified:
   trunk/.classpath
   trunk/build-messaging.xml
   trunk/build-thirdparty.xml
   trunk/messaging.iml
   trunk/src/etc/xmdesc/ServerPeer-xmbean.xml
   trunk/src/main/org/jboss/jms/client/JBossSession.java
   trunk/src/main/org/jboss/jms/client/container/ConnectionAspect.java
   trunk/src/main/org/jboss/jms/client/container/ConsumerAspect.java
   trunk/src/main/org/jboss/jms/client/container/SessionAspect.java
   trunk/src/main/org/jboss/jms/client/container/TransactionAspect.java
   trunk/src/main/org/jboss/jms/client/delegate/ClientConnectionFactoryDelegate.java
   trunk/src/main/org/jboss/jms/client/remoting/CallbackServerFactory.java
   trunk/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java
   trunk/src/main/org/jboss/jms/client/remoting/MessageCallbackHandler.java
   trunk/src/main/org/jboss/jms/server/ServerPeer.java
   trunk/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java
   trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
   trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
   trunk/src/main/org/jboss/jms/server/remoting/JMSServerInvocationHandler.java
   trunk/src/main/org/jboss/jms/tx/AckInfo.java
   trunk/src/main/org/jboss/jms/tx/ResourceManager.java
   trunk/src/main/org/jboss/messaging/core/plugin/JDBCPersistenceManager.java
   trunk/tests/src/org/jboss/test/messaging/jms/CTSMiscellaneousTest.java
   trunk/tests/src/org/jboss/test/messaging/jms/CallbackServerFactoryTest.java
   trunk/tests/src/org/jboss/test/messaging/jms/JMSTest.java
   trunk/tests/src/org/jboss/test/messaging/jms/TransactedSessionTest.java
   trunk/tests/src/org/jboss/test/messaging/jms/server/DestinationManagerTest.java
   trunk/tests/src/org/jboss/test/messaging/jms/server/destination/QueueManagementTest.java
   trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java
   trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java
   trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/RMITestServer.java
   trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/Server.java
   trunk/util/release-admin.xml
Log:
Merged latest fixes from 1.0 branch




Modified: trunk/.classpath
===================================================================
--- trunk/.classpath	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/.classpath	2006-08-31 19:22:33 UTC (rev 1245)
@@ -27,9 +27,9 @@
 	<classpathentry kind="lib" path="perf/resources/jcommon-1.0.0-rc1.jar"/>
 	<classpathentry kind="lib" path="perf/resources/jfreechart-1.0.0-rc1.jar"/>
 	<classpathentry kind="lib" path="thirdparty/apache-log4j/lib/log4j.jar"/>
-	<classpathentry kind="lib" path="lib/jboss-remoting.jar"/>
+	<classpathentry kind="lib" path="C:/dev/messaging/trunk/thirdparty/jboss/remoting/lib/jboss-remoting.jar"/>
 	<classpathentry kind="lib" path="thirdparty/jboss/aop/lib/jboss-aop.jar"/>
-	<classpathentry kind="lib" path="lib/jboss-serialization.jar"/>
+	<classpathentry kind="lib" path="C:/dev/messaging/trunk/thirdparty/jboss/serialization/lib/jboss-serialization.jar"/>
 	<classpathentry kind="lib" path="thirdparty/junit/lib/junit.jar"/>
 	<classpathentry kind="lib" path="thirdparty/jboss/profiler/jvmti/lib/jboss-profiler-jvmti.jar"/>
 	<classpathentry kind="lib" path="thirdparty/hsqldb/lib/hsqldb.jar"/>

Modified: trunk/build-messaging.xml
===================================================================
--- trunk/build-messaging.xml	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/build-messaging.xml	2006-08-31 19:22:33 UTC (rev 1245)
@@ -399,17 +399,25 @@
       <mkdir dir="${build.lib}"/>
       <jar jarfile="${build.lib}/jboss-${module.name}.jar" manifest="${build.etc}/default.mf">
          <fileset dir="${build.classes}" includes="**"/>
-         <fileset dir="${build.jar}" includes="**"/>
+         <fileset dir="${build.jar}">
+            <exclude name="*-service.xml"/>
+            <exclude name="*-ds.xml"/>
+            <exclude name="messaging-*.properties"/>
+         </fileset>
       </jar>
    </target>
 
-   <target name="scoped-sar" depends="compile, scoped-sar-structure, extract-server-dependencies">
+   <target name="scoped-sar" depends="compile, jar, scoped-sar-structure, extract-server-dependencies">
 
       <mkdir dir="${build.lib}"/>
       <jar jarfile="${build.lib}/jboss-${module.name}-scoped.sar" manifest="${build.etc}/default.mf">
-         <fileset dir="${build.classes}" includes="**"/>
+         <fileset dir="${build.lib}" includes="jboss-${module.name}.jar"/>
          <fileset dir="${build.scoped-sar}" includes="**"/>
-         <fileset dir="${build.jar}" includes="**"/>
+         <fileset dir="${build.jar}">
+            <exclude name="aop-messaging-*.xml"/>
+            <exclude name="VERSION"/>
+            <exclude name="xmdesc/**"/>
+         </fileset>
       </jar>
    </target>
 
@@ -434,7 +442,6 @@
    </target>
 
    <target name="scoped-sar-structure" depends="jar-structure, extract-server-dependencies">
-
       <copy todir="${build.scoped-sar}/META-INF" file="${source.etc}/server/default/deploy/jboss-service.xml"/>
    </target>
 

Modified: trunk/build-thirdparty.xml
===================================================================
--- trunk/build-thirdparty.xml	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/build-thirdparty.xml	2006-08-31 19:22:33 UTC (rev 1245)
@@ -89,8 +89,8 @@
       <componentref name="trove" version="1.0.2"/>
       <componentref name="jboss/common" version="snapshot"/>
       <componentref name="jboss/aop" version="1.5.0.GA"/>
-      <componentref name="jboss/serialization" version="1.0.1.GA"/>
-      <componentref name="jboss/remoting" version="2.0.0.CR1"/>
+      <componentref name="jboss/serialization" version="1.0.2.GA"/>
+      <componentref name="jboss/remoting" version="2.0.0.GA"/>
 
       <!-- Need this otherwise project doesn't build in Eclipse -->
       <componentref name="apache-logging" version="1.0.5.GA-jboss"/>
@@ -121,4 +121,4 @@
       <visit-componentref-graph componentVisitor="org.jboss.ant.util.graph.ComponentRefGraphLicenseVisitor"/>
    </target>
 
-</project>
\ No newline at end of file
+</project>

Deleted: trunk/docs/JBossMQConfiguration.sxd
===================================================================
(Binary files differ)

Deleted: trunk/docs/JBossMessagingClientSide.sxd
===================================================================
(Binary files differ)

Deleted: trunk/docs/JBossMessagingConsumer.sxd
===================================================================
(Binary files differ)

Deleted: trunk/docs/JBossMessagingCore.txt
===================================================================
--- trunk/docs/JBossMessagingCore.txt	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/docs/JBossMessagingCore.txt	2006-08-31 19:22:33 UTC (rev 1245)
@@ -1,195 +0,0 @@
-!!!Overview
-
-This document contains JBossMessaging server design notes. It starts by presenting general asynchronous messaging paterns that will be used for the server architecture and continues by describing individual "building blocks" which the server architecture will be based on. One of the goals of this document is to identify as many common elements as possible between two possible and independent server implementations:
-* __Serverful JMS (SFJMS)__ - the classical hub-and-spoke, where all message routing and persistence logic is implemented in the same address space of only one VM. The client code will interact with the client-side of the JMS runtime, which is responsible with establishing a connection to the server and providing the JMS functionality. The core of the server is located in the address space of only one VM.\\[SFJMS.png]
-* __Serverless JMS (SLJMS)__ - a distributed JMS provider architecture, that is built in top of the reliable multicasting capabilites of JGroups and its optimized for a high throughput LAN publisher-subscriber model. Since with JGroups the concept of central server doesn't exist anymore, the message routing and destination management functions will have to be implemented in a distributed manner, with "portions" of the server living in each client's VM. In this respect, the previous model in which the JMS client code and the JMS client-side runtime were co-located in the same VM and the server code was running in a completely different VM is replaced by a model in which the JMS client code, the JMS client-runtime and portions of the JMS server run-time are located together in the address space of the same VM.\\[SLJMS.png]
-
-
-
-Leaving aside perfomance considerations relative to different usage patterns, the two different server implementation should be equivalent from the client's point of view: all that JMS client code sees is a JMS 1.1 compliant provider.
-
-The first part of the document briefly presents the asynchronous messaging patterns used by the SFJMS/SLJMS implementations. The building blocks of the server architecture are presented next, followed by a series of use cases in which previously described building blocksare assembled and provide JMS-specific functionality.
-
-
-!!!Asynchronous Messaging Patterns
-
-!Message Channel
-
-Messaging application transmit data through ''Message Channels''. A ''Message Channel'' is a virtual unidirectional ''pipe'' than connects a producer of asynchonous messages to one or more consumers. A message sent by a producer is delivered to one, or more consumers. Two of the most known asynchronous messaging communication paradigms (Point-to-Point and Publish/Subscribe messaging) are in fact two different variations of this basic pattern, with different behaviors that will be insisted upon below.
-
-!Pipes and Filters
-
-''Pipes and Filters'' architectural style can be employed to divide a larger processing task into a sequence of smaller and independent processing steps. The processing steps are the ''filters'' that are connected via ''pipes''. In this particular case, the pipes can be thought as instances of simple ''Messaging Channels''. Aggregations of pipes such as ~BasicChannels (presented below) and filters (routers, loggers, etc) could lead to ''Message Channels'' with complex and configurable behavior. Both SFJMS and SLJMS will implement their message routing and persistence mechanisms based on a pipes and filters architecture.
-
-!Message Router
-
-A simple channel provides just very primitive routing capabilities: the channel's client sends a message to the channel and the channel guarantees that the message will be delivered to the receiver. More complex behaviors can be obtainted by interconnecting channels via ''Message Routers''. A ''Message Router'' is a device that accepts a message and synchronously sends it to one (or more than one, by message duplication) of its output channels.
-
-!Point-to-Point Channel
-
-The ''Point-to-Point Channel'' is a complex instance of a ''Message Channel'', which ensures that only one receiver (in case there are more than one receivers) consumes the message. The channel can have multiple receivers that can consume multiple messages concurrently, but only one of them can successfully consume a particular message. The receivers do not have to explicitely coordinate with each other; they become competing consumers and they are coordinated by the channel.
-
-If no recevier is connected to the channel at the moment the message is sent, the channel stores the message until at least one receiver connects, and then delivers the message.
-
-!Publish-Subscribe Channel
-
-The ''Publish-Subscribe Channel'' is a different instance of a ''Message Channel'' which broadcasts a message to ''all'' interested receivers. The channel takes care that each connected receiver is notified once and only once of a particular event. It works like this: its input channel splits into multiple output channels, one for each receiver. When an event is published on the channel, the ''Publish-Subscribe Channel'' delivers a copy of the message to each of the output channels. Each output channel has only one subscriber, which is allowed to consume a message only once. It this way, each subscriber gets the message only once and consumed copies disapear from the channel.
-
-By default, a ''Publish-Subscribe Channel'' doesn't deliver messages to subscribers that are not connected at the moment the channel receives the message for delivery. If a subscriber is interested to receive the messages that othewise it would have missed, it could register as a ''Durable Subscriber''. In this case the channel will "keep" the messages until the subscriber connects and then deliver the messages to it. As presented in the upcoming sections, it is very natural to implement this behavior using the right combination of basic channels and routers.
-
-!Guaranteed Delivery
-
-One of the main advantages of an asynchronous delivery system over a RPC-based system is that the sender, the network and the reciever do not have to be working at the same time. If the network is down, the messaging provider stores the message until the connection is restored and the message can be forwared. The same thing happens if the receiver is down. This is the ''store-and-forward'' process the messaging is based on. However, if the messages are only stored in memory, they are subject to the VM or system crash.
-
-The ''Guaranteed Delivery'' pattern makes sure that messages survive a VM or system crash. The messaging system uses a built-in datastore to persist messages. The key of the pattern is that a send operation does not sucessfully complete until the message is safely persisted in the datastore. Subsequently, the message is not deleted from the datastore until it is successfully forwarded and stored in the next datastore.
-
-Persistence increases the reliability, but comes at the expense of performance.
-
-!!!Server Design
-
-The implementation of the JMS Provider's core is based on the concepts of Receiver and Channel. Each of these is represented by a Java interface. Various implementations of these interfaces are combined to provide the functionality specific to a Point-to-Point messaging domain (queues) and Publish/Subscribe messaging domain. The semantics of these interfaces, as described below, remains valid both in a serverful and a serverless (distributed) context.
-
-!!Message
-
-A Message represents an atomic, self contained unit of data that flows through the system. A Message must be serializable, since there are situations when a Message must be sent over a network connection between two distributed components of the messaging system (a Channel and a remote output Receiver). The Message supports the concept of message header. Various messaging system components can attach or remove headers to/from the message, primarily for message flow management purposes.
-
-The Message does not have the concept of message address, though. The core of the message system is an assembly of Channels and Receivers that routes a message "flowing" through it, by inforcing a certain "path" resulted from its configuration.
-
-!!Receiver
-
-A component that handles Messages. Handling could mean consumption or synchronous/asynchronous forwarding to another Receiver(s). The Java interface that defines a Receiver has only one single method:
-
-{{{
-public interface Receiver
-{
-    public boolean handle(Message message);
-
-}
-}}}
-
-Upon receiving a Message, a Receiver could consume the message, could store it or forward it to one or more Receivers. The Receiver interface doesn't enforce any message handling behavior; the behavior rather depends on a specific implementation. The Receiver interface makes sure though, that handling a message produces an unequivocal positive or negative ''acknowledgment''.
-
-
-If {{handle()}} returns {{true}} it means the {{Receiver}} acknowledges the message receipt and from that moment, it is solely responsible with the consumption/delivery of the message. The sender does not need to worry anymore about the message and it is sure that the receiver will do its best effort to insure the delivery. If {{handle()}} returns {{false}} it means the {{Receiver}} refused to handle the message. It is the sender's responsibility to decide if to re-attempt delivery or to give up.  When invoking this method, be prepared to deal with unchecked exceptions the Receiver may throw. This is equivalent with a negative acknowledgement, but the sender may also decide to remove this Receiver from its list and not attempt delivery to it anymore.
-
-!!Channel
-
-A Channel is a Receiver, in the sense that it accepts messages for handling, but it only forwards the messages, it cannot consume them. The Channel interface extends Receiver. The Channel's responsibility are:
-* To choose the output Receiver(s)
-* To forward the message, deciding whether to forward synchronously or asynchronously
-
-
-{{{
-public interface Channel extends Receiver {
-
-    public boolean deliver();
-    public boolean hasMessages();
-
-}
-}}}
-
-A Channel can have zero, one or more Receivers it can potentially forward messages to. They're called ''output'' Receivers. If there is more than one output Receiver, the Channel may deliver the message to none, one or more than one Receivers, according to the logic particular to a specific Channel implementation.
-
-The Channel always prefers synchronous delivery. If there is at least a Receiver connected to the Channel, and the Receiver is willing to accept the message (calling {{send()}} on it returns true), the Channel forwards the message on the same thread that performed the delivery and its {{send()}} method returns true.
-
-However, synchronous delivery is not always possible. The Channel may not have any output Receiver, or its Receivers may be unable to accept messages or "broken". In this situations, the Channel ''stores'' the Message locally, in the hope that delivery may become possible some time in the future. Storing the message automatically triggers positive acknowledgment. The Channel's {{send()}} method immediately returns true.
-
-The Channel attempts to deliver stored message when its {{deliver()}} method is called. The algorithm to choose the message destination depends on the Channel implementation. {{deliver()}} returns true if all messages have been delivered or false if there are still messages to be delivered after the calls completes. As an implementation detail, the asynchronous delivery can be triggered by an event such adding a new receiver, or there could be a background thread that tries to deliver from time to time if stored messages exist.
-
-The Channel implementations must allow for a way to force synchronous delivery. That is, if the Channel is declared synchronous, then {{send()}} either delivers synchronously or fails. In this situation the Channel never stores messages.
-
-
-!!The Relationship between a Channel and its Receivers
-
-An output Receiver ''never pulls'' a message from a Channel. It only declares its availability, should a message arrive, by registering to the Channel. The Receiver doesn't even know that is "associated" with
-a Channel. It's the Channel that ''pushes'' the message to its Receivers. For a messaging handling system build with Channels and Receivers, there is always a unidirectional flow of messages from the input to the output of the system.
-
-TODO: How to deal with the situation when a Receiver goes off-line (send() returns false) while the
-Receiver is still being connected to the Channel, and then goes back on-line (send() potentially
-returns true). There are two possibilities:
-# Polling (a Channel background thread)
-# The Receiver must somehow send a notification to the channel ... but this makes the Receiver aware of the Channel
-
-
-!!Distributor
-
-The Distributor interface provides a way to attach or detach output Receivers to/from a sender.
-
-{{{
-public interface Distributor {
-
-    public boolean add(Receiver receiver);
-
-    public boolean remove(Receiver receiver);
-
-    public boolean contains(Receiver receiver);
-
-    public Iterator iterator();
-
-    public void clear();
-
-    public boolean acknowledged(Receiver receiver);
-
-}
-}}}
-
-!!Routers
-
-A Router is a message handling component that sends a message ''synchronously'' to none, one, several or all of its Receivers. It this respect, a Router behaves pretty much like a Channel, with the only difference that it never behaves asynchronously. It never stores a message, it either routes is successfully to its Receivers or the ((handle()}} call fails, returning false. We introduced the concept of Router in addition to the concept of Channel especially to be able to easier encapsulate different "routing" algorithms. Routers are a natural candidate for the job of "routing delegate", used by a Channel to decide whom to send a message. A Router is a Receiver and a Distributor.
-
-Two very intuitive Router implementations are the ~PointToPointRouter, which synchronously routes a message by forwarding it to one and only one Receiver, and ~PointToMultipointRouter, which synchronously routes a message by duplicating it and forwarding it to all its Receivers. The first one is used to assemble a Queue, and the second one is used by a Topic, as we will see below.
-
-!!Same-Address-Space Primitives
-
-!Pipe
-
-A Pipe is a Channel with only one output. Only one receiver can be connected to a pipe at a time. Synchronous delivery is attempted, but if it is not possible, the pipe will hold the message. The asynchronous behaviour can be turned off by seting "synchronous" flag true. If the pipe is "synchronous" and the synchronous delivery fails, the overall delivery fails and the pipe won't hold the message.
-
-
-!!Destination (Queues and Topics)
-
-Both a Queue and a Topic have a common internal structure, which allows us to define a common ~AbstractDestination base class.
-
-[AbstractDestination.png]
-
-An ~AbstractDestination uses an input Pipe (a Channel with only one output Receiver), which is connected to a Router:
-* A Queue uses an asynchronous input Pipe connected to a ~PointToPointRouter
-* A Topic uses a synchronous input Pipe (remember that Channels can be forced to be synchronous) connected to a ~PointToMultipointRouter
-
-[PointToPointChannel.png]
-
-[PublishSubscribeChannel.png]
-
-A Topic with durable subscriptions can be very simply built by extending a regular Topic and inserting Pipes between the ~PointToMultipointRouter and the Topic's Receivers.
-
-
-!!Distributed Primitives
-
-!~DistributedPipe
-
-A distributed pipe is a channel with only one output, that spans accross two address spaces. It allows sending messages synchronously or asynchronously, in one direction, between two VMs. It is implemented with a pair of two distributed pipe endopoints (~PipeInput and ~PipeOutput).
-
-Multiple distributed pipes can share the same ~PipeOutput instance (and implicitly the pipeID), as long the ~PipeIntput instances are different.
-
-[DistributedPipe.png]
-
-
-!~ReplicatedPipe
-
-
-!!Distributed Destinations
-
-A ~DistributedQueuePeer is an extension of a stand-alone Queue, and similarly to its ancestor it lives in the address space of only one VM. However, one or more ~DistributedQueuePeers interact and coordinate into creating a ''distributed queue'' that spans multiple VM, where senders and receivers can be located on any of the participating VMs.
-
-The ~DistributedQueuePeer is similar in structure to a regular Queue, with the addition that for each remote peer, the DistributedQueuePeer's Router maintains a reference to a distributed synchronous output Pipe, which knows how to send a received message to its corresponding remote peer. This way, a message that is forwarded to the distributed Pipe (from the Router's point of view, is not different from a local delivery) goes to the ~DistributedQueuePeer and gets delivered remotely to one and only one Receiver.
-
-Care must be taken to avoid infinite loops, since each ~DistributedQueuePeer maintains references to each of its peers, so a message possibly can go from DQP1 to DQP2 and back to DQP1.
-
-A ~DistributedQueuePeer has two states: ''initialized'' and ''connected''. Calling connect() transitions the ~DistributedQueuePeer from the "initialized" to "connected" state. For the transition to succeed, the underlying JChannel must be connected, and this is a necessary, but not sufficient condition.
-
-[DistributedQueue.png]
-
-
------
-
-[Back to JBossMessagingDesign|JBossMessagingDesign]

Deleted: trunk/docs/JBossMessagingCoreGraphics.sxd
===================================================================
(Binary files differ)

Deleted: trunk/docs/JBossMessagingJMSFacade-MessageConsumer.sxd
===================================================================
(Binary files differ)

Deleted: trunk/docs/JBossMessagingJMSFacade.sxd
===================================================================
(Binary files differ)

Deleted: trunk/docs/JBossMessagingJMSFacade2.sxd
===================================================================
(Binary files differ)

Deleted: trunk/lib/jboss-remoting.jar
===================================================================
(Binary files differ)

Deleted: trunk/lib/jboss-serialization.jar
===================================================================
(Binary files differ)

Modified: trunk/messaging.iml
===================================================================
--- trunk/messaging.iml	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/messaging.iml	2006-08-31 19:22:33 UTC (rev 1245)
@@ -168,14 +168,23 @@
     <orderEntry type="module-library">
       <library>
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/jboss-remoting.jar!/" />
+          <root url="jar://$MODULE_DIR$/thirdparty/jboss/remoting/lib/jboss-remoting.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES>
-          <root url="file://$MODULE_DIR$/../../cvs/JBossRemoting/src/main" />
+          <root url="file://$MODULE_DIR$/../../cvs/JBossRemoting-2.0.0.GA/src/main" />
         </SOURCES>
       </library>
     </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/thirdparty/jboss/serialization/lib/jboss-serialization.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
     <orderEntryProperties />
   </component>
 </module>

Modified: trunk/src/etc/xmdesc/ServerPeer-xmbean.xml
===================================================================
--- trunk/src/etc/xmdesc/ServerPeer-xmbean.xml	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/src/etc/xmdesc/ServerPeer-xmbean.xml	2006-08-31 19:22:33 UTC (rev 1245)
@@ -169,7 +169,9 @@
    </operation>
 
    <operation>
-      <description>Creates a queue with the specified name/JNDI name. The corresponding destination service will be instantiated, created and started</description>
+      <description>
+         Creates a queue with the specified name/JNDI name. The corresponding destination service will be instantiated, created and started.
+      </description>
       <name>createQueue</name>
       <parameter>
          <name>name</name>
@@ -183,8 +185,9 @@
    </operation>
    
    <operation>
-      <description>Creates a queue with the specified name/JNDI name and paging parameters
-         The corresponding destination service will be instantiated, created and started</description>
+      <description>
+         Creates a queue with the specified name/JNDI name and paging parameters. The corresponding destination service will be instantiated, created and started.
+      </description>
       <name>createQueue</name>
       <parameter>
          <name>name</name>
@@ -210,7 +213,9 @@
    </operation>   
 
    <operation>
-      <description>Stops and destroys the corresponding destination service. If the destination was created dynamically (via createQueue()), then the service is also unregistered from the MBean server.</description>
+      <description>
+         Stops, destroys and unregisters from the MBean server the corresponding destination service, but only if the destination in question was created programatically with createQueue(). Returns true on success. Returns false if the destination does not exist or was not created programatically. A deployed destination must be undeployed to achieve the same effect.
+      </description>
       <name>destroyQueue</name>
       <parameter>
          <name>name</name>
@@ -220,7 +225,9 @@
    </operation>
 
    <operation>
-      <description>Creates a topic with the specified name/JNDI name. The corresponding destination service will be instantiated, created and started</description>
+      <description>
+         Creates a topic with the specified name/JNDI name. The corresponding destination service will be instantiated, created and started.
+      </description>
       <name>createTopic</name>
       <parameter>
          <name>name</name>
@@ -246,8 +253,9 @@
    </operation>
    
    <operation>
-      <description>Creates a topic with the specified name/JNDI name and paging parameters
-         The corresponding destination service will be instantiated, created and started</description>
+      <description>
+         Creates a topic with the specified name/JNDI name and paging parameters. The corresponding destination service will be instantiated, created and started.
+      </description>
       <name>createTopic</name>
       <parameter>
          <name>name</name>
@@ -261,7 +269,9 @@
    </operation>   
 
    <operation>
-      <description>Stops and destroys the corresponding destination service. If can only destroy destinations that have been created programatically.</description>
+      <description>
+         Stops, destroys and unregisters from the MBean server the corresponding destination service, but only if the destination in question was created programatically with createTopic(). Returns true on success. Returns false if the destination does not exist or was not created programatically. A deployed destination must be undeployed to achieve the same effect.
+      </description>
       <name>destroyTopic</name>
       <parameter>
          <name>name</name>
@@ -270,5 +280,4 @@
       <return-type>boolean</return-type>
    </operation>
 
-
 </mbean>
\ No newline at end of file

Modified: trunk/src/main/org/jboss/jms/client/JBossSession.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/JBossSession.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/src/main/org/jboss/jms/client/JBossSession.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -297,9 +297,22 @@
       {
          throw new InvalidDestinationException("Not a JBossTopic:" + topic);
       }
-      ConsumerDelegate consumerDelegate =
+
+      ThreadContextClassLoaderChanger tccc = new ThreadContextClassLoaderChanger();
+
+      try
+      {
+         tccc.set(getClass().getClassLoader());
+
+         ConsumerDelegate consumerDelegate =
             delegate.createConsumerDelegate((JBossTopic)topic, null, false, name, false);
-      return new JBossMessageConsumer(consumerDelegate);
+
+         return new JBossMessageConsumer(consumerDelegate);
+      }
+      finally
+      {
+         tccc.restore();
+      }
    }
 
    public TopicSubscriber createDurableSubscriber(Topic topic,

Modified: trunk/src/main/org/jboss/jms/client/container/ConnectionAspect.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/container/ConnectionAspect.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/src/main/org/jboss/jms/client/container/ConnectionAspect.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -170,13 +170,13 @@
       
       ConnectionState state = getState(invocation);
       
-      //Finished with the connection - we need to shutdown callback server
-      state.getRemotingConnection().close();
+      // Finished with the connection - we need to shutdown callback server
+      state.getRemotingConnection().stop();
       
-      //Remove reference to resource manager
+      // Remove reference to resource manager
       ResourceManagerFactory.instance.returnResourceManager(state.getServerID());
       
-      //Remove reference to message id generator
+      // Remove reference to message id generator
       MessageIdGeneratorFactory.instance.returnGenerator(state.getServerID());
       
       return ret;

Modified: trunk/src/main/org/jboss/jms/client/container/ConsumerAspect.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/container/ConsumerAspect.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/src/main/org/jboss/jms/client/container/ConsumerAspect.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -101,18 +101,17 @@
    
    public Object handleClosing(Invocation invocation) throws Throwable
    {      
-      //First we make sure closing is called on the ServerConsumerEndpoint
-      //This ensures that any in transit messages are flushed out to the client side
+      // First we make sure closing is called on the ServerConsumerEndpoint. This ensures that any
+      // in-transit messages are flushed out to the client side.
+
       Object res = invocation.invokeNext();
       
       ConsumerState consumerState = getState(invocation);
-      
       SessionState sessionState = (SessionState)consumerState.getParent();
-      
       ConnectionState connectionState = (ConnectionState)sessionState.getParent();
             
-      //Then we call close on the messagecallbackhandler which waits for onMessage invocations
-      //to complete and then cancels anything in the client buffer
+      // Then we call close on the messagecallbackhandler which waits for onMessage invocations
+      // to complete and then cancels anything in the client buffer.
       consumerState.getMessageCallbackHandler().close();
       
       sessionState.removeCallbackHandler(consumerState.getMessageCallbackHandler());

Modified: trunk/src/main/org/jboss/jms/client/container/SessionAspect.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/container/SessionAspect.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/src/main/org/jboss/jms/client/container/SessionAspect.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -201,29 +201,33 @@
       return null;  
    }
    
-   /*
+   /**
     * Redelivery occurs in two situations:
+    *
     * 1) When session.recover() is called (JMS1.1 4.4.11)
+    *
     * "A session's recover method is used to stop a session and restart it with its first
-    * unacknowledged message. In effect, the session's series of delivered messages
-    * is reset to the point after its last acknowledged message."
-    * An important note here is that session recovery is LOCAL to the session.
-    * Session recovery DOES NOT result in delivered messages being cancelled back
-    * to the channel where they can be redelivered - since that may result in them being
-    * picked up by another session, which would break the semantics of recovery as described
-    * in the spec.
-    * 2) When session rollback occurs (JMS1.1 4.4.7)
-    * On rollback of a session the spec is clear that session recovery occurs:
-    * "If a transaction rollback is done, its produced messages
-    * are destroyed and its consumed messages are automatically recovered. For
-    * more information on session recovery, see Section 4.4.11 'Message
-    * Acknowledgment.'"
-    * So on rollback we do session recovery (local redelivery) in the same as if 
-    * session.recover() was called.
+    * unacknowledged message. In effect, the session's series of delivered messages is reset to the
+    * point after its last acknowledged message."
+    *
+    * An important note here is that session recovery is LOCAL to the session. Session recovery DOES
+    * NOT result in delivered messages being cancelled back to the channel where they can be
+    * redelivered - since that may result in them being picked up by another session, which would
+    * break the semantics of recovery as described in the spec.
+    *
+    * 2) When session rollback occurs (JMS1.1 4.4.7). On rollback of a session the spec is clear
+    * that session recovery occurs:
+    *
+    * "If a transaction rollback is done, its produced messages are destroyed and its consumed
+    * messages are automatically recovered. For more information on session recovery, see Section
+    * 4.4.11 'Message Acknowledgment.'"
+    *
+    * So on rollback we do session recovery (local redelivery) in the same as if session.recover()
+    * was called.
     * 
-    * There is a conflict here though. It seems a CTS test requires messages to be available to OTHER
-    * sessions on rollback - see CTSMiscellaneousTest.testContestedQueueOnRollback()
-    * Which seems in direct contradiction to the spec.
+    * There is a conflict here though. It seems a CTS test requires messages to be available to
+    * OTHER sessions on rollback - see CTSMiscellaneousTest.testContestedQueueOnRollback(), which
+    * seems in direct contradiction to the spec.
     * 
     * In order to satisfy the test, on session recovery, if there are no local consumers available
     * to consume the message, we cancel the message back to the channel.
@@ -233,39 +237,32 @@
       if (trace) { log.trace("redeliver called"); }
       
       MethodInvocation mi = (MethodInvocation)invocation;
-            
       SessionState state = getState(invocation);
             
-      //We put the messages back in the front of their appropriate consumer buffers and
-      //set JMSRedelivered to true
+      // We put the messages back in the front of their appropriate consumer buffers and set
+      // JMSRedelivered to true.
       
       List toRedeliver = (List)mi.getArguments()[0];
-       
       LinkedList toCancel = new LinkedList();
       
-      //Need to be recovered in reverse order
+      // Need to be recovered in reverse order.
       for (int i = toRedeliver.size() - 1; i >= 0; i--)
       {
          AckInfo info = (AckInfo)toRedeliver.get(i);
-         
          MessageProxy proxy = info.getMessage();
-         
          proxy.setJMSRedelivered(true);
          
-         //TODO delivery count although optional should be global
-         //so we need to send it back to the server
-         //but this has performance hit so perhaps we just don't support it?
+         //TODO delivery count although optional should be global so we need to send it back to the
+         //     server but this has performance hit so perhaps we just don't support it?
          proxy.incDeliveryCount();
          
          MessageCallbackHandler handler = state.getCallbackHandler(info.getConsumerID());
               
          if (handler == null)
          {
-            // This is ok.
-
-            // The original consumer has closed, this message wil get cancelled back to the channel.
-            
-            toCancel.addFirst(info);            
+            // This is ok. The original consumer has closed, this message wil get cancelled back
+            // to the channel.
+            toCancel.addFirst(info);
          }
          else
          {
@@ -275,10 +272,9 @@
       
       if (!toCancel.isEmpty())
       {
-         //Cancel the messages that can't be redelivered locally
+         // Cancel the messages that can't be redelivered locally
          
          SessionDelegate del = (SessionDelegate)mi.getTargetObject();
-         
          del.cancelDeliveries(toCancel);
       }
             

Modified: trunk/src/main/org/jboss/jms/client/container/TransactionAspect.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/container/TransactionAspect.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/src/main/org/jboss/jms/client/container/TransactionAspect.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -36,6 +36,7 @@
 import org.jboss.jms.tx.AckInfo;
 import org.jboss.jms.tx.LocalTx;
 import org.jboss.jms.tx.TxState;
+import org.jboss.jms.tx.ResourceManager;
 
 /**
  * This aspect handles transaction related logic
@@ -49,183 +50,183 @@
 public class TransactionAspect
 {
    // Constants -----------------------------------------------------
-   
+
    // Attributes ----------------------------------------------------
-       
+
    // Static --------------------------------------------------------
-   
+
    // Constructors --------------------------------------------------
-   
+
    // Public --------------------------------------------------------
-   
+
    public Object handleClose(Invocation invocation) throws Throwable
    {
       Object res = invocation.invokeNext();
-      
+
       SessionState state = (SessionState)getState(invocation);
-      
+
       ConnectionState connState = (ConnectionState)state.getParent();
-            
+
       Object xid = state.getCurrentTxId();
-      
+
       if (xid != null)
       {
          //Remove transaction from the resource manager
          connState.getResourceManager().removeTx(xid);
-      }           
-      
+      }
+
       return res;
    }
-   
+
    public Object handleCommit(Invocation invocation) throws Throwable
    {
       SessionState state = (SessionState)getState(invocation);
-      
+
       if (!state.isTransacted())
       {
          throw new IllegalStateException("Cannot commit a non-transacted session");
       }
-      
+
       if (state.isXA())
       {
          throw new TransactionInProgressException("Cannot call commit on an XA session");
       }
-      
+
       ConnectionState connState = (ConnectionState)state.getParent();
       ConnectionDelegate conn = (ConnectionDelegate)connState.getDelegate();
-      
+
       try
-      {            
+      {
          connState.getResourceManager().commitLocal((LocalTx)state.getCurrentTxId(), conn);
       }
       finally
       {
          //Start new local tx
          Object xid = connState.getResourceManager().createLocalTx();
-         
+
          state.setCurrentTxId(xid);
       }
-      
+
       return null;
    }
-   
+
    public Object handleRollback(Invocation invocation) throws Throwable
    {
       SessionState state = (SessionState)getState(invocation);
-           
+
       if (!state.isTransacted())
       {
          throw new IllegalStateException("Cannot rollback a non-transacted session");
       }
-      
+
       if (state.isXA())
       {
          throw new TransactionInProgressException("Cannot call rollback on an XA session");
       }
-      
+
       ConnectionState connState = (ConnectionState)state.getParent();
+      ResourceManager rm = connState.getResourceManager();
       ConnectionDelegate conn = (ConnectionDelegate)connState.getDelegate();
-      
-      TxState tx = connState.getResourceManager().getTx(state.getCurrentTxId());
-      
+
+      TxState tx = rm.getTx(state.getCurrentTxId());
+
       if (tx == null)
       {
          throw new IllegalStateException("Cannot find tx:" + state.getCurrentTxId());
       }
-        
+
       try
       {
-         connState.getResourceManager().rollbackLocal((LocalTx)state.getCurrentTxId(), conn);
+         rm.rollbackLocal((LocalTx)state.getCurrentTxId(), conn);
       }
       finally
       {
-         //Start new local tx
-         Object xid = connState.getResourceManager().createLocalTx();
-         
+         // start new local tx
+         Object xid = rm.createLocalTx();
          state.setCurrentTxId(xid);
-      }                 
-           
-      return null;            
+      }
+
+      return null;
    }
-   
+
    public Object handleSend(Invocation invocation) throws Throwable
    {
       SessionState sessionState = (SessionState)getState(invocation);
-                        
+
       if (sessionState.isTransacted())
       {
          //Session is transacted - so we add message to tx instead of sending now
-         
+
          Object txID = sessionState.getCurrentTxId();
-         
+
          if (txID == null)
-         {            
+         {
             throw new IllegalStateException("Attempt to send message in tx, but txId is null, XA?" + sessionState.isXA());
          }
-         
+
          ConnectionState connState = (ConnectionState)sessionState.getParent();
-         
+
          MethodInvocation mi = (MethodInvocation)invocation;
-         
-         Message m = (Message)mi.getArguments()[0];         
-         
+
+         Message m = (Message)mi.getArguments()[0];
+
          connState.getResourceManager().addMessage(txID, m);
-         
+
          // ... and we don't invoke any further interceptors in the stack
-         return null;               
+         return null;
       }
       else
-      {      
+      {
          return invocation.invokeNext();
       }
    }
-   
+
    public Object handlePreDeliver(Invocation invocation) throws Throwable
    {
       SessionState state = (SessionState)getState(invocation);
-       
+
       if (state.isTransacted())
       {
          MethodInvocation mi = (MethodInvocation)invocation;
-         
+
          MessageProxy proxy = (MessageProxy)mi.getArguments()[0];
-         
+
          //long messageID = proxy.getMessage().getMessageID();
-         
+
          int consumerID = ((Integer)mi.getArguments()[1]).intValue();
-         
+
          AckInfo info = new AckInfo(proxy, consumerID);
-         
+
          Object txID = state.getCurrentTxId();
-         
+
          if (txID == null)
          {
             throw new IllegalStateException("Attempt to send message in tx, but txId is null, XA?" + state.isXA());
          }
-         
+
          ConnectionState connState = (ConnectionState)state.getParent();
-         
+
          //Add the acknowledgement to the transaction
 
-         connState.getResourceManager().addAck(txID, info);                  
+         connState.getResourceManager().addAck(txID, info);
       }
 
       return null;
    }
 
    // Protected ------------------------------------------------------
-   
+
    // Package Private ------------------------------------------------
-   
+
    // Private --------------------------------------------------------
-   
+
    private HierarchicalState getState(Invocation inv)
    {
       return ((DelegateSupport)inv.getTargetObject()).getState();
    }
-   
+
    // Inner Classes --------------------------------------------------
-   
+
 }
 
 

Modified: trunk/src/main/org/jboss/jms/client/delegate/ClientConnectionFactoryDelegate.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/delegate/ClientConnectionFactoryDelegate.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/src/main/org/jboss/jms/client/delegate/ClientConnectionFactoryDelegate.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -156,6 +156,7 @@
          // Create a new connection
          
          remotingConnection = new JMSRemotingConnection(serverLocatorURI, clientPing);
+         remotingConnection.start();
          
          client = remotingConnection.getInvokingClient();
          
@@ -208,7 +209,7 @@
          {
             try
             {
-               remotingConnection.close();
+               remotingConnection.stop();
             }
             catch (Throwable ignore)
             {               

Modified: trunk/src/main/org/jboss/jms/client/remoting/CallbackServerFactory.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/remoting/CallbackServerFactory.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/src/main/org/jboss/jms/client/remoting/CallbackServerFactory.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -96,7 +96,7 @@
       return h.server;
    }
    
-   public synchronized void returnCallbackServer(String protocol)
+   public synchronized void stopCallbackServer(String protocol)
    {
       Holder h = (Holder)holders.get(protocol);
       
@@ -200,6 +200,7 @@
    
    protected void stopCallbackServer(Connector server)
    {
+      log.debug("Stopping and destroying callback server " + server.getLocator().getLocatorURI());
       server.stop();
       server.destroy();
    }

Modified: trunk/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -29,6 +29,7 @@
 import org.jboss.logging.Logger;
 import org.jboss.remoting.Client;
 import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.callback.InvokerCallbackHandler;
 import org.jboss.remoting.transport.Connector;
 
 
@@ -57,56 +58,74 @@
    // Attributes ----------------------------------------------------
 
    protected Client client;
+   protected boolean clientPing;
    protected Connector callbackServer;
    protected InvokerLocator serverLocator;
    protected CallbackManager callbackManager;
 
+   private InvokerCallbackHandler dummyCallbackHandler;
+
    // Constructors --------------------------------------------------
 
    public JMSRemotingConnection(String serverLocatorURI, boolean clientPing) throws Throwable
    { 
       serverLocator = new InvokerLocator(serverLocatorURI);
-            
-      // Enable client pinging
-      // Server leasing is enabled separately on the server side
+      this.clientPing = clientPing;
+      dummyCallbackHandler = new DummyCallbackHandler();
+
+      log.debug(this + " created");
+   }
+
+   // Public --------------------------------------------------------
+
+   public void start() throws Throwable
+   {
+      // Enable client pinging. Server leasing is enabled separately on the server side
+
       Map config = new HashMap();
-
       config.put(Client.ENABLE_LEASE, String.valueOf(clientPing));
 
       client = new Client(serverLocator, config);
-      
+
       client.setSubsystem(ServerPeer.REMOTING_JMS_SUBSYSTEM);
 
-      if (log.isTraceEnabled()) { log.trace("created client"); }
-            
+      if (log.isTraceEnabled()) { log.trace(this + " created client"); }
+
       // Get the callback server
-      
+
       callbackServer = CallbackServerFactory.instance.getCallbackServer(serverLocator);
-      
       callbackManager = (CallbackManager)callbackServer.getInvocationHandlers()[0];
-               
+
       client.connect();
-      
-      // We explictly set the Marshaller since otherwise remoting tries to resolve the marshaller
+
+      // We explicitly set the Marshaller since otherwise remoting tries to resolve the marshaller
       // every time which is very slow - see org.jboss.remoting.transport.socket.ProcessInvocation
       // This can make a massive difference on performance. We also do this in
       // ServerConnectionEndpoint.setCallbackClient.
 
       client.setMarshaller(new JMSWireFormat());
       client.setUnMarshaller(new JMSWireFormat());
-      
-      client.addListener(new DummyCallbackHandler(), callbackServer.getLocator());
 
-      log.debug(this + " created");
+      // We add a dummy callback handler only to trigger the addListener method on the
+      // JMSServerInvocationHandler to be called, which allows the server to get hold of a reference
+      // to the callback client so it can make callbacks
+
+      client.addListener(dummyCallbackHandler, callbackServer.getLocator());
+
+      log.debug(this + " started");
    }
 
-   // Public --------------------------------------------------------
-
-   public void close() throws Throwable
+   public void stop() throws Throwable
    {
       log.debug(this + " closing");
+
+      // explicitly remove the callback listener, to avoid race conditions on server
+      // (http://jira.jboss.org/jira/browse/JBMESSAGING-535)
+
+      client.removeListener(dummyCallbackHandler);
+      dummyCallbackHandler = null;
       
-      CallbackServerFactory.instance.returnCallbackServer(serverLocator.getProtocol());
+      CallbackServerFactory.instance.stopCallbackServer(serverLocator.getProtocol());
       
       client.disconnect();
       
@@ -123,6 +142,11 @@
       return callbackManager;
    }
 
+   public String toString()
+   {
+      return "JMSRemotingConnection[" + serverLocator.getLocatorURI() + "]";
+   }
+
    // Package protected ---------------------------------------------
 
    // Protected -----------------------------------------------------

Modified: trunk/src/main/org/jboss/jms/client/remoting/MessageCallbackHandler.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/remoting/MessageCallbackHandler.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/src/main/org/jboss/jms/client/remoting/MessageCallbackHandler.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -311,29 +311,25 @@
          
       waitForOnMessageToComplete();
       
-      //Now we cancel anything left in the buffer
-      //The reason we do this now is that otherwise the deliveries wouldn't get cancelled
-      //until session close (since we don't cancel consumer's deliveries until then)
-      //which is too late - since we need to preserve the order of messages delivered in a session.
+      // Now we cancel anything left in the buffer. The reason we do this now is that otherwise the
+      // deliveries wouldn't get cancelled until session close (since we don't cancel consumer's
+      // deliveries until then), which is too late - since we need to preserve the order of messages
+      // delivered in a session.
       
       if (!buffer.isEmpty())
       {            
-         //Now we cancel any deliveries that might be waiting in our buffer
-         //This is because, otherwise the messages wouldn't get cancelled until
-         //the corresponding session died.
-         //So if another consumer in another session tried to consume from the channel
-         //before that session died it wouldn't receive those messages
-         Iterator iter = buffer.iterator();
-         
+         // Now we cancel any deliveries that might be waiting in our buffer. This is because
+         // otherwise the messages wouldn't get cancelled until the corresponding session died.
+         // So if another consumer in another session tried to consume from the channel before that
+         // session died it wouldn't receive those messages.
+
          List ackInfos = new ArrayList();
-         while (iter.hasNext())
-         {                        
-            MessageProxy mp = (MessageProxy)iter.next();
-            
+
+         for(Iterator i = buffer.iterator(); i.hasNext();)
+         {
+            MessageProxy mp = (MessageProxy)i.next();
             AckInfo ack = new AckInfo(mp, consumerID);
-            
             ackInfos.add(ack);
-            
          }
                
          sessionDelegate.cancelDeliveries(ackInfos);
@@ -346,7 +342,7 @@
    
    private void waitForOnMessageToComplete()
    {
-      //Wait for any on message executions to complete
+      // Wait for any on message executions to complete
       
       Future result = new Future();
       

Modified: trunk/src/main/org/jboss/jms/server/ServerPeer.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/ServerPeer.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/src/main/org/jboss/jms/server/ServerPeer.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -861,7 +861,11 @@
 
       MBeanServer mbeanServer = getServer();
 
-      // we can only destroy destinations that have been created programatically
+      // we can only destroy destinations that exist AND that have been created programatically
+      if (!mbeanServer.isRegistered(on))
+      {
+         return false;
+      }
       Boolean b = (Boolean)mbeanServer.getAttribute(on, "CreatedProgrammatically");
       if (!b.booleanValue())
       {

Modified: trunk/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -117,13 +117,14 @@
       
       if (jmsClientId != null)
       {
-         log.warn("A problem has been detected with the connection to remote client " + remotingSessionID
-                + " It is possible the client has exited without closing its connection(s) or there is a network "
-                + "problem. "
-                + "All connection resources corresponding to that client process will now be removed.");
+         log.warn("A problem has been detected with the connection to remote client " +
+                  remotingSessionID + ". It is possible the client has exited without closing " +
+                  "its connection(s) or there is a network problem. All connection resources " +
+                  "corresponding to that client process will now be removed.");
 
-         //Remoting only provides one pinger per invoker, not per connection therefore when the pinger dies
-         //we must close ALL the connections corresponding to that jms client id
+         // Remoting only provides one pinger per invoker, not per connection therefore when the
+         // pinger dies we must close ALL the connections corresponding to that jms client id
+         
          Map endpoints = (Map)jmsClients.get(jmsClientId);                  
          
          if (endpoints != null)

Modified: trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -743,7 +743,7 @@
 
             try
             {
-               if (trace) { log.trace("handing " + list.size() + " message(s) over to the remoting layer"); }
+               if (trace) { log.trace(ServerConsumerEndpoint.this + "handing " + list.size() + " message(s) over to the remoting layer"); }
             
                ClientDelivery del = new ClientDelivery(list, id);
                
@@ -753,7 +753,7 @@
                
                MessagingMarshallable resp = (MessagingMarshallable)connection.getCallbackClient().invoke(mm);
 
-               if (trace) { log.trace("handed messages over to the remoting layer"); }
+               if (trace) { log.trace(ServerConsumerEndpoint.this + "handed messages over to the remoting layer"); }
                 
                HandleMessageResponse result = (HandleMessageResponse)resp.getLoad();
 
@@ -768,8 +768,8 @@
             }
             catch(Throwable t)
             {
-               log.warn("Failed to deliver the message to the client. See the server log for more details");
-               log.debug("Failed to deliver the message to the client.", t);
+               log.warn("Failed to deliver the message to the client. See the server log for more details.");
+               log.debug(ServerConsumerEndpoint.this + " failed to deliver the message to the client.", t);
                
                ConnectionManager mgr = connection.getServerPeer().getConnectionManager();
                

Modified: trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -478,7 +478,7 @@
    {
       try
       {
-         //Deliveries must be cancelled in reverse order
+         // deliveries must be cancelled in reverse order
           
          Set consumers = new HashSet();
          
@@ -486,8 +486,9 @@
          {
             AckInfo ack = (AckInfo)ackInfos.get(i);
             
-            //We look in the global map since the message might have come from connection consumer
-            ServerConsumerEndpoint consumer = this.connectionEndpoint.getConsumerEndpoint(ack.getConsumerID());
+            // We look in the global map since the message might have come from connection consumer
+            ServerConsumerEndpoint consumer =
+               this.connectionEndpoint.getConsumerEndpoint(ack.getConsumerID());
    
             if (consumer == null)
             {
@@ -495,18 +496,14 @@
             }
             
             consumer.cancelDelivery(new Long(ack.getMessageID()));
-            
             consumers.add(consumer);
          }
          
-         //Need to prompt delivery for all consumers
+         // need to prompt delivery for all consumers
          
-         Iterator iter = consumers.iterator();
-         
-         while (iter.hasNext())
+         for(Iterator i = consumers.iterator(); i.hasNext(); )
          {
-            ServerConsumerEndpoint consumer = (ServerConsumerEndpoint)iter.next();
-            
+            ServerConsumerEndpoint consumer = (ServerConsumerEndpoint)i.next();
             consumer.promptDelivery();
          }
       }

Modified: trunk/src/main/org/jboss/jms/server/remoting/JMSServerInvocationHandler.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/remoting/JMSServerInvocationHandler.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/src/main/org/jboss/jms/server/remoting/JMSServerInvocationHandler.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -112,6 +112,7 @@
          if (callbackHandler != null)
          {
             log.debug("found calllback handler for remoting session " + Util.guidToString(s));
+            
             i.getMetaData().addMetaData(MetaDataConstants.JMS,
                                         MetaDataConstants.CALLBACK_HANDLER,
                                         callbackHandler, PayloadKey.TRANSIENT);

Modified: trunk/src/main/org/jboss/jms/tx/AckInfo.java
===================================================================
--- trunk/src/main/org/jboss/jms/tx/AckInfo.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/src/main/org/jboss/jms/tx/AckInfo.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -48,7 +48,7 @@
    
    protected int consumerID;
    
-   //The actual proxy must not get serialized
+   // The actual proxy must not get serialized
    protected transient MessageProxy msg;
    
    // Static --------------------------------------------------------

Modified: trunk/src/main/org/jboss/jms/tx/ResourceManager.java
===================================================================
--- trunk/src/main/org/jboss/jms/tx/ResourceManager.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/src/main/org/jboss/jms/tx/ResourceManager.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -163,19 +163,19 @@
    {
       if (trace) { log.trace("rolling back local xid " + xid); }
       
-      TxState tx = removeTx(xid);
+      TxState ts = removeTx(xid);
       
-      if (tx == null)
+      if (ts == null)
       {      
          throw new IllegalStateException("Cannot find transaction with xid:" + xid);         
       }
       
-      //Don't need messages for rollback
-      tx.clearMessages();
+      // don't need messages for rollback
+      ts.clearMessages();
       
-      //For one phase rollback there is nothing to do on the server
+      // for one phase rollback there is nothing to do on the server
       
-      redeliverMessages(tx);
+      redeliverMessages(ts);
    }
    
    public void commit(Xid xid, boolean onePhase, ConnectionDelegate connection) throws XAException
@@ -272,59 +272,45 @@
    
    /*
     * Rollback has occurred so we need to redeliver any unacked messages corresponding to the acks
-    * is in the transaction
+    * is in the transaction.
     */
-   private void redeliverMessages(TxState tx) throws JMSException
+   private void redeliverMessages(TxState ts) throws JMSException
    {
-      Iterator iter = tx.getAcks().iterator();
-      
-      //Sort them into lists - one for each session
-        
-      //We use a LinkedHashMap since we need to preserve the order of the sessions
+      // Sort messages into lists, one for each session. We use a LinkedHashMap since we need to
+      // preserve the order of the sessions.
+
       Map toAck = new LinkedHashMap();
-      
-      while (iter.hasNext())
+
+      for(Iterator i = ts.getAcks().iterator(); i.hasNext(); )
       {
-         AckInfo ack = (AckInfo)iter.next();
-         
+         AckInfo ack = (AckInfo)i.next();
          SessionDelegate del = ack.msg.getSessionDelegate();
          
          List acks = (List)toAck.get(del);
-         
          if (acks == null)
          {
             acks = new ArrayList();
-            
             toAck.put(del, acks);
          }
-         
          acks.add(ack);
       }
       
-      //Now tell each session to redeliver
+      // Now tell each session to redeliver.
       
       LinkedList l = new LinkedList();
       
-      iter = toAck.entrySet().iterator();
-                  
-      //need to reverse the order
-      while (iter.hasNext())
+      for(Iterator i = toAck.entrySet().iterator(); i.hasNext();)
       {
-         Object entry = iter.next();
-         
-         l.addFirst(entry);         
+         // need to reverse the order
+         Object entry = i.next();
+         l.addFirst(entry);
       }
       
-      iter = l.iterator();
-      
-      while (iter.hasNext())
+      for(Iterator i = l.iterator(); i.hasNext();)
       {
-         Map.Entry entry = (Map.Entry)iter.next();
-         
+         Map.Entry entry = (Map.Entry)i.next();
          SessionDelegate sess = (SessionDelegate)entry.getKey();
-         
          List acks = (List)entry.getValue();
-         
          sess.redeliver(acks);
       }  
    }

Modified: trunk/src/main/org/jboss/messaging/core/plugin/JDBCPersistenceManager.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/JDBCPersistenceManager.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/src/main/org/jboss/messaging/core/plugin/JDBCPersistenceManager.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -1734,67 +1734,6 @@
       }
    }
    
-//   public void resetPagedStatus(long channelID) throws Exception
-//   {
-//      if (trace) { log.trace("resetting paged status for channel " + channelID); }
-//      
-//      Connection conn = null;
-//      PreparedStatement ps = null;
-//      TransactionWrapper wrap = new TransactionWrapper();
-//      
-//      log.trace("Resetting paged status. This may take several minutes for large queues/subscriptions...");
-//      
-//      try
-//      {
-//         conn = ds.getConnection();
-//         
-//         log.debug("Updating all page ordering to null");
-//                  
-//         ps = conn.prepareStatement(getSQLStatement("RESET_PAGED_STATUS"));
-//         
-//         ps.setLong(1, channelID);
-//         
-//         int rows = ps.executeUpdate();
-//         
-//         if (trace)
-//         {
-//            log.trace(JDBCUtil.statementToString(getSQLStatement("RESET_PAGED_STATUS"))
-//                  + " updated " + rows + " rows");
-//         }
-//               
-//         ps.close();
-//         
-//      }
-//      catch (Exception e)
-//      {
-//         wrap.exceptionOccurred();
-//         throw e;
-//      }
-//      finally
-//      {
-//         if (ps != null)
-//         {
-//            try
-//            {
-//               ps.close();
-//            }
-//            catch (Throwable e)
-//            {
-//            }
-//         }
-//         if (conn != null)
-//         {
-//            try
-//            {
-//               conn.close();
-//            }
-//            catch (Throwable e)
-//            {
-//            }
-//         }
-//         wrap.end();
-//      }
-//   }
      
    public List retrievePreparedTransactions() throws Exception
    {

Modified: trunk/tests/src/org/jboss/test/messaging/jms/CTSMiscellaneousTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/CTSMiscellaneousTest.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/tests/src/org/jboss/test/messaging/jms/CTSMiscellaneousTest.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -207,99 +207,7 @@
       }
    }
 
-   // Temporarily commented out. See http://jira.jboss.org/jira/browse/JBMESSAGING-485
 
-//   public void testContestedQueueOnRollback() throws Exception
-//   {
-//      ConnectionFactory cf = (JBossConnectionFactory)ic.lookup("/ConnectionFactory");
-//      Queue queue = (Queue)ic.lookup("/queue/Queue");
-//
-//      Connection c =  cf.createConnection();
-//      try
-//      {
-//         Session s = c.createSession(false, Session.AUTO_ACKNOWLEDGE);
-//         TextMessage tm = s.createTextMessage("blah");
-//         s.createProducer(queue).send(tm);
-//      }
-//      finally
-//      {
-//         c.close();
-//      }
-//
-//      // message is in the queue
-//      log.debug("message is in the queue");
-//
-//      c = cf.createConnection();
-//      c.start();
-//
-//      try
-//      {
-//         Session s = c.createSession(true, Session.SESSION_TRANSACTED);
-//         MessageConsumer cons = s.createConsumer(queue);
-//
-//         Session s2 = c.createSession(true, Session.SESSION_TRANSACTED);
-//         final MessageConsumer cons2 = s2.createConsumer(queue);
-//
-//         Session sessionToRollback = s;
-//         MessageConsumer cc = cons2;
-//         TextMessage rm = (TextMessage)cons.receiveNoWait();
-//
-//         if (rm == null)
-//         {
-//            sessionToRollback = s2;
-//            cc = cons;
-//            rm = (TextMessage)cons.receiveNoWait();
-//         }
-//
-//         assertEquals("blah", rm.getText());
-//
-//         final Slot slot = new Slot();
-//         final MessageConsumer contestingConsumer = cc;
-//
-//         new Thread(new Runnable()
-//         {
-//            public void run()
-//            {
-//               try
-//               {
-//                  log.debug("contester blocking to receive");
-//                  Message m = contestingConsumer.receive(8000);
-//                  log.debug("contester received " + m);
-//
-//                  if (m != null)
-//                  {
-//                     // if I receive a message, unlock the slot
-//                     slot.put(m);
-//                  }
-//               }
-//               catch(Exception e)
-//               {
-//                  log.error("contested receive failed", e);
-//               }
-//            }
-//         }, "Contester Thread").start();
-//
-//         // wait for the contested thread to start receiving
-//         Thread.sleep(2000);
-//
-//         // send the message back to the queue
-//         log.debug("rolling back");
-//         sessionToRollback.rollback();
-//         log.debug("rolled back");
-//
-//         // wait for the contester to receive
-//         TextMessage rm2 = (TextMessage)slot.poll(5000);
-//
-//         assertEquals("blah", rm2.getText());
-//      }
-//      finally
-//      {
-//         log.debug("closing connection");
-//         c.close();
-//      }
-//   }
-
-
    // Package protected ---------------------------------------------
 
    // Protected -----------------------------------------------------

Modified: trunk/tests/src/org/jboss/test/messaging/jms/CallbackServerFactoryTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/CallbackServerFactoryTest.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/tests/src/org/jboss/test/messaging/jms/CallbackServerFactoryTest.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -85,19 +85,19 @@
       assertFalse(server1 == server3);
       
       
-      CallbackServerFactory.instance.returnCallbackServer(locator1.getProtocol());
+      CallbackServerFactory.instance.stopCallbackServer(locator1.getProtocol());
       
       assertTrue(CallbackServerFactory.instance.containsCallbackServer(locator1.getProtocol()));
       
-      CallbackServerFactory.instance.returnCallbackServer(locator2.getProtocol());
+      CallbackServerFactory.instance.stopCallbackServer(locator2.getProtocol());
       
       assertTrue(CallbackServerFactory.instance.containsCallbackServer(locator2.getProtocol()));
       
-      CallbackServerFactory.instance.returnCallbackServer(locator1.getProtocol());
+      CallbackServerFactory.instance.stopCallbackServer(locator1.getProtocol());
       
       assertFalse(CallbackServerFactory.instance.containsCallbackServer(locator1.getProtocol()));
       
-      CallbackServerFactory.instance.returnCallbackServer(locator2.getProtocol());
+      CallbackServerFactory.instance.stopCallbackServer(locator2.getProtocol());
       
       assertFalse(CallbackServerFactory.instance.containsCallbackServer(locator2.getProtocol()));
       

Modified: trunk/tests/src/org/jboss/test/messaging/jms/JMSTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/JMSTest.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/tests/src/org/jboss/test/messaging/jms/JMSTest.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -29,10 +29,12 @@
 import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
+import javax.jms.Message;
 import javax.naming.InitialContext;
 
 import org.jboss.test.messaging.MessagingTestCase;
 import org.jboss.test.messaging.tools.ServerManagement;
+import EDU.oswego.cs.dl.util.concurrent.Slot;
 
 /**
  * The most comprehensive, yet simple, unit test.
@@ -47,7 +49,7 @@
    // Constants -----------------------------------------------------
 
    // Static --------------------------------------------------------
-   
+
    // Attributes ----------------------------------------------------
 
    InitialContext ic;
@@ -66,9 +68,9 @@
       super.setUp();
 
       ServerManagement.start("all");
-           
+
       ic = new InitialContext(ServerManagement.getJNDIEnvironment());
-      
+
       ServerManagement.deployQueue("JMSTestQueue");
 
       log.debug("setup done");
@@ -189,7 +191,60 @@
       conn.close();
    }
 
+   public void test_NonPersistent_NonTransactional_Asynchronous_to_Client() throws Exception
+   {
+      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
 
+      Queue queue = (Queue)ic.lookup("/queue/JMSTestQueue");
+
+      Connection conn = cf.createConnection();
+
+      Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+      final MessageConsumer cons = session.createConsumer(queue);
+
+      conn.start();
+
+      final Slot slot = new Slot();
+
+      new Thread(new Runnable()
+      {
+         public void run()
+         {
+            try
+            {
+               Message m = cons.receive(5000);
+               if (m != null)
+               {
+                  slot.put(m);
+               }
+            }
+            catch(Exception e)
+            {
+               log.error("receive failed", e);
+            }
+
+         }
+      }, "Receiving Thread").start();
+
+
+      Thread.sleep(500);
+
+      MessageProducer prod = session.createProducer(queue);
+      prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+
+      TextMessage m = session.createTextMessage("message one");
+
+      prod.send(m);
+
+      TextMessage rm = (TextMessage)slot.poll(5000);
+
+      assertEquals("message one", rm.getText());
+
+      conn.close();
+   }
+
+
    // Package protected ---------------------------------------------
 
    // Protected -----------------------------------------------------

Modified: trunk/tests/src/org/jboss/test/messaging/jms/TransactedSessionTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/TransactedSessionTest.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/tests/src/org/jboss/test/messaging/jms/TransactedSessionTest.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -458,16 +458,11 @@
             conn.close();
          }
       }
-
    }
 
-
-
-   
-
-   
-   
-   /** Make sure redelivered flag is set on redelivery via rollback*/
+   /**
+    * Make sure redelivered flag is set on redelivery via rollback
+    */
    public void testRedeliveredQueue() throws Exception
    {
       Connection conn = null;
@@ -509,9 +504,119 @@
       }
 
    }
-   
-  
-   
+
+   /**
+    * Make sure redelivered flag is set on redelivery via rollback, different setup: we close the
+    * rolled back session and we receive the message whose acknowledgment was cancelled on a new
+    * session.
+    */
+   public void testRedeliveredQueue2() throws Exception
+   {
+      Connection conn = null;
+
+      try
+      {
+         conn = cf.createConnection();
+
+         Session sendSession = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         MessageProducer prod = sendSession.createProducer(queue);
+         prod.send(sendSession.createTextMessage("a message"));
+
+         log.debug("Message was sent to the queue");
+
+         conn.close();
+
+         conn = cf.createConnection();
+         Session sess = conn.createSession(true, Session.SESSION_TRANSACTED);
+
+         MessageConsumer cons = sess.createConsumer(queue);
+
+         conn.start();
+
+         TextMessage tm = (TextMessage)cons.receive();
+
+         assertEquals("a message", tm.getText());
+         assertFalse(tm.getJMSRedelivered());
+
+         sess.rollback();
+         sess.close();
+
+         Session sess2 = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         cons = sess2.createConsumer(queue);
+
+         tm = (TextMessage)cons.receive();
+
+         assertEquals("a message", tm.getText());
+         assertTrue(tm.getJMSRedelivered());
+      }
+      finally
+      {
+         if (conn != null)
+         {
+            conn.close();
+         }
+      }
+   }
+
+   /**
+    * Make sure redelivered flag is set on redelivery via rollback, different setup: we don't close
+    * the rolled back session and we receive the message whose acknowledgment was cancelled on a new
+    * session.
+    *
+    * TODO: Is this test semantically correct.
+    */
+   public void testRedeliveredQueue3() throws Exception
+   {
+      Connection conn = null;
+
+      try
+      {
+         conn = cf.createConnection();
+
+         Session sendSession = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         MessageProducer prod = sendSession.createProducer(queue);
+         prod.send(sendSession.createTextMessage("a message"));
+
+         log.debug("Message was sent to the queue");
+
+         conn.close();
+
+         conn = cf.createConnection();
+         Session sess = conn.createSession(true, Session.SESSION_TRANSACTED);
+
+         MessageConsumer cons = sess.createConsumer(queue);
+
+         conn.start();
+
+         TextMessage tm = (TextMessage)cons.receive();
+
+         assertEquals("a message", tm.getText());
+         assertFalse(tm.getJMSRedelivered());
+
+         sess.rollback();
+
+         Session sess2 = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         cons = sess2.createConsumer(queue);
+
+         tm = (TextMessage)cons.receive(3000);
+
+         assertEquals("a message", tm.getText());
+         assertTrue(tm.getJMSRedelivered());
+      }
+      finally
+      {
+         if (conn != null)
+         {
+            conn.close();
+         }
+      }
+   }
+
+
    public void testReceivedRollbackQueue() throws Exception
    {
       Connection conn = cf.createConnection();

Modified: trunk/tests/src/org/jboss/test/messaging/jms/server/DestinationManagerTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/server/DestinationManagerTest.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/tests/src/org/jboss/test/messaging/jms/server/DestinationManagerTest.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -84,7 +84,7 @@
       super.tearDown();
    }
 
-   public void testCreateQueue() throws Exception
+   public void testDeployQueue() throws Exception
    {
       String name = "testQueue";
 
@@ -95,7 +95,7 @@
       assertEquals(name, q.getQueueName());
    }
 
-   public void testCreateTopic() throws Exception
+   public void testDeployTopic() throws Exception
    {
       String name = "testQueue";
 
@@ -106,7 +106,7 @@
       assertEquals(name, t.getTopicName());
    }
 
-   public void testCreateQueueDifferentJNDIName() throws Exception
+   public void testDeployQueueDifferentJNDIName() throws Exception
    {
       String name = "testQueue";
       String jndiName = "/a/b/c/testQueue2";
@@ -117,7 +117,7 @@
       assertEquals(name, q.getQueueName());
    }
 
-   public void testCreateQueueDifferentJNDIName2() throws Exception
+   public void testDeployQueueDifferentJNDIName2() throws Exception
    {
       String name = "testQueue";
       String jndiName = "testQueue";
@@ -129,7 +129,7 @@
    }
 
 
-   public void testCreateTopicDifferrentJNDIName() throws Exception
+   public void testDeployTopicDifferrentJNDIName() throws Exception
    {
       String name = "testTopic";
       String jndiName = "/a/b/c/testTopic2";
@@ -140,7 +140,7 @@
       assertEquals(name, t.getTopicName());
    }
 
-   public void testCreateDuplicateQueue() throws Exception
+   public void testDeployDuplicateQueue() throws Exception
    {
       String name = "testQueue";
 
@@ -157,7 +157,7 @@
       }
    }
 
-   public void testCreateDuplicateTopic() throws Exception
+   public void testDeployDuplicateTopic() throws Exception
    {
       String name = "testTopic";
 
@@ -174,7 +174,7 @@
       }
    }
 
-   public void testCreateDuplicateQueueDifferentJNDIName() throws Exception
+   public void testDeployDuplicateQueueDifferentJNDIName() throws Exception
    {
       String name = "testQueue";
 
@@ -192,7 +192,7 @@
       }
    }
 
-   public void testCreateDuplicateTopicDifferentJNDIName() throws Exception
+   public void testDeployDuplicateTopicDifferentJNDIName() throws Exception
    {
       String name = "testTopic";
 
@@ -209,7 +209,7 @@
       }
    }
 
-   public void testCreateQueueAndTopicWithTheSameName() throws Exception
+   public void testDeployQueueAndTopicWithTheSameName() throws Exception
    {
       String name = "SomeName";
 
@@ -224,18 +224,8 @@
       assertEquals(name, t.getTopicName());
    }
 
-   public void testDestroyInexistentQueue() throws Exception
+   public void testUndeployQueue() throws Exception
    {
-      ServerManagement.undeployQueue("there is not such a queue");
-   }
-
-   public void testDestroyInexistentTopic() throws Exception
-   {
-      ServerManagement.undeployTopic("there is not such a topic");
-   }
-
-   public void testDestroyQueue() throws Exception
-   {
       String name = "testQueue";
 
       ServerManagement.deployQueue(name, null);
@@ -246,8 +236,6 @@
 
       ServerManagement.undeployQueue(name);
 
-      //assertNull(((DestinationManager)destinationManager).getCoreDestination(q));
-
       try
       {
          Object o = initialContext.lookup(ServerManagement.DEFAULT_QUEUE_CONTEXT + "/" + name);
@@ -259,7 +247,7 @@
       }
    }
 
-   public void testDestroyTopic() throws Exception
+   public void testUndeployTopic() throws Exception
    {
       String name = "testTopic";
 
@@ -271,8 +259,6 @@
 
       ServerManagement.undeployTopic(name);
 
-      //assertNull(((DestinationManager)destinationManager).getCoreDestination(t));
-
       try
       {
          Object o = initialContext.lookup(ServerManagement.DEFAULT_TOPIC_CONTEXT + "/" + name);
@@ -284,6 +270,106 @@
       }
    }
 
+   public void testCreateQueueProgramatically() throws Exception
+   {
+      String name = "SomeQueue";
+
+      ServerManagement.createQueue(name, null);
+      Queue q = (Queue)initialContext.lookup(ServerManagement.DEFAULT_QUEUE_CONTEXT + "/" + name);
+
+      assertEquals(name, q.getQueueName());
+   }
+
+   public void testCreateTopicProgramatically() throws Exception
+   {
+      String name = "SomeTopic";
+
+      ServerManagement.createTopic(name, null);
+      Topic t = (Topic)initialContext.lookup(ServerManagement.DEFAULT_TOPIC_CONTEXT + "/" + name);
+
+      assertEquals(name, t.getTopicName());
+   }
+
+   public void testUndeployInexistentQueue() throws Exception
+   {
+      ServerManagement.undeployQueue("there is not such a queue");
+   }
+
+   public void testUndeployInexistentTopic() throws Exception
+   {
+      ServerManagement.undeployTopic("there is not such a topic");
+   }
+
+   public void testDestroyQueue() throws Exception
+   {
+      String name = "AnotherQueue";
+      ServerManagement.createQueue(name, null);
+      assertTrue(ServerManagement.destroyQueue(name));
+
+      try
+      {
+         initialContext.lookup(ServerManagement.DEFAULT_QUEUE_CONTEXT + "/" + name);
+         fail("should have failed");
+      }
+      catch(NameNotFoundException e)
+      {
+         // OK
+      }
+   }
+
+   public void testDestroyTopic() throws Exception
+   {
+      String name = "AnotherTopic";
+      ServerManagement.createTopic(name, null);
+      assertTrue(ServerManagement.destroyTopic(name));
+
+      try
+      {
+         initialContext.lookup(ServerManagement.DEFAULT_TOPIC_CONTEXT + "/" + name);
+         fail("should have failed");
+      }
+      catch(NameNotFoundException e)
+      {
+         // OK
+      }
+   }
+
+   public void testDestroyInexistentQueue() throws Exception
+   {
+      assertFalse(ServerManagement.destroyQueue("NoSuchQueue"));
+   }
+
+   public void testDestroyInexistentTopic() throws Exception
+   {
+      assertFalse(ServerManagement.destroyTopic("NoSuchTopic"));
+   }
+
+   public void testDestroyDeployedQueue() throws Exception
+   {
+      String name = "ADeployedQueue";
+      ServerManagement.deployQueue(name, null);
+      assertFalse(ServerManagement.destroyQueue("ADeployedQueue"));
+
+      // the queue must not be destroyed
+
+      Queue q = (Queue)initialContext.lookup(ServerManagement.DEFAULT_QUEUE_CONTEXT + "/" + name);
+      assertEquals(name, q.getQueueName());
+   }
+
+   public void testDestroyDeployedTopic() throws Exception
+   {
+      String name = "ADeployedTopic";
+      ServerManagement.deployTopic(name, null);
+      assertFalse(ServerManagement.destroyTopic("ADeployedTopic"));
+
+      // the queue must not be destroyed
+
+      Topic q = (Topic)initialContext.lookup(ServerManagement.DEFAULT_TOPIC_CONTEXT + "/" + name);
+      assertEquals(name, q.getTopicName());      
+   }
+
+
+
    // Package protected ---------------------------------------------
    
    // Protected -----------------------------------------------------

Modified: trunk/tests/src/org/jboss/test/messaging/jms/server/destination/QueueManagementTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/server/destination/QueueManagementTest.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/tests/src/org/jboss/test/messaging/jms/server/destination/QueueManagementTest.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -226,7 +226,53 @@
          ServerManagement.undeployQueue("QueueMessageCount");
       }
    }
-   
+
+   public void testMessageCountOverFullSize() throws Exception
+   {
+      InitialContext ic = new InitialContext(ServerManagement.getJNDIEnvironment());
+      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
+      Connection conn = null;
+
+      int fullSize = 10;
+
+      ServerManagement.deployQueue("QueueMessageCount2", fullSize, fullSize / 2, fullSize / 2 - 1);
+
+      ObjectName destObjectName =
+         new ObjectName("jboss.messaging.destination:service=Queue,name=QueueMessageCount2");
+
+      try
+      {
+         Queue queue = (Queue)ic.lookup("/queue/QueueMessageCount2");
+
+         conn = cf.createConnection();
+         Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer prod = session.createProducer(queue);
+         prod.setDeliveryMode(DeliveryMode.PERSISTENT);
+
+         // Send 20 message to the queue
+
+         for(int i = 0; i < 20; i++)
+         {
+            TextMessage m = session.createTextMessage("message" + i);
+            prod.send(m);
+         }
+
+         int mc =
+            ((Integer)ServerManagement.getAttribute(destObjectName, "MessageCount")).intValue();
+
+         assertEquals(20, mc);
+      }
+      finally
+      {
+         ServerManagement.undeployQueue("QueueMessageCount2");
+
+         if (conn != null)
+         {
+            conn.close();
+         }
+      }
+   }
+
    // TODO this test should be done in DestinationManagementTestBase, once implemented in Topic
    // TODO this only tests reliable non-tx messages
    public void testRemoveAllMessages() throws Exception

Modified: trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -368,79 +368,157 @@
       return server.getDefaultSecurityConfig();
    }
 
+   /**
+    * Simulates a topic deployment (copying the topic descriptor in the deploy directory).
+    */
    public static void deployTopic(String name) throws Exception
    {
       deployTopic(name, null);
    }
 
+   /**
+    * Simulates a topic deployment (copying the topic descriptor in the deploy directory).
+    */
    public static void deployTopic(String name, String jndiName) throws Exception
    {
       insureStarted();
       server.deployTopic(name, jndiName);
    }
 
-   public static void deployQueue(String name) throws Exception
+   /**
+    * Simulates a topic deployment (copying the topic descriptor in the deploy directory).
+    */
+   public static void deployTopic(String name, int fullSize, int pageSize, int downCacheSize)
+      throws Exception
    {
-      deployQueue(name, null);
+      deployTopic(name, null, fullSize, pageSize, downCacheSize);
    }
 
-   public static void deployQueue(String name, String jndiName) throws Exception
+   /**
+    * Simulates a topic deployment (copying the topic descriptor in the deploy directory).
+    */
+   public static void deployTopic(String name, String jndiName, int fullSize, int pageSize,
+                                  int downCacheSize) throws Exception
    {
       insureStarted();
-      server.deployQueue(name, jndiName);
+      server.deployTopic(name, jndiName, fullSize, pageSize, downCacheSize);
    }
-   
-   public static void deployTopic(String name, int fullSize, int pageSize, int downCacheSize) throws Exception
+
+   /**
+    * Simulates a topic un-deployment (deleting the topic descriptor from the deploy directory).
+    */
+   public static void undeployTopic(String name) throws Exception
    {
-      deployTopic(name, null, fullSize, pageSize, downCacheSize);
+      undeployDestination(false, name);
    }
 
-   public static void deployTopic(String name, String jndiName, int fullSize, int pageSize, int downCacheSize) throws Exception
+   /**
+    * Creates a topic programatically.
+    */
+   public static void createTopic(String name, String jndiName) throws Exception
    {
       insureStarted();
-      server.deployTopic(name, jndiName, fullSize, pageSize, downCacheSize);
+      server.createTopic(name, jndiName);
    }
 
-   public static void deployQueue(String name, int fullSize, int pageSize, int downCacheSize) throws Exception
+   /**
+    * Destroys a programatically created topic.
+    */
+   public static boolean destroyTopic(String name) throws Exception
    {
+      return server.destroyDestination(false, name);
+   }
+
+   /**
+    * Simulates a queue deployment (copying the queue descriptor in the deploy directory).
+    */
+   public static void deployQueue(String name) throws Exception
+   {
+      deployQueue(name, null);
+   }
+
+   /**
+    * Simulates a queue deployment (copying the queue descriptor in the deploy directory).
+    */
+   public static void deployQueue(String name, String jndiName) throws Exception
+   {
+      insureStarted();
+      server.deployQueue(name, jndiName);
+   }
+
+   /**
+    * Simulates a queue deployment (copying the queue descriptor in the deploy directory).
+    */
+   public static void deployQueue(String name, int fullSize, int pageSize, int downCacheSize)
+      throws Exception
+   {
       deployQueue(name, null, fullSize, pageSize, downCacheSize);
    }
 
-   public static void deployQueue(String name, String jndiName, int fullSize, int pageSize, int downCacheSize) throws Exception
+   /**
+    * Simulates a queue deployment (copying the queue descriptor in the deploy directory).
+    */
+   public static void deployQueue(String name, String jndiName, int fullSize, int pageSize,
+                                  int downCacheSize) throws Exception
    {
       insureStarted();
       server.deployQueue(name, jndiName, fullSize, pageSize, downCacheSize);
    }
 
+   /**
+    * Simulates a queue un-deployment (deleting the queue descriptor from the deploy directory).
+    */
    public static void undeployQueue(String name) throws Exception
    {
       undeployDestination(true, name);
    }
 
-   public static void undeployTopic(String name) throws Exception
+   /**
+    * Creates a queue programatically.
+    */
+   public static void createQueue(String name, String jndiName) throws Exception
    {
-      undeployDestination(false, name);
+      insureStarted();
+      server.createQueue(name, jndiName);
    }
 
+   /**
+    * Destroys a programatically created queue.
+    */
+   public static boolean destroyQueue(String name) throws Exception
+   {
+      return server.destroyDestination(true, name);
+   }
+
+   /**
+    * Simulates a destination un-deployment (deleting the destination descriptor from the deploy
+    * directory).
+    */
    private static void undeployDestination(boolean isQueue, String name) throws Exception
    {
       insureStarted();
       server.undeployDestination(isQueue, name);
    }
-   
+
    public static void deployConnectionFactory(String objectName,
-                                             String[] jndiBindings, int prefetchSize,
-                                             int defaultTempQueueFullSize,
-                                             int defaultTempQueuePageSize,
-                                             int defaultTempQueueDownCacheSize)
-   throws Exception
+                                              String[] jndiBindings,
+                                              int prefetchSize,
+                                              int defaultTempQueueFullSize,
+                                              int defaultTempQueuePageSize,
+                                              int defaultTempQueueDownCacheSize)
+      throws Exception
    {
-      server.deployConnectionFactory(objectName, jndiBindings, prefetchSize,
-             defaultTempQueueFullSize, defaultTempQueuePageSize, defaultTempQueueDownCacheSize);
+      server.deployConnectionFactory(objectName,
+                                     jndiBindings,
+                                     prefetchSize,
+                                     defaultTempQueueFullSize,
+                                     defaultTempQueuePageSize,
+                                     defaultTempQueueDownCacheSize);
    }
 
    public static void deployConnectionFactory(String objectName,
-                                              String[] jndiBindings, int prefetchSize)
+                                              String[] jndiBindings,
+                                              int prefetchSize)
       throws Exception
    {
       server.deployConnectionFactory(objectName, jndiBindings, prefetchSize);

Modified: trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -489,25 +489,40 @@
          getAttribute(serverPeerObjectName, "Instance");
    }
 
-
    public void deployTopic(String name, String jndiName) throws Exception
    {
       deployDestination(false, name, jndiName);
    }
 
+   public void deployTopic(String name, String jndiName, int fullSize, int pageSize,
+                           int downCacheSize) throws Exception
+   {
+      deployDestination(false, name, jndiName, fullSize, pageSize, downCacheSize);
+   }
+
+   public void createTopic(String name, String jndiName) throws Exception
+   {
+      sc.invoke(serverPeerObjectName, "createTopic",
+                new Object[] { name, jndiName },
+                new String[] { "java.lang.String", "java.lang.String"} );
+   }
+
    public void deployQueue(String name, String jndiName) throws Exception
    {
       deployDestination(true, name, jndiName);
    }
    
-   public void deployTopic(String name, String jndiName, int fullSize, int pageSize, int downCacheSize) throws Exception
+   public void deployQueue(String name, String jndiName, int fullSize, int pageSize,
+                           int downCacheSize) throws Exception
    {
-      deployDestination(false, name, jndiName, fullSize, pageSize, downCacheSize);
+      deployDestination(true, name, jndiName, fullSize, pageSize, downCacheSize);
    }
 
-   public void deployQueue(String name, String jndiName, int fullSize, int pageSize, int downCacheSize) throws Exception
+   public void createQueue(String name, String jndiName) throws Exception
    {
-      deployDestination(true, name, jndiName, fullSize, pageSize, downCacheSize);
+      sc.invoke(serverPeerObjectName, "createQueue",
+                new Object[] { name, jndiName },
+                new String[] { "java.lang.String", "java.lang.String"} );
    }
 
    public void deployDestination(boolean isQueue, String name, String jndiName) throws Exception
@@ -527,7 +542,12 @@
       sc.invoke(deston, "start", new Object[0], new String[0]);
    }
    
-   public void deployDestination(boolean isQueue, String name, String jndiName, int fullSize, int pageSize, int downCacheSize) throws Exception
+   public void deployDestination(boolean isQueue,
+                                 String name,
+                                 String jndiName,
+                                 int fullSize,
+                                 int pageSize,
+                                 int downCacheSize) throws Exception
    {
       log.info("deploying queue, fullsize:" + fullSize + ", ps:" + pageSize + " dc size:" + downCacheSize);
       
@@ -569,8 +589,23 @@
       sc.invoke(destinationObjectName, "destroy", new Object[0], new String[0]);
       sc.unregisterService(destinationObjectName);
    }
-   
-   
+
+   public boolean destroyDestination(boolean isQueue, String name) throws Exception
+   {
+      if (isQueue)
+      {
+         return  ((Boolean)sc.invoke(serverPeerObjectName, "destroyQueue",
+                                    new Object[] { name },
+                                    new String[] { "java.lang.String"})).booleanValue();
+      }
+      else
+      {
+         return  ((Boolean)sc.invoke(serverPeerObjectName, "destroyTopic",
+                                    new Object[] { name },
+                                    new String[] { "java.lang.String"})).booleanValue();
+      }
+   }
+
    public void deployConnectionFactory(String objectName,
                                        String[] jndiBindings,
                                        int prefetchSize) throws Exception

Modified: trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/RMITestServer.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/RMITestServer.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/RMITestServer.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -135,32 +135,52 @@
       server.deployTopic(name, jndiName);
    }
    
-   public void deployQueue(String name, String jndiName, int fullSize, int pageSize, int downCacheSize) throws Exception
+   public void deployQueue(String name,
+                           String jndiName,
+                           int fullSize,
+                           int pageSize,
+                           int downCacheSize) throws Exception
    {
       server.deployQueue(name, jndiName, fullSize, pageSize, downCacheSize);
    }
 
-   public void deployTopic(String name, String jndiName, int fullSize, int pageSize, int downCacheSize) throws Exception
+   public void createQueue(String name, String jndiName) throws Exception
    {
+      server.createQueue(name, jndiName);
+   }
+
+   public void deployTopic(String name,
+                           String jndiName,
+                           int fullSize,
+                           int pageSize,
+                           int downCacheSize) throws Exception
+   {
       server.deployTopic(name, jndiName, fullSize, pageSize, downCacheSize);
    }
 
-   public void deployConnectionFactory(String objectName, String[] jndiBindings) throws Exception
+   public void createTopic(String name, String jndiName) throws Exception
    {
+      server.createTopic(name, jndiName);
+   }
+
+   public void deployConnectionFactory(String objectName, String[] jndiBindings)
+      throws Exception
+   {
       server.deployConnectionFactory(objectName, jndiBindings);
    }
    
-   public void deployConnectionFactory(String objectName, String[] jndiBindings, int prefetchSize) throws Exception
+   public void deployConnectionFactory(String objectName, String[] jndiBindings, int prefetchSize)
+      throws Exception
    {
       server.deployConnectionFactory(objectName, jndiBindings, prefetchSize);
    }
-   
+
    public void deployConnectionFactory(String objectName,
-            String[] jndiBindings,
-            int prefetchSize,
-            int defaultTempQueueFullSize,
-            int defaultTempQueuePageSize,
-            int defaultTempQueueDownCacheSize) throws Exception
+                                       String[] jndiBindings,
+                                       int prefetchSize,
+                                       int defaultTempQueueFullSize,
+                                       int defaultTempQueuePageSize,
+                                       int defaultTempQueueDownCacheSize) throws Exception
    {
       server.deployConnectionFactory(objectName, jndiBindings, prefetchSize,
                defaultTempQueueFullSize, defaultTempQueuePageSize, defaultTempQueueDownCacheSize);
@@ -314,6 +334,11 @@
       server.undeployDestination(isQueue, name);
    }
 
+   public boolean destroyDestination(boolean isQueue, String name) throws Exception
+   {
+      return server.destroyDestination(isQueue, name);
+   }
+
    public Object executeCommand(Command command) throws Exception
    {
       return server.executeCommand(command);

Modified: trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/Server.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/Server.java	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/Server.java	2006-08-31 19:22:33 UTC (rev 1245)
@@ -130,23 +130,63 @@
     */
    ServerPeer getServerPeer() throws Exception;
 
+   /**
+    * Simulates a topic deployment (copying the topic descriptor in the deploy directory).
+    */
    void deployTopic(String name, String jndiName) throws Exception;
+
+   /**
+    * Simulates a topic deployment (copying the topic descriptor in the deploy directory).
+    */
+   void deployTopic(String name, String jndiName, int fullSize, int pageSize,
+                    int downCacheSize) throws Exception;
+
+   /**
+    * Creates a topic programatically.
+    */
+   void createTopic(String name, String jndiName) throws Exception;
+
+   /**
+    * Simulates a queue deployment (copying the queue descriptor in the deploy directory).
+    */
    void deployQueue(String name, String jndiName) throws Exception;
-   void deployTopic(String name, String jndiName, int fullSize, int pageSize, int downCacheSize) throws Exception;
-   void deployQueue(String name, String jndiName, int fullSize, int pageSize, int downCacheSize) throws Exception;
+
+   /**
+    * Simulates a queue deployment (copying the queue descriptor in the deploy directory).
+    */
+   void deployQueue(String name, String jndiName, int fullSize, int pageSize,
+                    int downCacheSize) throws Exception;
+
+   /**
+    * Creates a queue programatically.
+    */
+   void createQueue(String name, String jndiName) throws Exception;
+
+   /**
+    * Simulates a destination un-deployment (deleting the destination descriptor from the deploy
+    * directory).
+    */
    void undeployDestination(boolean isQueue, String name) throws Exception;
 
+   /**
+    * Destroys a programatically created destination.
+    */
+   boolean destroyDestination(boolean isQueue, String name) throws Exception;
+
    void deployConnectionFactory(String objectName,
             String[] jndiBindings,
             int prefetchSize,
             int defaultTempQueueFullSize,
             int defaultTempQueuePageSize,
             int defaultTempQueueDownCacheSize) throws Exception;
+
    void deployConnectionFactory(String objectName,
                                 String[] jndiBindings,
                                 int prefetchSize) throws Exception;
+
    void deployConnectionFactory(String objectName,
-                                String[] jndiBindings) throws Exception;   
+                                String[] jndiBindings) throws Exception;
+
    void undeployConnectionFactory(ObjectName objectName) throws Exception;
 
    /**

Modified: trunk/util/release-admin.xml
===================================================================
--- trunk/util/release-admin.xml	2006-08-31 18:11:07 UTC (rev 1244)
+++ trunk/util/release-admin.xml	2006-08-31 19:22:33 UTC (rev 1245)
@@ -270,6 +270,7 @@
       </replaceregexp>
 
       <!-- mute org.jboss.serial DEBUG -->
+
       <replaceregexp file="${jboss.home}/server/${standalone.messaging.config.name}/conf/log4j.xml" flags="s">
          <regexp pattern="(\x3croot\x3e)"/>
          <substitution expression="&lt;category name=&quot;org.jboss.serial&quot;&gt;&#013;&#010;      &lt;priority value=&quot;INFO&quot;/&gt;&#013;&#010;   &lt;/category&gt;&#013;&#010;&#013;&#010;   \1"/>
@@ -299,6 +300,7 @@
 
       <move todir="${jboss.home}/server/${standalone.messaging.config.name}/lib">
          <fileset dir="${jboss.home}/server/${standalone.messaging.config.name}/deploy/jboss-messaging">
+            <include name="jboss-messaging.jar"/>
             <include name="javassist.jar"/>
             <include name="jboss-aop.jar"/>
             <include name="jboss-aspect-library.jar"/>
@@ -311,31 +313,21 @@
          </fileset>
       </move>
 
-      <jar jarfile="${jboss.home}/server/${standalone.messaging.config.name}/deploy/jboss-messaging/jboss-messaging.jar"
-           manifest="${jboss.home}/server/${standalone.messaging.config.name}/deploy/jboss-messaging/META-INF/MANIFEST.MF">
-         <fileset dir="${jboss.home}/server/${standalone.messaging.config.name}/deploy/jboss-messaging" includes="org/**,VERSION,aop-messaging*.xml"/>
-      </jar>
-      <delete>
-         <fileset dir="${jboss.home}/server/${standalone.messaging.config.name}/deploy/jboss-messaging">
-            <include name="VERSION"/>
-            <include name="aop-messaging*.xml"/>
-         </fileset>
-      </delete>
-      <delete dir="${jboss.home}/server/${standalone.messaging.config.name}/deploy/jboss-messaging/org"/>
-      <delete dir="${jboss.home}/server/${standalone.messaging.config.name}/deploy/jboss-messaging/META-INF"/>
-      <move file="${jboss.home}/server/${standalone.messaging.config.name}/deploy/jboss-messaging/jboss-messaging.jar"
-            todir="${jboss.home}/server/${standalone.messaging.config.name}/lib"/>
-      <move todir="${jboss.home}/server/${standalone.messaging.config.name}/conf/xmdesc">
-         <fileset dir="${jboss.home}/server/${standalone.messaging.config.name}/deploy/jboss-messaging/xmdesc">
-            <include name="*.xml"/>
-         </fileset>
-      </move>
+      <unjar src="${jboss.home}/server/${standalone.messaging.config.name}/lib/jboss-messaging.jar"
+             dest="${jboss.home}/server/${standalone.messaging.config.name}/conf">
+         <patternset>
+            <include name="xmdesc/**"/>
+         </patternset>
+      </unjar>
+
       <move todir="${jboss.home}/server/${standalone.messaging.config.name}/conf">
          <fileset dir="${jboss.home}/server/${standalone.messaging.config.name}/deploy/jboss-messaging">
             <include name="messaging-*.properties"/>
          </fileset>
       </move>
+
       <delete dir="${jboss.home}/server/${standalone.messaging.config.name}/deploy/jboss-messaging/xmdesc"/>
+      <delete dir="${jboss.home}/server/${standalone.messaging.config.name}/deploy/jboss-messaging/META-INF"/>
       <delete file="${jboss.home}/server/${standalone.messaging.config.name}/deploy/jboss-messaging/jms-ds.xml"/>
 
    </target>




More information about the jboss-cvs-commits mailing list