I've submitted a patch to JIRA.
The patch contains:
Completion of JBossConnection with the exception of the connection consumer stuff.
This includes the exception listener set/get stuff which I am intercepting in the ConnectionInterceptor and storing in meta data. I haven't added the code that actually catches exceptions on the connection and sends them to the listener. I notice that this doesn't seem to be implemented in Spy anyway.
The ClosedInterceptor is also implemented and I've added a Hierarchy interceptor to maintain the Connection->Session->Producer/Consumer hierarchy.
JBossMessageProducer is also fully implemented with the exception of get/set TimeToLive and get/set Priority. They seem trivial to implement but I guess there might be a catch here so I've left them for now.
JBossSession is also implemented with the exception of the different createMessage methods, the get/set MessageListener, the run() method, durable subscriber stuff, temporary destinations, and browser stuff.
This includes transacted session stuff although the implementation is incomplete. So far I have transacted message sends only. This has been done by implementing the TransactionInterceptor and a ResourceManager and associated classes. The ResourceManager keeps the map of Xid to transactions.
This is reasonably similar to how it's done in Spy MQ, except I'm using an interceptor. It's not XA capable yet.
Currently the ResourceManager is a Singleton - I'm conscious this probably needs to be scoped per Connection.
I have some queries regarding which interceptors to put the logic in. For now I've used the TransactionInterceptor but I'm not sure whether I should put the logic in the session interceptor. There is a poissbility this needs to be refactored.
I haven't implemented transacted acks yet. I have some questions about how to do this on previous threads in the forum.
I've also added quite a few more tests to test the new functionality, and validated that the unit test suite runs fine still.
The patch updates the following files:
And contains the following new files:
I've uploaded the patch to JIRA task JBMESSAGING-34 since that's the best message.
It also affects JBMESSAGING-37 (MesageConsumer) and JBMESSAGING-36 (MessageProducer), since some of the stuff is inextricably linked.