Monday, March 9, 2015

VTU Distributed Computing Lab

RMI

Problem statement:

Design and implement client server application using RMI (Remote Method Invocation) to invoke a service to calculate the income tax.

Start NetBean IDE

Machine generated alternative text:
NetBeallSlDE 8.0.2 
DeWo me 
Turning on modules 
IDE and NetBeans Platfo 
NetBeans 
under the 
2 with Classpath 
p nt and Distribu on 
ased which licenæd 
(CDDu and the GNU Public License 
ti License 
"w.netbeans.org.

Create new project:

Machine generated alternative text:
O NetBeans1DE 80.2 
File Edit View Navigate Source Refactor Run Debug Profile 
Team 
Tools Window Help 
Start Page 
e NetBeanslDE 
Learn & Discover 
Take a Tour 
Try a Sample Project 
Whats New 
Community Corner 
Output 
Search (Ctrl+l) 
Show On Startup 
Featured Demo 
Cannot connect to internet. 
Projects Files 
Se Nices 
Learn & Discover 
My NetBeans 
Whats New 
Demos & Tutorials 
Java SE Applications 
Java and JavaFX GUI Applications 
Java EE & Java Web Applications 
Applications 
PHP and HTML5 Applications 
Mobile and Embedded Applications

File-> New Project  

Machine generated alternative text:
'NetESlIÆ 
Learn 8 Discover

Select Java project and Click on next:

Machine generated alternative text:
O New Project 
Steps 
I. Choose Project 
Choose Project 
Filter: 
Categories : 
JavaFX 
Java Web 
Java EE 
HTML 5 
Java ME Embedded 
Java Card 
Maven 
Groov y 
Description: 
Pr oyects: 
Java Applica bon 
Java Class Library 
Java Project With Existing Sources 
Java Free-Form Project 
Creates a new Java SE application in a standard IDE project. You can also generate a main class 
in the project. Standard projects use an IDE-generated Ant build script to build, run, and debug 
'O)ur pr oject. 
c: Back 
Next 
Finish



Provide the Project Name: (it-rmi-server)

Machine generated alternative text:
New Java Application 
Steps 
I. Choose Pr oject 
2. Name and Location 
Name and Location 
Proyect Name: 
Project Loca bon : 
Project F older : 
it-rmi -server 
C : user sLAKSHMAN -LTDocumen tsVNe tBeansPr ojects 
: user sLAKSHMAN -LTDocumen tsWe tBe ansPr ojectsl' t-rm -serv er 
Browse... 
Browse... 
IJse Dedicated Folder for Storing Libraries 
Libraries Folder: 
Different users and projects can share the same compilaton 
libraries (see Help for details) 
Create Main Class it. rmi server ItRmiServer 
c: Back 
Next

And Click on Finish

Machine generated alternative text:
it-rmi-sep.'er - NetBeans IDE 8.0.2 
File Edit View Navigate Source Refactor Run Debug Profile 
Team 
Tools Window Help 
ItRmServer. java 
Start Page 
source History 
Search (Ctrl +1) 
Projects Files 
it-rmi-server 
Se Nices 
* To change this license header, choose License Headers in project properti 
* To change this template file, choose Tools I Templates 
* and open the template in the editor . 
package it. rmi. server; 
* @author I_AKSHMAN-LT 
public class ItRmiServer 
the command line arguments 
* @param 
args 
public static void main (String CJ args) 
// TODO code application logic here

Expand your project:

Machine generated alternative text:
it-rmi-sep.'er - NetBeans IDE 8.0.2 
File Edit View Navigate Source Refactor Run Debug Profile 
Projects Files Services 
it-rmi-server 
Source Packages 
it.rmi.server 
ItRmiServer .java 
Libraries 
Team 
Tools Window Help 
ItRmServer. java 
Start Page 
Search (Ctrl +1) 
source History 
* To change this license header, choose License Headers in project properti 
* To change this template file, choose Tools I Templates 
* and open the template in the editor . 
package it. rmi. server; 
* @author I_AKSHMAN-LT 
public class ItRmiServer 
the command line arguments 
* @param 
args 
public static void main (String CJ args) 
// TODO code application logic here

Right click on package (it.rmi.server) Create new interface

Machine generated alternative text:
O it-rmi-sep.'er - NetBeans IDE 8.0.2 
File Edit View Navigate Source Refactor Run Debug Profile 
P rojects Files Services 
it-rmi-dient 
Sour ce Packages 
it.rmi.client 
ItRmiCIient.java 
Libr aries 
t-rmi-server 
Source Packages 
ltRmi 
Team 
Tools Window Help 
StartPage ItTaxCaI.java ItTaxCaIImp.java ItRmiCIient.java 
Sour ce History 
catch (RemoteException I NotBoundException e) 
out. print In (e) ; 
System. 
c 
Search (Ctrl+l) 
36:1/36-1234 
5:05 AM 
3/10/2015 
Ctrl 
Ctrl 
Ctrl 
Ctrl* 
x 
c 
v 
it-rmi-server (run) 
Il seconds) 
Find... 
Copy 
Paste 
Delete 
Refacto r 
Compile Package 
Test Package 
History 
Tools 
Folder... 
Java Class... 
Java Interface... 
Web Service Client... 
Entity Class... 
Java Package... 
JPaneI Form... 
JFrame Form... 
Entity Classes from Database... 
Other... 
Output 
LAKSHMAN-LT - c:'Users'LAKSHMAN-LT 
Enter Deductions 
200000 
HI, Lakshman your tax details 
Libranes 
Delete 
Ctrl* 
it-rm-dient (run) 
it-rmi-server (run) 
In come 
:4soooo.o 
Deductions :200000.0 
Tax Amount : 75000.0 
BUILD SUCCESSFUL (total time:

Provide name for the interface: (ItTaxCal)

Machine generated alternative text:
O New Java Interface 
Steps 
I. Choose File Type 
2. Name and Location 
Name and Location 
Class Name: 
Project: 
Location: 
Package: 
Created File: 
ltTaxcal 
t-rmi-server 
Source Packages 
it.rmi.server 
AKSHMAN-LTDocumen tsWe tBeansPr ojectsl't-rmi-server Iserver utTaxCaI. java 
c: Back 
Next 
Help

Click on Finish

Machine generated alternative text:
it-rmi-sep.'er - NetBeans IDE 8.0.2 
File Edit View Navigate Source Refactor Run Debug Profile 
P roject s Files Services 
it-rmi-server 
Sour ce Packages 
it.rmi.server 
ItRmiServer .java 
ItTaxCaI.java 
Libraries 
Team 
Tools Window Help 
Start Page ItRmServer.java 
ItTaxCaI.Java 
source History 
Search (Ctrl +1) 
* To change this license header, choose License Headers in project properti 
* To change this template file, choose Tools Templates 
* and open the template in the editor . 
package it. rmi. server; 
* @author I_AKSHMAN-LT 
public interface ItTaxCa1 
it.rmi.server.ItTaxCaI 
13: 1

After removing comments in  ItTaxCal interface looks:

package it.rmi.server;
import java.rmi.Remote;

public interface ItTaxCal extends Remote{
   
}

Add the method to ItTaxCal interface as shown bellow:

package it.rmi.server;
import java.rmi.Remote;
import java.rmi.RemoteException;

public interface ItTaxCal extends Remote{
     
       public double getTaxAmount(double income,double deductions)throws RemoteException;

}

Right Click on package and create new Class ( ItTaxCalImp)

Machine generated alternative text:
O New Java Class 
Steps 
I. Choose File Type 
2. Name and Location 
Name and Location 
Class Name: 
Project: 
Location: 
Package: 
Created File: 
I tTaxCaIImp 
t-rmi-server 
Source Packages 
it.rmi.server 
HMAN-LTDocumen tsWe tBeansPr ojectsl' t-rm -serv er tlrmi Iserv er tTaxCaIImp ja v a 
c: Back 
Next 
Help

Click on Finish

Machine generated alternative text:
it-rmi-sep.'er - NetBeans IDE 8.0.2 
File Edit View Navigate Source Refactor Run Debug Profile 
P roject s Files Services 
it-rmi-server 
Sour ce Packages 
it.rmi.server 
ItRmiServer .java 
ItTaxCaI.java 
ItTaxCaIImp.java 
Libraries 
Team 
Tools Window Help 
ItRmiServer.java ItTaxCaLjava ItTaxCaIImp java 
Start Page 
source History 
Search (Ctrl +1) 
* To change this license header, choose License Headers in project properti 
* To change this template file, choose Tools Templates 
* and open the template 
package it. rmi. server; 
* @author I_AKSHMAN-LT 
public class ItTaxCa11mp 
in the editor.

Note: Auto generate comments has been removed  

Add the following code to the ItTaxCalImp class

package it.rmi.server;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

public class ItTaxCalImp extends UnicastRemoteObject implements ItTaxCal {

   public ItTaxCalImp() throws RemoteException {
   }

   @Override
   public double getTaxAmount(double income, double deductions) throws RemoteException {
       
//Write your Business Logic

       double taxAmount = 0.0d;
        if (income > deductions) {
            taxAmount = (income - deductions) * .3;
        }
        return taxAmount;

   }
 }


Open ItRmiServer  calss add the following code

package it.rmi.server;
import java.rmi.AlreadyBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public class ItRmiServer {
  public static void main(String[] args) {


       try{


           Registry registry=LocateRegistry.createRegistry(1099);
           ItTaxCal obj=new ItTaxCalImp();
           registry.bind("taxcal", obj);
           System.out.println("RMI Server is started......");


       }catch(RemoteException | AlreadyBoundException e){
           System.out.println(e);
       }


   }
}

With this we have done with the RMI server application


Creating client project:


Machine generated alternative text:
O NetBeans1DE 80.2 
File Edit View Navigate Source Refactor Run Debug Profile 
Team 
o 
Tools Window Help 
ItRmServer. java ItTaxCaI.java ItTaxCaIImp.java 
Start Page 
source History 
public class ItRmiServer 
public static void main (String CJ args) 
try ( 
Registry registry—LocateRegistry 
ItTaxCa1 obi—new ItTaxCa11mp ( ) ; 
registry . bind ( " taxcal " 
obi) ; 
Search (Ctrl+l) 
createRegistry(1099) ; 
Projects Files 
it-rmi -server 
Se Nices 
Ctrl 
Shift* 
New Project.. 
New File... 
Open Project... 
Open Recent Project 
Project Groups... 
Build Project (it-rmi-server) 
Clean and Build Project (it-rmi-server) 
Run Project (it-rmi-server) 
Debug Project (it-rmi-server) 
Set Main Project 
Collapse All 
Show Selected Node(s) Project Owner 
View Java Packages as 
System. out . print In ( 
"RMI Server is started. 
catch (RemoteException I AlreadyBoundException e) 
System. out. print In (e) ; 
Shift*F11 
Ctrl*F5 
12% 
12: lg 
4:42 AM 
c 
3/10/2015 
it. rmi server ItRmiServer 
Output 
LAKSHMAN-LT - c: 'Users'LAKSHMAN-LT 
PMI Server LS started. 
try obj 
it-rmi-server (run) 
it-rmi-server (run)


Select Java Project and click on Next:

Machine generated alternative text:
O New Project 
Steps 
I. Choose Project 
Choose Project 
Filter: 
Categories : 
JavaFX 
Java Web 
Java EE 
HTML 5 
Java ME Embedded 
Java Card 
Maven 
Groov y 
Description: 
Pr oyects: 
Java Applica bon 
Java Class Library 
Java Project With Existing Sources 
Java Free-Form Project 
Creates a new Java SE application in a standard IDE project. You can also generate a main class 
in the project. Standard projects use an IDE-generated Ant build script to build, run, and debug 
'O)ur pr oject. 
c: Back 
Next 
Finish

Provide project name and click on finish
Machine generated alternative text:
New Java Application 
Steps 
I. Choose Pr oject 
2. Name and Location 
Name and Location 
Proyect Name: 
Project Loca bon : 
Project F older : 
it-rmi-dien 
C : user sLAKSHMAN -LTDocumen tsVNe tBeansPr ojects 
: : user sLAKSHMAN -LTDocumen tsWe tBe ansPr ojectsl' t-rm -dien t 
Browse... 
Browse... 
IJse Dedicated Folder for Storing Libraries 
Libraries Folder: 
Different users and projects can share the same compilaton 
libraries (see Help for details) 
Create Main Class it. rmi.dient.ItRmiCIient 
c: Back 
Next



Machine generated alternative text:
O it-rmi-client - NetBeans IDE 8.0.2 
File Edit View Navigate Source Refactor Run Debug Profile 
Projects Files Services 
it-rmi Client 
Source Packages 
it.rmi.client 
ItRmiCIient.java 
Libr aries 
t-rm -server 
Team 
Tools Window Help 
Start Page ItRmServer.java ItTaxCaI.java ItTaxCaIImp.java ItRmCIient.java 
source History 
Search (Ctrl +1) 
package it.rmi. client; 
public class ItRmiC1ient 
public static void main (String 
it. rmi client. ItRmiCIient 
args)


To add Remote interface, right click on it-rmi-client project and select the Properties

Machine generated alternative text:
O it-rmi-client - NetBeans IDE 8.0.2 
File Edit View Navigate Source Refactor Run Debug Profile 
Team 
Tools Window Help 
StartPage ItTaxCaI.java ItTaxCaIImp.java ItRmiCIient.java 
source History 
Search (Ctrl +1) 
4:46 AM 
c 
3/10/2015 
Projects Files 
it-rmicli- 
t-rm 
Se Nices 
Build 
Clean and Build 
Clean 
Generate Javadoc 
Run 
Debug 
Profile 
Test 
Set Configuration 
Open Required Projects 
Close 
Rename... 
Copy... 
Delete 
Find... 
Inspect and Transform... 
History 
Pro perties 
Alt*F6 
Delete 
Ctrl*F 
package it.rmi. client; 
public class ItRmiC1ient 
public static void main (String 
it. rmi client. ItRmiCIient 
args) 
"18%

Then the following window appears


Machine generated alternative text:
O Project Properties - 
Categories : 
it-rmi-client 
project Folder: C:WsersLAKSHMAN-LTDocumentsWetBeansProjectsK't-rm-cIient 
Source Package F olders: 
Add Folder. 
Remove 
Move LIP 
Move Down 
Add Folder. 
Remove 
Move LIP 
Move Down 
o 
o 
o 
Sources 
Libraries 
Build 
Packaging 
Deplo ymen t 
O Documenting 
Run 
Applica bon 
O Web Start 
License Headers 
Forma tting 
Hints 
Source P 
est P 
Package F older 
Test Package F olders: 
Package F older 
Source 'Binar y Forma t: 
Profile: 
JDK 8 
Full RE 
LITF-8


Select the Libraries 


Machine generated alternative text:
O Project Properties - 
Ca tegories: 
Sources 
Libraries 
Build 
it-rmi-client 
Java Platform: 
Libraries Folder: 
JDK 1.8 (Default) 
Run Tests 
Manage Platfrms... 
Browse.. 
Add Project.. 
Add Librar y.. 
Add JAR/FoIder 
Remove 
Move up 
Move Down 
o 
o 
Compile Tests 
Compile processor Run 
Compile -time Libr aries: 
Packaging 
Deplo ymen t 
O Documenting 
Run 
Applica bon 
O Web Start 
License Headers 
Forma tting 
Hints 
Compile-time libraries are propagated to al library categories. 
Build Proyects on Classpath

Select Add Project Tab, then select it-rmi-server project click on Add Project JAR Files

Machine generated alternative text:
O Add Project 
Look in: 
Ne tBe ansPr ojects 
Pr oject Name: 
t-rmi-server 
Project JAR Files: 
dist:it-rmi -server. jar 
Add PrØect JAR Files 
it-rmi-dient 
Recen t I tems 
De sktop 
My Cocuments 
Compu ter 
File name: 
Network 
Files of type: 
fr sLAKSHMAN -LTDocumen tsVNe tBeansPr ojectsl' t-rmi -serv er 
project Folder

Then the following screen appears:


Machine generated alternative text:
O Project Properties - 
Ca tegories: 
Sour ces 
Libraries 
it-rmi-client 
Java Platform: 
Libraries Folder: 
JDK 1.8 (Default) 
Run Tests 
Manage Platfrms... 
Browse... 
Add Proyect.. 
Add Library... 
Add JAR/FoIder 
Remo ve 
Move up 
Move Down 
o 
o 
Compile Prcn:essor Run Compile Tests 
Compile-tme Libraries: 
- jar 
Packaging 
Deplo ymen t 
O Documenting 
Run 
Applica bon 
O Web Start 
License Headers 
Forma tting 
Hints 
Compile-time libraries are propagated to al library categories. 
Build Proyects on Classpath

Open the ItRmiClient calss and add following code:


package it.rmi.client;
import it.rmi.server.ItTaxCal;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.Scanner;

public class ItRmiClient {
   public static void main(String[] args) {
       try{

           Registry registry=LocateRegistry.getRegistry("localhost",1099);
           ItTaxCal obj=(ItTaxCal)registry.lookup("taxcal");


           Scanner sc=new Scanner(System.in);
           System.out.println("Enter your name:");
           String name=sc.nextLine();


           System.out.println("Enter Income :");
           double income=sc.nextDouble();


           System.out.println("Enter Deductions");
           double deductions=sc.nextDouble();
           
           double taxamt=obj.getTaxAmount(income, deductions);
          
           System.out.println("\n Hi, "+name +" your tax details :");
           System.out.println("Income     :"+income);
           System.out.println("Deductions :"+deductions);
           System.out.println("Tax Amount :"+taxamt);
           
       }catch(RemoteException | NotBoundException e){
           System.out.println(e);
       }
   }
   
}

We are done with ItRmiClient class:


To Run the application:

First run the ItRmiServer Program (Open ItRmiServer)


Machine generated alternative text:
O it-rmi-sep.'er - NetBeans IDE 8.0.2 
File Edit View Navigate Source Refactor Run Debug Profile 
P roject s Files Services 
it-rmi-dient 
Sour ce Packages 
it.rmi.client 
ItRmiCIient.java 
Libr aries 
t-rmi-server 
Sour ce Packages 
it.rmi.server 
ItRmServer.java 
ItTaxCaI .java 
ItTaxCaIImp.java 
Libranes 
Team 
Tools Window Help 
ItRmServer .java 
Start Page 
Source History 
import java 
import java 
ItTaxCaI.java ItTaxCaIImp.java ItRmCIient.java 
. rmi . registry . LocateRegistry; 
. rmi . registry . Registry; 
Search (Ctrl +1) 
public class ItRmiServer 
public static void main (String CJ args) 
try ( 
Regist y registry—LocateRegistry. createRegistry (1099) ; 
ItTaxCa1 obi—new ItTaxCa11mp ( ) ; 
registry . bind ( " taxcal " 
obi) ; 
System. out . print In ( 
"RMI Server is started. 
catch (RemoteException I AlreadyBoundException e) 
System. out. print In (e) ; 
11:19 
it. rmi server ItRmiServer 
try 
registry

Right click and RunFile

Machine generated alternative text:
O it-rmi-sep.'er - NetBeans IDE 8.0.2 
File Edit View Navigate Source Refactor Run Debug Profile 
P roject s Files Services 
it-rmi-server 
Sour ce Packages 
it.rmi.server 
ItRmiServer.java 
ItTaxCaI.java 
ItTaxCaIImp.java 
Libraries 
Team 
Tools Window Help 
ItRmServer. java ItTaxCaI.java ItTaxCaIImp.java 
Start Page 
source History 
public class ItRmiServer 
public static void main (String C J args) 
Search (Ctrl+l) 
createRegistry(1099) ; 
s started. 
dException e) 
c 
try ( 
Regist 
It Tax 
regist 
Syste 
catch (Re 
Syste 
Navigate 
Show Java doc 
Find Usages 
Call Hierarchy 
Inset Code... 
Fix Imports 
Refactor 
Format 
Run File 
Debug File 
Test File 
Debug Test File 
Run Focused Test Method 
Debug Focused Test Method 
Run Into Method 
New Watch... 
Toggle Line Breakpoint 
Profiling 
Copy 
Paste 
Code Folds 
Select in Projects 
Alt* 
Alt* 
Alt* 
Inset 
Ctrl 
*Shift+l 
Alt* 
Shift* F 
Shift*F6 
Ctrl 
Ctrl* 
Ctrl 
it. rmi server ItRmiServer 
Output 
LAKSHMAN-LT - c: 'Users'LAKSHMAN-LT 
PMI Server LS started... 
12: lg 
4:41 AM 
3/10/2015 
*Shift* 
*Shift* 
Shift* 
x 
c 
v 
Ctrl 
Ctrl 
Ctrl 
Ctrl 
Ctrl

On console,  RMI server is started…….

Machine generated alternative text:
O it-rmi-sep.'er - NetBeans IDE 8.0.2 
File Edit View Navigate Source Refactor Run Debug Profile 
P roject s Files Services 
it-rmi-dient 
Sour ce Packages 
it.rmi.client 
ItRmiCIient.java 
Libr aries 
t-rmi-server 
Sour ce Packages 
it.rmi.server 
ItRmServer.java 
ItTaxCaI .java 
ItTaxCaIImp.java 
Libranes 
Team 
Tools Window Help 
ItRmServer .java 
Start Page 
Source History 
import java 
import java 
ItTaxCaI.java ItTaxCaIImp.java ItRmCIient.java 
. rmi . registry . LocateRegistry; 
. rmi . registry . Registry; 
Search (Ctrl+l) 
createRegistry(1099) ; 
public class ItRmiServer 
public static void main (String CJ args) 
try ( 
Registry registry—LocateRegistry 
ItTaxCa1 obi—new ItTaxCa11mp ( ) ; 
registry . bind ( " taxcal " 
obi) ; 
System. out . print In ( 
"RMI Server is started. 
catch (RemoteException I AlreadyBoundException e) 
System. out. print In (e) ; 
it. rmi server ItRmiServer 
Output 
LAKSHMAN-LT - c: 'Users'LAKSHMAN-LT 
PMI Server LS started... 
try obj 
it-rmi-server (run) 
it-rm-server (run)

Now RMI server is running successfully. To access RMI Service we we should run client class

Open ItRmiClient class, Riht click and click on Run file

Machine generated alternative text:
O it-rmi-client - NetBeans IDE 8.0.2 
File Edit View Navigate Source Refactor Run Debug Profile 
P roject s Files Services 
it-rmi-dient 
Sour ce Packages 
it.rmi. dient 
ItRmiCIient.java 
Libraries 
t-rmi-server 
Sour ce Packages 
it.rmi.server 
ItRmiServer .java 
ItTaxCaI. java 
ItTaxCaIImp.java 
Libranes 
Team 
Tools Window Help 
Start Page ItRmServer.java ItTaxCaI.java ItTaxCaIImp.java ItRmCIient.java 
Sour ce History 
Search (Ctrl+l) 
ub1ic class ItRmiC1ient 
public static void main (Strin 
CJ args) 
Registry . getRegistry ( 
" Iccalhcst " 
egistry . lookup ( 
" taxcal " 
ystem. in) ; 
r your name: " 
r Income 
r Deductions" 
tDoub1e ( ) ; 
-rmi-server (run) 
Navigate 
Show Javadoc 
Find Usages 
Call Hierarchy 
Inset Code... 
Fix Imports 
Refactor 
Format 
Run File 
Debug File 
Test File 
Debug Test File 
Run Focused Test Method 
Debug Focused Test Method 
Run Into Method 
New Watch... 
Toggle Line Breakpoint 
Profiling 
Paste 
Code Folds 
Select in Projects 
Alt* 
Alt* 
Alt* 
Inset 
Ctrl 
*Shift+l 
Alt* 
Shift* F 
Shift*F6 
Ctrl 
Ctrl* 
Ctrl 
, 1099); 
35: 1/35: 1208 
4:56 AM 
3/10/2015 
Output 
LAKSHMAN-LT - c: 'Users 
PMI Server LS s 
*Shift* 
*Shift* 
Shift* 
x 
c 
v 
Ctrl 
Ctrl 
Ctrl 
Ctrl 
Ctrl

Provide valid inputs:  

Based on your inputs tax calculation will be calculated and displayed on console.

Machine generated alternative text:
O it-rmi-client - NetBeans IDE 8.0.2 
File Edit View Navigate Source Refactor Run Debug Profile 
P roject s Files Services 
it-rmi-dient 
Sour ce Packages 
it.rmi. dient 
ItRmiCIient.java 
Libraries 
t-rmi-server 
Sour ce Packages 
it.rmi.server 
ItRmiServer .java 
ItTaxCaI. java 
ItTaxCaIImp.java 
Libranes 
Team 
Tools Window Help 
Start Page ItRmServer .java 
Sour ce History 
ItTaxCaI.java ItTaxCaIImp.java ItRmiCIient.java 
Search (Ctrl+l) 
System. 
double 
System. 
double 
double 
System. 
System. 
System 
System. 
out . print In ( 
"Enter Income 
income—sc . nextDoub1e ( ) ; 
out . print In ( 
"Enter Deductions " 
deductions—sc . nextDoub1e ( ) ; 
taxamt—obj . getTaxAmount (income, deductions) ; 
out 
out 
out 
out 
print In ( 
print In ( 
print In ( 
print In ( 
"X n Hi, 
' Income 
+name 
your tax details 
+income) , 
+deductions) ; 
+taxamt) ; 
"Deductions 
"Tax Arnount 
kzatch (RemoteExceotion I NotBoundExceotion e) 
it. rmi. client. ItRmiCIient 
Output 
LAKSHMAN-LT - C:WsersLAKSHMAN-LT it-rmi-server(run) it-rm-dient (run) 
Enter Deductions 
200000 
HI, Lakshman your tax details 
In come 
:4soooo.o 
Il seconds) 
it-rm-server (run) 
Deductions :200000.0 
Tax Amount : 75000.0 
BUILD SUCCESSFUL (total time:

No comments:

Post a Comment

Spring Boot 3 : JWT with SecurityFilterChain, AuthorizeHttpRequests, RequestMatchers

pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0...