1 Answer - Sort by: Date | Rating
In RMI you can have references to "remote objects". These are objects that are on another computer but you interact with them as if they were local. The entity you get for an object remotely is actually not the object itself, but an interface that objects implements. The interface must extend java.rmi.Remote.An object can register itself with the RMI registry using the rebind method of java.rmi.Naming. (You have to start a local registry with rmiregistry first.) Objects can get a remote reference to a registered object using the lookup method of java.rmi.Naming.Now we get to try to write something fun using RMI. I give you the example to use class LocateRegistry to manually start RMI registry.
Assume the port number is 2007, you may code as follows:
//in your server program
LocateRegistry.createRegistry (2007);
Registry registry = LocateRegistry.getRegistry (2007);
//in your client program
Registry registry = LocateRegistry.getRegistry (2007);
//If the RMI server is located somewhere, use:
Registry registry = LocateRegistry.getRegistry (hostName, 2007);
Assume the port number is 2007, you may code as follows:
//in your server program
LocateRegistry.createRegistry (2007);
Registry registry = LocateRegistry.getRegistry (2007);
//in your client program
Registry registry = LocateRegistry.getRegistry (2007);
//If the RMI server is located somewhere, use:
Registry registry = LocateRegistry.getRegistry (hostName, 2007);
0
0
- What Is The Difference Between C And C++ And Java?
- How To Create A Java Program That Accepts A Number And Examines If It Is Odd Or Even And Positive Or Negative?
- How To Create A Java Program That Accepts 3 Numbers?
- Can You Create A Java Program That Accepts 3 Numbers (num1, Num2, Num3) And Sort Them In Ascending And Descending Order?
- What Is The Un Theme Of The Year 2009?
- Write A Program To Display A String With An Embedded Quote:"Sachin Has Played A Game Of His Life"?
- Why Java Is Popular In Market?
- How Can I Use Dmp File In Java?
- Can You Write A Program Called InheritanceTest.java To Support An Inheritance Hierarchy For Class Point–Square–Cube?
- A Java Program To Get Sports Marks In Student Package And Print Total Marks Of Student?
- The Project Aims To Implement A JAVA Parser? 1- Classes And Functions 2- Arithmetic/logic Expressions 3- If Statement
- How To Get Java On My Lg 260?
- Write A Java Program To Store A Number Find If It Is Positive Or A Negative Number If Positive Print I Am The First?
- How To Update The Sim 3 Expansion?
- What Is An Attribute In Java?
- Do I Have To Write A Main Method In Every Class I Create?
- What How The Step For Make Library Management?
- In Which Process We Can Start Java?
- Define The Concept Of Java Byte Code?
- How To Run Remote Method Invocation In More Machine?
- How To Run Java Remote Method Invocation In More Machine?
- How To Make A Java Program That Will Ask The User To Input A Number And Display All The Even Number And The Sum Of All Even Numbers Based On The Inputted/ Given Numbers?
- Is A Static Variable An Instance?
- What Does Literati-on Mean?
- What Is Abstract Class In Details?
- How Do I Manually Clean My Registry?
- Can I Clean Up Window Registry Error Files Manually. IF I Can Do Then How?
- Can I Download Registry Cleaner From This Website? ....http://www.download-registry-cleaners.com
- What Is RMI Networking?
- What Are The Differences Between RMI And CORBA?
- What Is Rmi? Explain In Short.

New Comment - Comments are editable for 5 min.