Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > plz tell me Internal execution of RMI application

Reply
Thread Tools

plz tell me Internal execution of RMI application

 
 
1234java@gmail.com
Guest
Posts: n/a
 
      12-22-2007
hi
iam learing the RMI .i write first basic application but how the
RMI application is executing iam not getting...tell me how the
execution is performed......with internal details.......step by step
clearly......

client application:

public class Client {
public static void main(String arf[])throws Exception {
java.rmi.Remote r=java.rmi.Naming.lookup("ic");
Implementationclass ic=(Implementationclass)r;
System.out.println(ic.rmprint());
System.out.println("-------client--------");
}
}

Registry application:


public class Myregister {
public static void main(String ar[])throws Exception {
Implementationclass objRemote=new Implementationclass();
java.rmi.Naming.bind("ic",objRemote);
System.out.println("------object binded----");
}
}

interface:

import java.rmi.Remote;
import java.rmi.RemoteException;

public interface Myinterface extends Remote {
public String rmprint()throws RemoteException;
}

implementaion class:


import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

public class Implementationclass extends UnicastRemoteObject
implements Myinterface {
public Implementationclass() throws RemoteException {
}
public String rmprint() {
System.out.println("--------in print
method:Implementationclass-------");
return "--------output from RMI--------";
}
}.

---------------------------------------------------------------------------------------------

when RemoteObject is created, internally wht happend when it is
created........how it is n/w enabled...wht happend when it is n/w
enabled.....where println statements r diplayed..... plz tell me step
by step procedure clearly.......bcz iam new to RMI...........
 
Reply With Quote
 
 
 
 
EJP
Guest
Posts: n/a
 
      12-24-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Implementationclass ic=(Implementationclass)r;


That should read MyInterface ic = (MyInterface)r;

> when RemoteObject is created, internally wht happend when it is
> created


It is 'exported' by the RMI Runtime system.

> how it is n/w enabled


This happens when it is exported by the RMI runtime system.

> wht happend when it is n/w enabled


It becomes ready to receive incoming remote calls via a TCP listening
socket.

> where println statements r diplayed


Wherever the JVM that executes them is running.

> plz tell me step by step procedure


1. A remote object is exported.
2. It can be bound in the RMI registry, or returned as the result of
another remote method.
3. The client acquires the stub for the object, from the Registry or via
another remote method on another remote object.
4. The client executes methods on the stub, which are marshalled and
passed over the network to the exporting JVM, where they are executed,
and the return value or exception is returned over the network to the
client.

You should read the the RMI Tutorial.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does java.rmi.Naming not implement interface java.rmi.Registry? Jan Schulze Java 1 03-26-2005 07:45 AM
RMI Vs RMI over IIOP JScoobyCed Java 1 01-28-2005 09:54 AM
Re: plz help!!! plz plz plz plzplzplz help the noob alkzy Microsoft Certification 0 10-31-2004 10:04 PM
RMI, JINI or RMI/IIOP Buu Nguyen Java 1 08-25-2004 11:28 AM
Computer Problems... Plz Plz Plz HELP ME..... Nick Computer Support 0 06-04-2004 08:50 PM



Advertisments