Posted By:
Alen_Ribic
Posted On:
Monday, October 14, 2002 03:13 AM
Hi All, I'm a newbie to RMI and I'm having a bit of a problem with dynamic code download. I would like the client to download the following files from the HTTP Class Server: - Compute.class I cast the Object looked up in the RMI Registry to Compute remote interface type. - Task.class I pass an argument of type Task on to the method executeTask(Task t); of Impl. class. - Pi.class Pi class is an implementation of Task inteface and an instance is used on the client side as an argument passed on to the executeTask(Task t); of Impl. class. - ComputeEngine_Stub.class Stub class needed to act as a client proxy for remote method invocation.
More>>
Hi All,
I'm a newbie to RMI and I'm having a bit of a problem with dynamic code download.
I would like the client to download the following files from the
HTTP Class Server:
- Compute.class I cast the Object looked up in the RMI Registry to Compute remote interface type.
- Task.class I pass an argument of type Task on to the method executeTask(Task t); of Impl. class.
- Pi.class Pi class is an implementation of Task inteface and an instance is used on the client
side as an argument passed on to the executeTask(Task t); of Impl. class.
- ComputeEngine_Stub.class Stub class needed to act as a client proxy for remote method invocation.
OUTPUT FROM [RMI: HTTP Class Server @port=2001]
server host: alen
client host: FAMILY
------------------------------------------------------------------------
Connected: Socket[addr=alen/192.168.0.2,port=3784,localport=2001]
reading: compute.classes.engine.ComputeEngine_Stub
file: D:
mihttpservercomputeclassesengineComputeEngine_Stub.class
Connected: Socket[addr=alen/192.168.0.2,port=3785,localport=2001]
reading: compute.classes.compute.Compute
file: D:
mihttpservercomputeclassescomputeCompute.class
Connected: Socket[addr=alen/192.168.0.2,port=3786,localport=2001]
reading: compute.classes.compute.Task
file: D:
mihttpservercomputeclassescomputeTask.class
Connected: Socket[addr=FAMILY/192.168.0.1,port=1449,localport=2001]
reading: compute.classes.engine.ComputeEngine_Stub
file: D:
mihttpservercomputeclassesengineComputeEngine_Stub.class
------------------------------------------------------------------------
As seen in the above log, client currently only downloads the ComputeEngine_Stub.class from my http server.
As the server downloads the Compute.class and Task.class, I would like the client to do the same.
Note:
client's CLASSPATH contains the Compute.class, Task.class, Pi.class and ComputePi.class
Removing the Compute.class, Task.class and Pi.class from the client's CLASSPATH gives me
a problem that the client cannot locate the Compute.class, Task.class and Pi.class classes
but these are the classes I would like the client to download from the http server including
the already downloaded _Stub class.
alen[server]:
------------------------------------------------------------------------
>java -Djava.rmi.server.codebase=http://alen:2001/compute/classes/
-Djava.rmi.server.hostname=alen -Djava.security.policy=d:/rmi
httpserver/compute/java.policy
engine.ComputeEngine
FAMILY[client]:
------------------------------------------------------------------------
>java -Djava.rmi.server.codebase=http://alen:2001/compute/classes/
-Djava.security.policy=d:/src/java/example1/java.policy
client.ComputePi alen 4 (Usage: ComputePi remotehost param1)
Any help would be appreciated
Alen
<<Less