Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

classloader and serialization in JDK1.2


  • From: boazbk@xxxxxxxxxxxxxx (Boaz Barak)
  • Subject: classloader and serialization in JDK1.2
  • Date: Sun, 27 Sep 1998 18:42:26 +0200

The standard way to these things in JDK 1.2 is to extend ObjectOutputStream
and ObjectInputStream and override
ObjectOutputStream.annotateClass() to provide the actual bytecodes or a URL
where they can be found (less expensive) , and to override
ObjectInputStream.resolveClass() to read and make use of this data - I think
this is the way it's done in RMI etc...

----- Original Message -----
From: Nate Williams <nate@xxxxxxxxxx>
To: power <zgq@xxxxxxxxxxxxxxxxxx>
Cc: <advanced-java@xxxxxxxxxxxxxxxx>
Sent: éåí ùðé 27 ñôèîáø 1999 18:15
Subject: Re: classloader and serialization in JDK1.2


> >     I want to combine classloader and serialization together to dynamic
> > load class of an object. And I use my custom classloader to load the
> > class and use serialization to read object from stream.
>
> I hope you realize that the 'serialized' object you read from the
> stream is *NOT* the class itself, but a more compact (??) representation
> of it.
>
> To do serialization, you *must* also send the raw class across the
> wire.  You can use serialization, but all you would be serializing is
> bytes, so I recommend not using serialization.
>
> We're doing this now, and what we do is when we can't find the class in
> our 'local' class Loader, we startup a process that does a file transfer
> of the class.  You could use an URL loader to download the class and
> then stick it somewhere in your CLASSPATH on disk or whatever, and then
> the classloader can find it and then 'load' the classes correctly.
>
>
> Nate
>
> ---
> To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx
> To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx
>


---
To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx
To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx