1 Reply Latest reply on Mar 29, 2005 10:52 PM by ovidiu.feodorov

    JBossConnection and JBossConnectionFactory

    timfox

      Hi All-

      I've been having a look at JIRA tasks 32 and 33:
      "Modify org.jboss.jms.client.JBossConnectionFactory to implement the complete set of ConnectionFactory interfaces..."
      and
      "Modify org.jboss.jms.client.JBossConnection to implement the complete set of Connection interfaces..."

      Implementing the required interfaces for JBossConnectionFactory seems reasonably straightforward - it seems mainly a matter of casting to QueueConnection/TopicConnection etc.

      For this one I didn't seem to need change any interceptors or the delegate. I'm not sure if I haven't missed something here though.

      JBossConnection seems somewhat more involved. Again, some of the stuff seems just a matter of casting between TopicConnection/QueueConnection, but for the rest I just wanted to check with you that I'm along the right track.

      I ended up adding a member: isXAConnection which is set when constructing the object. (In a similar way to how it's done in JBoss 4). This is then checked in methods like getXASession to check whether the connection represents an XA connection.

      For getMetaData() I think I need to write a simple class that implements ConnectionMetaData.

      For get/setExceptionListener() - this seems a simple matter of just storing the listener in a member.

      For start() and stop(), I'm not really sure where this should be handled and would appreciate a steer in the right direction. I guess I need to implement this in some interceptor(s) but not really sure where.

      For close() I believe the CloseInterceptor() needs to be implemented. I noticed there's one in Jboss4, although I'm not sure if's similar enough to be (partly) re-used?

      There are also a set of createConnectionConsumer() methods. I notice from the spec. that these are optional, and aren't implemented in JBoss 4. Do we need consider these yet? Or should they be left for later? I can just throw NotYetSupportedException if appropriate for now.

      I also noticed in the design docs. that there's a ConnectionInterceptor mentioned although I'm not sure of it's exact role and if it's a place where some of this functionality should be implemented. If someone could clarify it's role and whether it's related to these tasks, that would be great.

      Thanks in advance.

      -Tim

        • 1. Re: JBossConnection and JBossConnectionFactory
          ovidiu.feodorov

           

          For start() and stop(), I'm not really sure where this should be handled and would appreciate a steer in the right direction. I guess I need to implement this in some interceptor(s) but not really sure where.


          I've just ckecked in an incomplete implementation for start()/stop(). It is incomplete in that it doesn't deal with the situation when there are in-flight messages. However, it makes possible writing reasonable good unit tests. Take a look at org.jboss.test.jms.ConnectionTest and org.jboss.test.jms.MessageConsumerTest


          There are also a set of createConnectionConsumer() methods. I notice from the spec. that these are optional, and aren't implemented in JBoss 4. Do we need consider these yet? Or should they be left for later? I can just throw NotYetSupportedException if appropriate for now.


          It's ok if you leave them for later.


          I also noticed in the design docs. that there's a ConnectionInterceptor mentioned although I'm not sure of it's exact role and if it's a place where some of this functionality should be implemented. If someone could clarify it's role and whether it's related to these tasks, that would be great.


          I've also checked in the initial implementation of the ConnectionInterceptor. It deals with getClientID()/setClientID(), to start with. This is also the place to take care of error handling at connectin level (ExceptionListener)..