• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

When is a server not a server?

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,
I've not written a server before, and I'm wondering if this design constitutes a server as required by the project.
~~~~~~~~~~~
Remote mode
I have a class called Server, which when instantiated simply creates a LockManager object and a ConnectionFactory object and binds LockManager and ConnectionFactory to the RMIRegistry
A client contacts the RMIRegistry to request a Connection object from the ConnectionFactory
A Connection object implements a RemoteDataInterface and has a reference to the LockManager.
A Connection object provides remote access to the database.
LockManager tracks database locks from multiple clients
Once a client has a Connection object, it accesses the database (and the LockManager) via the Connection object.
~~~~~~~~~~~
Server, LockManager, ConnectionFactory and Connection are all separate classes. Server simply launches LockManager and ConnectionFactory, and they provide mechanisms for doing the rest (ie accessing the database, locking and unlocking records).
Am I missing something? Should I have my clients going through the Server to access the ConnectionFactory and LockManager? Or, is it ok for the clients to contact the ConnectionFactory and LockManager directly?
cheerio
Rowan
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When it's a client!
You model looks great. Actually the client is getting a stub to the remote object. SO actually it is calling those methods remotely. And yes what you have called a sever is the server.
Do you start the Registry in your server code? or do you start it from the command line?
Mark
[ February 19, 2002: Message edited by: Mark Spritzler ]
[ February 19, 2002: Message edited by: Mark Spritzler ]
 
Rowan Brownlee
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the RMI correction, Mark. Right now, I'm starting a registry in my server code, though I've not yet thought much about the various command line options.
cheerio
Rowan
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No actually it is better to start it up in code.
What you might find yourself needing is a simple GUI for the server, so that when you want to stop and shutdown the server, you can with a menu option or a button, then you can close the database gracefully. Hint lock(-1).
Mark
 
reply
    Bookmark Topic Watch Topic
  • New Topic