• Post Reply Bookmark Topic Watch Topic
  • New Topic

mapping jms resource from jpa entity  RSS feed

Jonh Smith
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a jpa entity that has behavior, namely a method to send some message to a JMS queue. Since this entity is running inside a JEE container environment, the JMS specifics are being injected in the entity class itself, like this:

private Destination notifQueue;
private ConnectionFactory connectionFactory;

this entity has a method that uses the resources above, which gets called by the timeout method of a stateless EJB.

Since the resources are defined in the Entity and not in the calling EJB, other than using the [i]mappedName[/i] annotation attribute, where can I define a jndi mapping for these resources ? The ejb deployment descriptor ? persistence.xml ? There seems to be no place in any of them for this use case...

Can anyone help ?

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!