This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Just wondering which of the following is correct for a multi-threaded server in RMI or neither.
I could call the RMI connection in package remote from client GUI like this and assumed server started.
Now does it automatically create a multi-threaded server. using following in the GuestConnector class in remote package.
or does it require the creation of a thread each time this GuestConnector class is called in order to run.
(1) ensure class implements Runnable interface.
Does RMI automatically create new threads for user or does one have to create multi-threaded server as in b.
Please note I am also sharing the one object amongst threads. (hopefully)
Champion, no need to worry. RMI automatically creates a new Thread for each request. Your job will be to make sure that your server handles these Threads/requests properly, which is where your locking mechanism fits in.
Maybe the RMI tutorial from Sun is useful for you. It shows you how simple it is to setup a rmi-server. And like Roberto said: your task (a not so easy one) is to handle the multiple requests properly.