dermi.util
Class BusClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by dermi.util.BusClassLoader
All Implemented Interfaces:
RemoteEventListener

public class BusClassLoader
extends java.lang.ClassLoader
implements RemoteEventListener

This is a custom class loader that makes a request to the remote object for the stub class when this is not found on the local machine. The remote object then sends the stub class using the event service and the BusClassLoader loads it in the custom virtual machine enabling highly dynamic remote applications.
The difference between Java RMI is that each object is then responsible for returning the stub class for remote clients.

Version:
1.2
Author:
Carles Pairot , Pedro Garcia

Constructor Summary
BusClassLoader(java.util.Properties env)
          Class constructor
 
Method Summary
 java.util.Hashtable anycallEventArrived(java.util.Hashtable evt)
          Standard upcall for anycall arrived events
 void close()
          This method should be used before closing any instance of this class
 void defineClass(java.lang.String className, byte[] data)
           
 void eventArrived(java.util.Hashtable evt)
          This method is called whenever an event is received
 java.lang.Class loadClass(java.lang.String name, boolean resolve)
          Method for remote class to load the specifed class
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BusClassLoader

public BusClassLoader(java.util.Properties env)
Class constructor

Parameters:
env - Properties Environment properties
Method Detail

eventArrived

public void eventArrived(java.util.Hashtable evt)
This method is called whenever an event is received

Specified by:
eventArrived in interface RemoteEventListener
Parameters:
evt - Hashtable Event data

anycallEventArrived

public java.util.Hashtable anycallEventArrived(java.util.Hashtable evt)
                                        throws UnmatchedAnycallMethodException
Description copied from interface: RemoteEventListener
Standard upcall for anycall arrived events

Specified by:
anycallEventArrived in interface RemoteEventListener
Parameters:
evt - Hashtable
Returns:
Hashtable
Throws:
UnmatchedAnycallMethodException

close

public void close()
This method should be used before closing any instance of this class


loadClass

public java.lang.Class loadClass(java.lang.String name,
                                 boolean resolve)
                          throws java.lang.ClassNotFoundException
Method for remote class to load the specifed class

Overrides:
loadClass in class java.lang.ClassLoader
Parameters:
name - Complete class name
resolve - Boolean look up remotely.
Throws:
java.lang.ClassNotFoundException - Problem with the loaded class: not found.

defineClass

public void defineClass(java.lang.String className,
                        byte[] data)