This week's book giveaway is in the Android forum.
We're giving away four copies of Learning Java by Building Android Games and have Jean-Marcel Belmont on-line!
See this thread for details.
Win a copy of Learning Java by Building Android Games this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

How to read Clients CPU information on Server  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have javaRMI Client Server programme, I want to see Cleints CPU Usage, Memory, HDD space and computer ID on Server.How can I do that can someone give me the codes for this, I really need them as this is my project work.Ok here is the RMI Client Srver programme.
/***************************************************************
* 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);
}
}
}
 
Bartender
Posts: 9523
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at this thread. Pretty much the same thing, only you need to make a serializable object to contain the data and send to the server.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!