Posts

LOCATION TRACKER

Image
                                                                   LOCATION TRACKER USING RMI 1. Interface – LocationService.java import java.rmi.Remote; import java.rmi.RemoteException; public interface LocationService extends Remote {     String updateLocation(String deviceId, double latitude, double longitude) throws RemoteException;     String getLocation(String deviceId) throws RemoteException; } 2. Implementation – LocationServiceImpl.java import java.rmi.server.UnicastRemoteObject; import java.rmi.RemoteException; import java.util.HashMap; public class LocationServiceImpl extends UnicastRemoteObject implements LocationService {     private HashMap<String, String> locationMap;     protected LocationServiceImpl() throws RemoteException { ...

HEALTH ADMINISTRATION

Image
                                                         HEALTH ADMINISTRATION USING RMI 1.RMI Interface – HealthService.java import java.rmi.Remote; import java.rmi.RemoteException; public interface HealthService extends Remote {     String registerPatient(String name, int age, String condition) throws RemoteException;     String getPatientInfo(String name) throws RemoteException; } 2.Implementation of the service – HealthServiceImpl.java  import java.rmi.server.UnicastRemoteObject; import java.rmi.RemoteException; import java.util.HashMap; public class HealthServiceImpl extends UnicastRemoteObject implements HealthService {     private HashMap<String, String> patientRecords;     protected HealthServiceImpl() throws RemoteException {         super()...

LIBRARY MANAGEMENT SYSTEM

Image
                                                                                  LIBRARY MANAGEMENT USING RMI 1.Remote Interface - LibraryService.java import java.rmi.Remote; import java.rmi.RemoteException; import java.util.List; public interface LibraryService extends Remote {     String registerUser(String name) throws RemoteException;     String addBook(String title, String author) throws RemoteException;     String issueBook(String userName, String title) throws RemoteException;     String returnBook(String userName, String title) throws RemoteException;     List<Book> listBooks() throws RemoteException; } 2.Book data class - Book.java import java.io.Serializable; public class Book imp...