• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reflection on EJBs

 
Mark Herschberg
Sheriff
Posts: 6037
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I take an EJB class and use reflection to view its methods and fields? I imagine I should be able to do this, because all Java objects should support reflection (yes, technically the support is in the JVM, not the object). This also, I believe this is similar to what many vendor tools do when they automatically generate the EJB home interface, the home object, the deployment descriptor etc.
Two notes:
1) I assume, as with normal reflection, that I can do this on the compiled EJB, i.e. the bytecode I get when I buy an off-the-shelf EJB.
2) I am not doing this at run time. I just want to take an EJB I bought from some third party, and, say, generate a list of its methods.

Am I understanding this right?

--Mark
hershey@vaultus.com
 
Mrigasira Srinivas
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am not sure if I got you right... but we have used reflection in our project to call methods and fields within a bean. What we did was this: we have a class, within which we load the bean class and call the methods of the bean class. This class implements an interface which the remote interface of the bean extends. Is this what you are looking for?
Yamini
Originally posted by Mark Herschberg:
Can I take an EJB class and use reflection to view its methods and fields? I imagine I should be able to do this, because all Java objects should support reflection (yes, technically the support is in the JVM, not the object). This also, I believe this is similar to what many vendor tools do when they automatically generate the EJB home interface, the home object, the deployment descriptor etc.
Two notes:
1) I assume, as with normal reflection, that I can do this on the compiled EJB, i.e. the bytecode I get when I buy an off-the-shelf EJB.
2) I am not doing this at run time. I just want to take an EJB I bought from some third party, and, say, generate a list of its methods.

Am I understanding this right?

--Mark
hershey@vaultus.com

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!