| Class loader for Xlets. This is needed to automatically generate stub
classes for IXC.
Suppose, for example, that a user class implemens a remote interface UserIF,
and that interface contains two methods, void frob(Something), and
int glorp(float). This classloader will automatically generate
a remote stub. The stub will be equivalent to the following class:
package com.sun.xlet;
import java.lang.reflect.Method;
public final class StubClass$$42 extends com.sun.xlet.WrappedRemote
implements UserIF {
private static Method com_sun_xlet_method0;
private static Method com_sun_xlet_method1;
public static void com_sun_xlet_init(Method findMethodMethod)
throws Exception {
// findMethodMethod is Utils.findMethod for the ClassLoader
// where the *target* Remote object lives.
if (com_sun_xlet_method0 != null) {
return;
}
com_sun_xlet_method0 = (Method) findMethodMethod.invoke(null,
new Object[] { "UserIF", "frob", new Object[] { "Something" }});
com_sun_xlet_method1 = (Method) findMethodMethod.invoke(null,
new Object[] { "UserIF", "glorp",
new Object[] { java.lang.Float.TYPE }});
}
public static void com_sun_xlet_destroy() {
com_sun_xlet_method0 = null;
com_sun_xlet_method1 = null;
}
public StubClass$$42(Remote target, ImportRegistryImpl registry,
RegistryKey key) {
super(target, registry, key);
}
public void frob(Something arg1) throws org.dvb.ixc.RemoteException {
com_sun_xlet_execute(com_sun_xlet_method0,
new Object[] { arg1 });
}
public int glorp(float arg1) throws org.dvb.ixc.RemoteException {
Object r = com_sun_xlet_execute(com_sun_xlet_method1,
new Object[] { new Float(arg1) });
return ((Integer) r).intValue();
}
}
|