I am working in the SCJD, URLyBirds, and i have choice the socket solution for comunication.
My server work fine, I can stand up many clients via sockets, and manage the registry system lock.
I have used for registry lock a HashTable, where know the registry number lock at moment and your self cookie lock.
Now, my problem is when I try run a client local, standalone client, the local client can`t see the table where are the locks for remote clients, (sockets solutions)
Q1: when sun (oracle now ) say for local client : " the networking must be bypassed entirely." so i cant create a new client via socket where the ip =localhost?
as Jboss made? (the socket solution is a mini-server finally, so i could connect locally via localhost if server ip is equals to client ip or not is apropiate solution?)
Q2: RMI is best solution for this problem? any help?
Thanks, and I sorry my level of English but my first lenguage is the Spanish , and I not use Google traductor, any times is dangerous
1/ You are not supposed to run a standalone client together with a network server. So if you run your standalone client you'll need to bypass the network code, and that's it. You are guaranteed that no other program will be using the database file, so the network server can NOT be running (your instructions clearly state: "You may assume that at any moment, at most one program is accessing the database file;")
2/ RMI or sockets: that's completely up to you. Make your choice and document this decision in choices.txt
I have a Hashtable in my database file access who work is only know who are lock any register (room in database).
When run my clien in remote mode , is fine, because i am manage every client via my server , because I use the some database file acces (final and static class)
But, when run the local client, this manage another instance for database file access (also final and static, obvious jeje), some how I will do for manage the some instance for local and remote, is this posible?, or I need a new manner for manage this problem?
I have just one Data class which is used in network and standalone mode. I don't think you want to develop a complete new Data class just for the standalone mode. Because it will have a lot of code duplication (and that's a bad idea, as you know)
Roel, my database file access is the some class , for local and remote!!. I will be very dumb if create 2 diferents database file access.
The next is the correct view of my solution to urlYBird proyect