• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session bean implements more than one interfaces

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Grace Yang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks again Vinay !
 
I don't even know how to spell CIA. But this tiny ad does:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic