Forums Register Login

Remote Interface

+Pie Number of slices to send: Send
For the Java Developer project, I am writing a remote interface. The remote interface looks like as below:
public interface DBI extends java.rmi.Remote{
public FieldInfo[] getFieldInfo() throws java.rmi.RemoteException;
//other methods of Data Class go here that
//will throws RemoteException
}
Next, I write a class called Server that implements the remote interface as below:
public class Server extends UnicastRemoteObject
implements DBI {
public FieldInfo [] getFieldInfo() throws RemoteException {
return description;
}
//all other methods found in remote
//interface go here
}
I have two queries:
Query 1: I am unable to compile the class Server because in the method getFieldInfo(), the variable description is not found. This description variable is found in the Data class as below:
private FieldInfo [] description;
Is that correct that I have to copy the above description variable and put that variable in the interface DBI or do I put this variable in the class Server that implements the interface?
Query 2: Is it OK that I used the same method name found in the Data class and used the same method name in the Remote interface or should I be using a different method name?
+Pie Number of slices to send: Send
Hi Tim:
You Server object has not done any bussinesses with Data class, how can you get the vriable?
could you say it clearly?
Maybe you need a refernce of Data object in your Server class, and you can get the FieldInfo[] through the reference!
+Pie Number of slices to send: Send
OK, I understand that I will have to create an object of the Data class in the Server class but I am still unable to access the description variable found in the Data class because the description variable is a private field.
+Pie Number of slices to send: Send
I create a reference to Data Class in the constructor of RemoteDataAccess i.e

RemoteServer interface have all PUBLIC method of Data class.
[ December 10, 2002: Message edited by: Jawad Kakar ]
Blueberry pie is best when it is firm and you can hold in your hand. Smell it. And smell this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 743 times.
Similar Threads
Data Interface definition for server and client
Remote Interface
Trying to instantiate my middle tier class??see code
Final design
Design questions (with RMI)
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 19:03:57.