• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: File Synchronization #1

 
Javini Javono
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
File Synchronization #1
For the assignment, I understand exactly what Sun wants,
or at least I think I do; and, that requirement is that
the file not be corrupted, and that three methods will
be used to enforce this: lock(), unlock(), and isLocked().
For my design, these three methods, and the DBMain Java
interface as a whole are considered "low level" methods.
Another class, a singleton, will control access to Data
(which implements DBMain). In this respect, Data will
not have public methods (even though its methods are
declared public, only the controlling class will directly
call Data's methods.
Also,in my design, the server and the database file are
always running on the same machine within the same JVM.
I understand, from writing servlets, how to make a Java
class thread safe.
My first question, and rather elementary, is that if my
server uses RMI, are the server's remote methods multi-threaded
just as a servlet is?
I would assume so, but I'm just checking.
Thanks,
Javini Javono
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

My first question, and rather elementary, is that if my
server uses RMI, are the server's remote methods multi-threaded
just as a servlet is?

I think yes. One of the advantages of using RMI is that, RMI abstracts the socket layer, and handles multiple socket connections, marshall objects etc for the developer, so that developers can focus on the system's functionalites, rather than Network connectivity.
Nick.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic