Who needs EJBMetaData when you’ve got reflection?

Local clients don’t need EJBMetaData!

With the Java reflection API, you can interrogate an object to get all sorts of information about its class. With Remote objects, you don’t have that option, because you can’t get a reference to the class of the Remote object. The only thing you can interrogate on a Remote client are the stub objects, but they can’t tell you anything about the real EJB object or Home object.

So while a Remote home client has to use EJBMetaData (the interface returned from the EJBHome getEJBMetaData() method) to get info, a local client will simply use the Java reflection methods (getClass(), etc.).

Get Head First EJB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.