Package remote

Examples of remote.SPRemote


            boolean dr;
            if ((args.length > 0) && args[0].equals("--dry-run"))
              dr = true;
            else
              dr = false;
            SPRemote spclient = new SPClient(dr);
            SPRemote stub = (SPRemote) UnicastRemoteObject.exportObject(spclient, 0);
            Registry registry = LocateRegistry.getRegistry();
            registry.rebind("SPRemote", stub);
            System.out.println("ServerPlus Client Started.");
        } catch (Exception e) {
            System.err.println("ServerPlus Client exception:");
View Full Code Here


   
    public static void main(String args[]) {

        try {
           
            SPRemote spremote = SPServer.getRemote(args[0]);

      int cmd, ret;
     
      cmd = Integer.parseInt(args[1]);
     
      if (cmd == 1) {
        ret = spremote.shutdownComputer();
        if (ret == 0)
          System.out.println("Shutdown Success.");
        else
          System.out.println("Shutdown Failled.");
      }
      else if (cmd == 2) {
        ret = spremote.restartComputer();
        if (ret == 0)
          System.out.println("Restart successfull.");
        else
          System.out.println("Restart failled.");
      }
View Full Code Here

        if (System.getSecurityManager() == null) {
            System.setSecurityManager(new SecurityManager());
        }
        String name = "SPRemote";
        Registry registry = LocateRegistry.getRegistry(host);
        SPRemote spremote = (SPRemote) registry.lookup(name);
        return spremote;
    }   
View Full Code Here

TOP

Related Classes of remote.SPRemote

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.