Remote Interface
Listing 9.2 CustomInterface.java
import java.rmi.*;
import java.util.*;
//Remote interface
public interface CustomInterface
extends Remote{
//method used to get the list of products
public Vector getList()
throws RemoteException;
//method called by clients to submit information
public String submit(Customer cm)
throws RemoteException;
}
The above interface declares two methods:
The getList() method returns a Vector
of items sold by the company. The submit()
method takes a Customer object as argument
and returns a string containing information related to the customer.
|