Fwd: custom DatagramSocket and DatagramPacket

Roger Abelenda rabelenda at gmail.com
Wed Oct 31 10:00:06 PDT 2007


I also need to make other classes in my implementation (apart of the
Datagrams) visible by any class when i'm using the "modifyed" jvm. I'm
meaning thath those classes can be imported without setting nothing
after compiling de jvm. I want to make them part of the standard
classpath. Suggestions?

2007/10/30, Roger Abelenda <rabelenda at gmail.com>:
> I'm in an academic project implementing an ipv6 stack entirely with
> java in the jvm, and make the jvm by default call my ipv6 stack.
> Thanks for advice, i'll try.
>
> 2007/10/30, Alan Bateman <Alan.Bateman at sun.com>:
> > Roger Abelenda wrote:
> > > Hi I'm implementing an DatagramSocket and a
> > > datagramPacket and I want to subsitute the ones of the jvm with this
> > > ones. If you know: where may I put my code and what shall I do to make
> > > it compile when I compile the jvm?, and , what changes Ii need to do to
> > > plug it into the original code to make the jvm call my classes when
> > > somebody calls the original ones?. I thought to change the
> > > classloader.c  and the resolve.c. Any other options? thanks.
> > >
> > As DatagramSocket and DatagramPacket are created by public constructors
> > then you'll need to replace the existing classes. As a first step, for
> > testing purposes, it might be easier to prepend your classes to the boot
> > class path rather than replacing the classes in the build. Another
> > approach is to create a DatagramSocketImpl and use the
> > setDatagramSocketImplFactory method to set a factory that instantiates
> > your impl rather than the default. Can you provide a few more details on
> > what you are trying to do? If you are trying to fix a bug or add a
> > feature then maybe it would be easier to contribute changes to the
> > existing code rather than replacing them.
> >
> > -Alan.
> >
>



More information about the net-dev mailing list