2 Replies Latest reply on Aug 17, 2004 5:55 AM by ralf.siedow

    JCA und MDB understanding

    ralf.siedow

      Hello,

      I'm trying to implement a JCA RA which receives events (not necesserily JMS; I'd like to abstract that part in the RA) and forwards them to a MDB that delegates these events to other EJBs. Eventually I'd like to put a WorkManager in between.

      My problem is that I don't get an idea how the MDBs, the Endpoints (incl. Factories) and the RA are glued together. Until now I have the following assumptions in my mind:
      - Implement a MDB (with my custom MessageListener Interface)
      - Implement the ResourceAdapter Interface ( endpoint(De)Activiation(...) - Methods)
      - Implement the MessageEndpoint
      - Implement the MessageEndpointFactory

      - When a message arrives the following steps are performend:
      * Use the reference of the MEFactory to obtain a ME (MessageEndpoint)
      * deliver the event via the onMessage - method to the ME
      * The ME forwards the message to a MDB instance

      How does the ME get the reference to a MDB?

      I guess I'm thinking in the totally wrong direction ... any tips/hints?

      Thanks,
      Ralf

        • 1. Re: JCA und MDB understanding
          ralf.siedow

          Btw, I'm refering to EJB 2.1 and JCA 1.5. I'm using JBoss 4.0.0RC1

          • 2. Re: JCA und MDB understanding
            ralf.siedow

            What I'm wondering about is the cast to of endpoint to JavaMailMessageListener because JMMListener isn't in the type hierarchy. I took this example from the SUN Appserver.

            class samples.connectors.inbound.ra.EndpointConsumerImpl, lline 125:
            if ( (endpoint = endpointFactory.createEndpoint(null)) != null)
            {
            //If this was an XA able RA then invoke: endpoint.beforeDelivery();
            ((samples.connectors.inbound.api.JavaMailMessageListener) endpoint).onMessage(message);
            }