• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is metadata interface?

 
Ramakrishnan Ponmudi
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is metadata interface? how it is useful.
 
Ramakrishnan Viswanathan
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJBMetaData

The EJBMetaData interface allows a client to obtain the enterprise Bean's meta-data information.

I found the following additional information in some forum:

Question: Still, I don't understand what is the ejbMetaData purpose. Why I can't do it in such way?

Context ctx = getInitialContext();
EJBHome home = (EJBHome) ctx.lookup(...);
Class interface = home.getClass();

Answer:
The reason that you cannot perform a lookup on the home interface
and then use reflection on that is as follows... When you get the Class
from the interface (using getClass), this will actually return the Class
of the Home interface STUB not the home interface itself. Therefore any
attempt to retrieve Methods as they are named in the interface will
throw an exception. To do this properly you must get the interface Class
from the ejbMetaData, introspect this to get the relevant methods, then
invoke them on the remote object reference to the EJB.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic