Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Where does the LockManager class lie ? db.jar or Server.jar ?

 
Zhou Can
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the LockManager class should stay in db.jar ,but some one advise me to place it in the server.jar . Whitch is right ?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Zhou, how many jars do you have? You should only have 2 one for the client and one for the server. So in many cases the db and the server are the same jar. if you called you server.jar, db.jar.
Mark
 
Zhou Can
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the db.jar should be in two jar files , one is the server.jar and the other is the client.jar . Am i right ?
 
Charles Dupin
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the same problem about db classes available to the client in standalone mode.
In RMI server mode the client does not need the db classes, but in standalone mode the client accesses the server db classes. Is this right or not. For that I put the server.jar in the classpath of the client. Thanks for your advices.
Charles
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will put some of the db package classes in your client.jar.
You will need them for Local mode. You will also hav ethe _stubs from the server also in your client.jar
Zhou - Yes there are only two jars client.jar and server.jar, there is no db.jar unless you want to call your server.jar db.jar, which I think is a misnomer.
Mark
[ December 10, 2002: Message edited by: Mark Spritzler ]
 
Charles Dupin
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark,
As you say we need the stub implementation in the client jar, otherwwise it does not work, the RMI connection sends a Remote Exception. But how comes the stub must be in the client jar. Why isn't there a complete separation possible between client and server in remote mode? (interface in the client and implementation of the stub in the server). Sorry if this question looks stupid but I need an explanation here.
Thanks,
Charles.
 
Zhou Can
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Finally I put it in server.jar.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Charles, the reason is simple. In this assignment we are not using Dynamic Downloading of stub classes. In order to do that you would need a web server. Which of course most people don't keep in their back pockets.
So then the class would need to be accessible to the client, and the client.jar is the best place for this.
Mark
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BTW, I personally submitted three jars: a client, a server, and a shared jar with all the shared classes needed by both client and server. The Class-Path manifest attribute will glue the jars together.
- Peter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic