• 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 ...
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Marker interface Serializable

Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As per api documentation Serializable is a marker interface.
When I check for the methods, it does not have any. but the documentation says --->

Classes that require special handling during the serialization and deserialization process must implement special methods with these exact signatures:

private void writeObject(java.io.ObjectOutputStream out)
throws IOException
private void readObject(java.io.ObjectInputStream in)
throws IOException, ClassNotFoundException;


How does JVM maintains this contract between the implementing class and the interface ? This concept seems to be out of place from standard interface class and implementation separation concept.

How does JVM implements this concept.

Please help me understand this goofy concepts in Java.

Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I looked at the spec and referring to page 395, what i understand is that the "implementation" classes of the Handle and HomeHandle interface must provide those methods.
The writeObject/readObject methods of Handle/HomeHandle interface implementation class must call the HandleDelegate methods to perform serialization/deserialization of the handles.

javax.ejb.spi.HandleDelegate service provider interface is not used by
enterprise beans or J2EE application components directly.

Since these methods are in the implementation class and not used by the enterprise beans or applications directly, they have not been shown in the interface.
What are you doing in my house? Get 'em tiny ad!
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic