suncertify.server
-----------------
public interface DataInterfaceFactory extends Remote - One method defined here
(public DataInterface getDatabaseInstance() throws RemoteException).
public class FBNServer extends UnicastRemoteObject implements DataInterfaceFactory - Just returns
a new DataInterface
public class RemoteDataImplementation extends UnicastRemoteObject implements DataInterface - The
database instance that is passed to each client
Originally posted by Amish Patel:
Hi Miguel,
I have couple of questions regarding the following statement
1) For your FBNServer you are going to return new DataInterface? Why? Shouldn't you be returning the same RemoteObject that the first client created for a particular filePath? Meaning Client A connects Remotely to a server he gets a RemoteData, Client B connects remotely to the same server he should also get the same RemoteData correct?
2) What are the flow of things that happen when a remote client tries to connect?
Please explain
Thanks
Amish
The Data for now is still static and if we want to add "db1.db" we add a new static Data to the FBNServer and a new method to the DataInterfaceFactory that will return a new instance of RemoteDataInterface but with a new Data.
Free software is a matter of liberty, not price.
Free software is a matter of liberty, not price.
suncertify.db.table
public class DataTableModel
LocalDatabaseImplementation
a toolbar on the top with 4 buttons (search, reserve, help and exit).
public class FBNAsksNumberOfSeatsToReserve extends JDialog
public class NoSeatsAvailableException extends Exception
public class NotEnoughSeatsAvailableException extends Exception
The only that accepts command line parameters is the server that wants the database location.
For the FBNServer i've used a RMI Factory so that any client that connects to the server gets a new RemoteDataImplementation. With this, I will have the clientID that's needed in order to lock and unlock the records.
Free software is a matter of liberty, not price.
SCJP, SCJD, SCEA 5 "Any sufficiently analyzed magic is indistinguishable from science!" Agatha Heterodyne (Girl Genius)
Regarding the server accepting parameters, what would be the point for doesn't accept parameters if the server can open multiple databases?
One approach is to start the server with the database names as parameters. Another approach is to start the server without any parameters and let the client request a particular database. The latter approach doesn't preclude the server from serving multiple database files.
Free software is a matter of liberty, not price.
So what you mean is
network
java client.jar www.server.com 1234 c:\tmp\db.db
local
java client.jar c:\tmp\db.db
Free software is a matter of liberty, not price.
I think that what Eugene means is:
Network
java -jar client.jar db.db
Local
java -jar client.jar c:\tmp\db.db
In server mode, the server knows where to look for the database file (i.e. the server knows the directory where the database files are) and when a client requests to open one database, the server looks to see if the database as already been opened or not. If opened, it returns a instance to the remote Data and if not opened, the server opens the database and returns the instance of the database to the client.
Am I right Eugene?
In server mode, the server knows where to look for the database file (i.e. the server knows the directory where the database files are) and when a client requests to open one database, the server looks to see if the database as already been opened or not.
Free software is a matter of liberty, not price.