This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin 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
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

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: 9551
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.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!