users@glassfish.java.net

Re: howto: message-destination-ref to assign factory and queue to Session b

From: <glassfish_at_javadesktop.org>
Date: Tue, 06 Nov 2007 19:35:06 PST

> If mappedName corresponds to <jndi-name>, what
> corresponds to the ref-name?

name. For example, @Resource(name="jms/my-connection-factory")

>
> Yes, I am confused. I thought the mapped name was
> getting looked up and substituted with the jndi-name.
> i.e
> http://java.sun.com/javase/6/docs/api/javax/annotatio
> /Resource.html Is that not the case?
>
> I need the [i]sun-ejb-jar.xml[/i] because I need to
> deploy several copies of my bean, each using a
> different connection factory and queue.
>
> Message was edited by: frenchdrip

@Resource(name = "zzz") //mappedName => name
private ConnectionFactory connectionFactory;

@Resource(name = "yyy")
private Queue queue;

In your sun-ejb-jar.xml, you can then map the reference name to their global <jndi-name> for each EJB.

BTW, If you want to deploy several copies of EJB using the same bean class, you will also need ejb-jar.xml to declare these beans.

-cheng
[Message sent by forum member 'cf126330' (cf126330)]

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