users@glassfish.java.net

Re: create UDP server with glassfish/ejb

From: <glassfish_at_javadesktop.org>
Date: Mon, 17 Sep 2007 12:44:04 PDT

You really cannot access the any JNDI resources inside of the connector directly. The JCA spec mentions that a connector has no JNDI context except in the calling thread of an outbound connection and in the MDB in an inbound connection.

I just did something similar. I created a JCA that has an inbound connector. I have a service that I started and run inside the connector using the WorkManager and Work items. I defined a listener interface and then wrote an MDB the implemented that interface. When I receive a UDP message, I pass the UDP data to the MDB endpoint. Inside the MDB implementation, you do have access to all of the J2EE facilities so inside here, you could post the a message to a JMS queue or topic. Inside the MDB, you can use annotations to get a hold of the JMS resource that you need (ie. connection factory, queue, etc.).
[Message sent by forum member 'bbergquist' (bbergquist)]

http://forums.java.net/jive/thread.jspa?messageID=235689