One approach would be to define a well-known JMS destination for the swing client. That would eliminate the discovery problem but would require the use of JMS instead of RMI.
Sharing a dynamic handle within the EJB tier, whether that handle is a temporary JMS destination or an RMI object, is not supported well in the current spec. There isn't a clean way to share state either between multiple instances of a bean or between bean components themselves. It's something we're planning to address in the next EJB spec by adding a Singleton component. (More info on EJB 3.1 here :
http://blogs.sun.com/kensaks/entry/ejb_3_1_early_draft ). Right now most developers just use static data members to achieve this.
--ken
[Message sent by forum member 'ksak' (ksak)]
http://forums.java.net/jive/thread.jspa?messageID=265020