Client's PC monitoring for exp, CPU Usage, Memory,Space on Server using Java RMI.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   neo_sez
Posted On:   Thursday, January 15, 2004 05:26 AM

I have RMI Client server codes, I want to monitor Clients PC information like CPU usage, memory, disk space, how I can do that using Java RMI?? or I have to use other services as well?? second question is these codes are for one client and if I want to add more Clients than what I shall do? here are the codes. /*************************************************************** * Remote Interface for the "Hello, world!" example *****************************************************************/ import java.rmi.*; public interface HelloInterface extends Remote { /** * Remotely invocable method, say(). */ public String say() throws RemoteException;    More>>

I have RMI Client server codes, I want to monitor Clients PC
information like CPU usage, memory, disk space, how I can do that using Java RMI?? or I have to use other services as well??
second question is these codes are for one client and if I want to add more Clients than what I shall do?

here are the codes.


/***************************************************************
* Remote Interface for the "Hello, world!" example
*****************************************************************/
import java.rmi.*;
public interface HelloInterface extends Remote {
/**
* Remotely invocable method, say().
*/
public String say() throws RemoteException;
}


/*********************************************************************
* Remote class implementation for the "Hello, world!" RMI example.
**********************************************************************/
import java.rmi.*;
import java.rmi.server.*;
public class Hello extends UnicastRemoteObject implements HelloInterface {
private String message;
/**
* Construct a remote object. msg is the message of the
* remote object, such as "Hello, world!".
*/
public Hello (String msg) throws RemoteException {
message = msg;
}
/**
* Implementation of the remotely invocable method, say().
* Returns the message of the remote object, such as "Hello, world!".
*/
public String say() throws RemoteException {
return message;
}
}

Here is our example client program, HelloClient.java:
/***************************************************************
* Client program for the "Hello, world!" RMI example.
*****************************************************************/
import java.rmi.Naming;
public class HelloClient
{
public static void main (String[] argv) {
try {
HelloInterface hello = // your PC address here
(HelloInterface) Naming.lookup ("//IP Number/Hello");
System.out.println (hello.say());
}
catch (Exception e){
System.out.println ("HelloClient exception: " + e);}
}
}

/***************************************************************
* Server program for the "Hello, world!" RMI example.
*****************************************************************/
import java.rmi.Naming;
public class HelloServer
{
public static void main (String[] argv)
{
try {
Naming.rebind ("Hello", new Hello ("Hello, world!"));
System.out.println ("Hello Server is ready.");
}
catch (Exception e) {
System.out.println ("Hello Server failed: " + e);
}
}
}



I will be waiting for the earliest reply, and plz give answer in detail as I am beginer in java

thx and best regards
neo

   <<Less
About | Sitemap | Contact