import java.rmi.*; public interface DShared extends Remote { // status indicators: all non-blocking: int capacity() throws RemoteException; int waiting() throws RemoteException; int busy() throws RemoteException; int empty() throws RemoteException; // produces resource, blocks if empty()<1, returns id uniquely identifying // this resource as part of the pool: int produce(Resource R) throws RemoteException; // Attempt to consume resource, blocks if none are available, returns // resource id, which can be acquired by get. int consume() throws RemoteException; //, InterruptedException;; // when finished with resource, call (non-blocking) void finished(int rid) throws RemoteException; // returns resource indicated by resource id, returns null if not valid. // this is always a non-blocking call. Resource getresource(int rid) throws RemoteException; // blocks calling thread until all resources in pool have been consumed // (finished). returns total number of resources consumed in life time of // resource pool. int joinall()throws RemoteException; } // shared by server and client