users@glassfish.java.net

Re: get ejb-name of mdb within the bean ?

From: <glassfish_at_javadesktop.org>
Date: Thu, 27 Dec 2007 06:49:19 PST

I don't think it's available for ejbs to find out their own names, but there're a couple of possible solutions to work it around:

- Use getClass().getAnnotation(MessageDriven.class)).name
- Parse ejb-jar.xml file with jaxb or similar - the file is accessible from the classloader the bean is in - getClass().getResourceAsStream("META-INF/ejb-jar.xml")

Jacek
<a href="http://www.JacekLaskowski.pl">http://www.JacekLaskowski.pl</a>
[Message sent by forum member 'jlaskowski' (jlaskowski)]

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