1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// // // // // // |
This class implements the remote interface for use as an RMI remote object. It supports multiple users by using an array of the 'connectPSE' connection object, which contains the logic for database assess and data retrieval. The separate interface class defines those methods which are available to the client (with no programming logic). |
|||||||||||||||||||
import java.util.*; import java.rmi.*; import COM.odi.*; |
//for Vector //ObjectStore PSE classes |
|||||||||||||||||||
public class remotePSE extends UnicastRemoteObject implements interfacePSE {
|
||||||||||||||||||||
public remotePSE() throws RemoteException {} public void setMainThread(Thread thread) { |
// default constructor |
|||||||||||||||||||
// // // |
mainThread = thread; |
|||||||||||||||||||
// |
||||||||||||||||||||
public int openDatabase() throws RemoteException {
|
||||||||||||||||||||
PSEthread[connectionID].start(); PSEthread[connectionID].openDatabase(); return connectionID; |
||||||||||||||||||||
} |
||||||||||||||||||||
public Vector getMoleculeList(int id) throws RemoteException {
|
||||||||||||||||||||
return PSEthread[id].getData(molName); |
||||||||||||||||||||
|
||||||||||||||||||||
Fig 13. Java Code for the Remote Object |