Results 1 to 3 of 3
  1. #1
    aks.nitw is offline Member
    Join Date
    Oct 2008
    Posts
    5
    Rep Power
    0

    Default Help in creating a NetworkClassLoader

    Sir,

    I what to transfer a .class from a network. So i want to create a networkclassLoader which extends the parent classloader. I am unable to get any idea about how to create a network connection and send a .class from a network system.

    i have developed a simple network program which just establish a connection and send a message to both the system but i am not able to send a .class file from one system to another.

    So please help in creating a networkclassLoader or sample blueprint of creating a networkClassLoader file

  2. #2
    roots's Avatar
    roots is offline Moderator
    Join Date
    Jan 2008
    Location
    Dallas
    Posts
    293
    Rep Power
    7

    Default

    Read the class file and send as the bytes over the network, you have to use Class.defineClass(...) after that.
    dont worry newbie, we got you covered.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default

    defineClass(...) is a protected final method of ClassLoader, so you have to extend the class to be able to use it.

    You might like to take a look at my File Class Loader, which has a public API to define and resolve a class loaded from a file or a byte array.
    File Class Loader Java Tips Weblog

    db

Similar Threads

  1. Creating a tree
    By Preethi in forum AWT / Swing
    Replies: 0
    Last Post: 01-07-2008, 01:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •