File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Session bean implements more than one interfaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Session bean implements more than one interfaces" Watch "Session bean implements more than one interfaces" New topic
Author

Session bean implements more than one interfaces

Grace Yang
Ranch Hand

Joined: Apr 01, 2007
Posts: 58
pubic interface Bar{ public void bar() ; }

@Stateful
public class MyBar implements Serialable, Bar
{
public void bar(){..};
}
Question 1:
MyBar is wrong, because when implementing more than one interface, it can't not implement Serialable, am I correct?

But can I define as below? (only implemnt one interface.)
@Stateful
public class MyBar implements Serialable
{


}

Thanks


Thanks
Vinay Nath
Ranch Hand

Joined: Jul 06, 2008
Posts: 85
It is not wrong, when implementing multiple interfaces, serializable and externizable are not counted.

look at this text:

A bean class is permitted to have MORE THAN ONE interface. If a
bean class has more than one interface excluding the
interfaces listed below any business interface of the bean
class MUST be explicitly designated as a business interface of the
bean by means of the Local or Remote annotation on the bean
class or interface or in the deployment descriptor.

and also:

The following interfaces are excluded when determining whether
the bean class has more than one interface: java.io.Serializable;
java.io.Externalizable; any of the interfaces defined by the javax.ejb
package.


SCDJWS 5.0, SCBCD 5.0, SCWCD 5.0, SCJP 5.0
Grace Yang
Ranch Hand

Joined: Apr 01, 2007
Posts: 58
Thanks again Vinay !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session bean implements more than one interfaces