예제 #1
0
  public static void main(String args[]) {
    try {
      SetupDataClient a = new SetupDataClient();
      System.out.print(rmiServer.getImageHeight("map.jpg"));

      System.out.print(rmiServer.getImageWidth("map.jpg"));
      System.out.print(rmiServer.getMapImage());
    } catch (RemoteException e) {
      System.out.println(e.getMessage());
    } catch (Exception e) {
      System.out.println(e.getMessage());
    }
  }
예제 #2
0
 /**
  * ***************************************************************
  *
  * @param ip
  * @param port
  * @return
  */
 public ChordMessageInterface rmiChord(String ip, int port) {
   ChordMessageInterface chord = null;
   try {
     Registry registry = LocateRegistry.getRegistry(ip, port);
     chord = (ChordMessageInterface) (registry.lookup("Chord"));
     return chord;
   } catch (RemoteException e) {
     e.printStackTrace();
   } catch (NotBoundException e) {
     e.printStackTrace();
   }
   return null;
 }