I am currently learning the basics of EJB 2+. In the book Java EE 7 The Big Picture, it was mentioned:
Session beans are generally accessed through a remote interface (though, as we shall see, there are cases where a remote interface is not required), while message-driven beans have only a bean implementation class.
Based on the statement above, invoking a message-driven bean (MDB) just like invoking a remote session bean through a remote interface
, whose server-side interface is done with @Remote
annotation, seems to be impossible.
For instance, if there is a MDB on a remote EJB container:
@Remote
@MessageDriven(mappedName="jms/HelloQueue")
public class HelloMDB implements MessageListener {
public void onMessage(Message msg) {
//implementation
}
}
Question: can the MDB mentioned above be invoked at all by a remote client directly and programmatically .e.g. through JNDI?