Serialize all subclasses automatically?

Is there an easy way to serialize all the classes that my class uses. Eg I use Cipher in my class CA but how do I make Cipher implement Serializable?
[156 byte] By [lokpesta] at [2007-10-3 5:15:48]
# 1
You cannot. You will have to replace the Cipher during serialization and recreate it upon deserialization.
IanSchneidera at 2007-7-14 23:22:24 > top of Java-index,Java Essentials,Java Programming...
# 2
ok, only objects that are serializable can be added to the rmiregistry right? That means that If would like to make a class that uses Cipher I cannot add it to the rmiregistry since I cannot serialize Cipher.
lokpesta at 2007-7-14 23:22:24 > top of Java-index,Java Essentials,Java Programming...
# 3

>ok, only objects that are serializable can be added to the rmiregistry right?

This I don't know about. I know they must be Remote, but you could be right.

>That means that If would like to make a class that uses Cipher I cannot add it

>to the rmiregistry since I cannot serialize Cipher.

You will have to take care to customize your (de)serialization for your class. Read more in the java.io.Serializable javadoc.

IanSchneidera at 2007-7-14 23:22:24 > top of Java-index,Java Essentials,Java Programming...
# 4

> ok, only objects that are serializable can be added

> to the rmiregistry right?

No, only classes that implement Remote. Serialization has nothing to do with it. I think there is some confusion here. The RMI Registry is a naming service for exported RMI objects. Serialization is used to transport arguments and results between exported RMI objects.

ejpa at 2007-7-14 23:22:24 > top of Java-index,Java Essentials,Java Programming...