aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Question on Whether a Message Driven Bean can have Message Driven Bean as Superclass Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Question on Whether a Message Driven Bean can have Message Driven Bean as Superclass " Watch "Question on Whether a Message Driven Bean can have Message Driven Bean as Superclass " New topic
Author

Question on Whether a Message Driven Bean can have Message Driven Bean as Superclass

Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

Source: EJB 3.1 Specification


5.6 The Responsibilities of the Bean Provider

5.6.2 Message-Driven Bean Class

The message-driven bean class may have superclasses and/or superinterfaces. If the message-driven bean has superclasses, the methods of the messagelistener interface, lifecycle callback interceptor methods, timeout callback methods, the ejbCreatemethod, and the methods of the Mes-sageDrivenBeaninterface may be defined in the message-driven bean class or in any of its super-classes.
A message-driven bean class must not have a superclass that is itself a message-driven bean class


5.6.3 Message-Driven Bean Superclasses

A message-driven bean class is permitted to have superclasses that are themselves message-driven bean classes


The above 2 statements seems to be contradictory.

Please advise how these 2 statements(italicized) are possible.


OCPJP 6.0 93%
OCPJWCD 5.0 98%
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1712
    
  25

In 5.6.2. it is specified that certain methods can be defined on a superclass. Like the onMessage() method is allowed to be on a superclass as long as the superclass is not a Message Driven Bean. In that case the onMessage() method won't be inherited.

In 5.6.3. it is specified that a Message Driven Bean can have a MDB as superclass which is merely a convenient use of implementation inheritence.

Regards,
Frits
Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

Thanks Frits
 
Consider Paul's rocket mass heater.
 
subject: Question on Whether a Message Driven Bean can have Message Driven Bean as Superclass