I feel sheepish even asking this question because it seems like it should be
absolutely straightforward, and yet I am too slow to see it.

I have an interface, DAO.java.  It is not annotated in any way.  For the
purposes of this email it doesn't matter what method signatures are in it.

I have another interface, Foo.java.  It extends DAO.  It is not annotated in
any way.  Again, the method signatures don't matter.

Finally, I have a stateless session bean, Bar.java.  Bar implements Foo (and
by extension implements DAO).  It is annotated with @Stateless(name = "Bar")
and @Remote(Foo.class).  It properly implements all methods it's required
to.

When I run my unit tests with OpenEJB, Bar is deployed "under" the
interfaces Foo and DAO.  How can I prevent it from being deployed under
DAO?  That is, I don't want it to be possible for some other EJB somewhere
to do this:

@EJB
private DAO dao; // XXX want to prevent this

How can I do that in a specification-compliant manner?

Thanks,
Laird

Reply via email to