RMI question
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   yousuf89
Posted On:   Monday, May 20, 2013 03:50 AM

I developed an application using J2ME, now I want to test it using Java Benchmarks I found benchmarks that measure the performance of the mobile phone in general (graphics,image and so on). However I want benchmark to measure the execution time of my J2ME application. Could you please guide my on how to do this? can anyone help me on this?   Create an RMI application which allows a user to perform three banking operations such as Deposit, Withdrawal and Getting latest account balance. The application accepts a double amount as input for the first two operations and shows the status information after performing the actions. The third operation will display the acc   More>>

I developed an application using J2ME, now I want to test it using Java Benchmarks I found benchmarks that measure the performance of the mobile phone in general (graphics,image and so on). However I want benchmark to measure the execution time of my J2ME application. Could you please guide my on how to do this?

can anyone help me on this?

 
Create an RMI application which allows a user to perform three banking operations such as Deposit, Withdrawal and Getting latest account balance. The application accepts a double amount as input for the first two operations and shows the status information after performing the actions. The third operation will display the account balance on execution. You are required to complete the application based on the following requirements:
> Your remote interface should have three separate methods for three different operations.
> Remote methods should be implemented on Server.
> Client can able to provide the number of inches to be converted on a textfield and get the result in centimeter on another textfield.
> Server should provide the required outputs to the client.
> An application/applet with appropariate GUI shouild be implemented on Client (mandatory) and Server (Optional)


the professor a basic exercise of RMI for currency converter:

these are the steps that I know:
http://i277.photobucket.com/albums/kk59/yo...zps9d519601.png

the codes for them:
 
rClient import java.io.*;
import java.rmi.*;

public class rClient
{
public static void main(String args[])
{
double amount=0;
BufferedReader is = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter an amount: OR");
try
{
amount = Double.parseDouble(is.readLine());
}catch(IOException e){}

try
{
Object o = Naming.lookup ("rmi://127.0.0.1/rConvert");
rConverter r =(rConverter)o;
System.out.println("Converted to: $"+r.Convert(amount));
}
catch (Exception e)
{
System.out.println("ERROR " + e.getMessage());
e.printStackTrace();
}
}
}

 


 
rConverter
import java.rmi.*;

public interface rConverter extends Remote
{
public double Convert(double x) throws RemoteException;
 


 
rConverterImpl
import java.net.*;
import java.rmi.*;
import java.rmi.server.*;

public class rConverterImpl extends UnicastRemoteObject implements rConverter
{
public rConverterImpl() throws RemoteException
{
super();
}

public static void main(String args[])
{
try
{
rConverterImpl rc = new rConverterImpl();
Naming.rebind("rConvert",rc);
System.out.println("Remote Converter Started...");
}
catch (RemoteException e)
{
System.out.println("RemoteException: " + e.getMessage());
e.printStackTrace();

}
catch (MalformedURLException m)
{
System.out.println("URL Problem: " + m.getMessage());
m.printStackTrace();
}
}

public double Convert(double f)
{
double rate = 2.50;
System.out.println("Remote Conversion Request: OR" + f);
return(f*rate);
}
}
 
 
   <<Less
About | Sitemap | Contact