Which Anti Virus

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Saturday, 21 September 2013

Simple Demo Of RMI Registry Program

Posted on 20:18 by Unknown

Demointerface.java
/**
 *
 * @author Nish
 */

public interface DemoInterface extends java.rmi.Remote{
    
              public String sayDemo() throws java.rmi.RemoteException;

}

Demosever.java
import java.rmi.RemoteException;

import java.rmi.registry.LocateRegistry;

import java.rmi.server.UnicastRemoteObject;


/**
 *
 * @author Nish
 */

public class DemoServer implements DemoInterface{
    
String message;
    
public DemoServer(){
        
super();
    
}
    
public DemoServer(String msg){
        
message = msg;
   
 }    
    
@Override
    
public String sayDemo() throws RemoteException {

       return message;
    
}
    
public static void main(String []args){
  
      try {
            
DemoInterface  h = new DemoServer("Hello");
            
DemoInterface stub = (DemoInterface)UnicastRemoteObject.exportObject(h, 0);
            

java.rmi.registry.Registry reg = LocateRegistry.getRegistry();
  
          reg.rebind("Hello", stub);
            
System.out.println("Server is ready for Operation");
        
} 
catch (Exception ex) {}
        
    
}

}

Democlient.java

import java.rmi.registry.LocateRegistry;

import java.rmi.registry.Registry;

/**
 *
 * @author Nish
 */

public class DemoClient {
    
public static void main(String []args){
      
  try{
           
 Registry reg = LocateRegistry.getRegistry("localhost");

           DemoInterface h = (DemoInterface)reg.lookup("Hello");
            

System.out.println(h.sayDemo());
        
}
catch(Exception e){}
  
  }

}




Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in java | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Online Mobile Recharge Websites
    Hey here is the list of websites which helps you to make a online recharge of your mobile. Rechargeitnow.com FastRecharge.com Indiamobilerec...
  • GTU Paper Solution and Material as Per GTU syllabus
    Go to this website and download the Study material of GTU Syllabus. http://gtu-paper.blogspot.com/
  • C Program Library files(Header Files)
    1. <stdio.h>: input and output  function in program. 2. <conio.h>: to clear screen and  pause information function. 3. <ctype...
  • Windows 8 - Keyboard shortcuts
    Press this key To do this Right Shift for eight seconds Turn Filter Keys on and off Left Alt+Left Shift+PrtScn (or PrtScn) Turn High Contras...
  • How To Install Android on PC or Laptop
    Android has a got very important place in our Tech World.Now in market you can get many devices running on Android like Smartphones to Table...
  • HOW TO : Speed Up Youtube Buffering Speed
    1. Click start then type  system.ini  in the input address box 2. Then you will see the file  system.ini,  click it and it will open in a no...
  • Different Operating System and Their RAM Support
    Windows 8 64 bit Enterprise  Professional : 512 GB Windows 8 64 bit :128 GB Windows 8 32 bit : 4 GB Windows 7 64 bit Ultimate, Enterprise ...
  • Make Calculator Yourself using java.
    write a following code in netbeans IDE 7.1 and save file as calc.java and run it and you will have your own calculator...  /*  * To change t...
  • How To recover Saved Password In Firefox ?
    1. Open Firefox Web Broweser 2. Then Click on FireFox > Option > Option as shown in below picture 3. Then a POP Up box will appear, In...
  • How To Check Antivirus Strength or Test Antivirus Software or Check Antivirus Which is Used by You is Good or Worst?
    One of the most asked question is  Which antivirus has good strength or How to check antivirus strength? This post is for them who want to c...

Categories

  • Android
  • Android Apps
  • apps
  • BlackBerry
  • Cprog
  • dfd
  • erd
  • Facebook
  • general
  • Hacking
  • HTC
  • ios
  • java
  • Mobile
  • nokia
  • Samsung
  • Srs
  • Window Apps
  • Windows 8

Blog Archive

  • ▼  2013 (91)
    • ►  November (6)
    • ►  October (5)
    • ▼  September (17)
      • How to Get Maximum Battery Life in Laptop?
      • Android Secrete codes
      • How To recover Saved Password In Firefox ?
      • How To Install Android on PC or Laptop
      • Download Your Torrent Files Using IDM
      • How To Watch or Stream Torrents Without Downloading
      • How Can You Disable Your Desktop?
      • Simple Demo Of RMI Registry Program
      • Steps To Run RMI Program in JAVA
      • To Convert a FAT Partition to NTFS
      • Steps To Delete Viruses From your PenDrive
      • Get to Unblocked Websites Using Google! - Google a...
      • Steps To Find Manufacturing Date Of Your Computer
      • Password Vulnerability in All Browser
      • Lock Your Folder Without Any Software
      • Java Swing Look and Feel Feature-Example-Set Motif...
      • Make Analog Clock using java
    • ►  August (3)
    • ►  July (8)
    • ►  June (13)
    • ►  May (12)
    • ►  April (27)
Powered by Blogger.

About Me

Unknown
View my complete profile