Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

server shutdown -> can i rely the client or does administrator be a remote fellow

 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



My ConnectionFactoryImpl implements two interfaces ConnectionFactory having a getConnection(String) and a ConnectionManager having a shutDown() as above.

both these methods are synchronized in ConnectionFactory and the shutdown method will loop thr' its filename_DataInterfacePlusLockManager Map and try to obtain a DATABASE_LOCK on all the DataInterfaces . note though, it wont "wait", till all the locks are obtained for all the datafiles. so, as getConection and shutdown are synchornized, no new connections can take effect. and the server(ConnectionManager) will shutodwn gracefully.
My main concern is:-
1. Can i make the shutDown public in ConnectionFactoryImpl . what if the client calls it. but the idea soundswondeful to me, ie., to do a shutdown from any remote machine. but as the ConnectionManager is public i cant narrow its scope in the ConnectionFactoryImpl.
removing the shutdown altogether wont be a an awkward way, but that will be my last fort.
your comments will boost me a lot! help!!
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
on afterthoughts:-
1) i thought of changing the method signature in ConnectionManager to shutDown(String userName, String password) but i wont check it in my ConnectionFactoryImpl(which is also behvaes like a virtual ConnectionManagerImpl).
2) have a getDbFiles method in ConnectionFactoryImpl and loop thr' and acquire a DATABASE_LOCK till exhausting the DbFiles. but NOTHING prevents me the ConectionFactoryImpl from issuing a new connection(RemoteDataInterface), when this dbFile looping is performing. ie., no other class can keep the dbFiles collection upto-date.
the "Information expert", "reponsibility based classes" all indicate the shutdown would be rightfully placed in the ConnectionFactoryImpl.
currently i am planning to go with shutdown(String,String) !!!

Please put in your thoughts and let me get some new ideas.
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am just think , if every Tom,Dick and Harry can get a connection using getConnection(Srting) of the ConnectionFactory note it's NOT getConnectin(Srting , String userName, String password) so why not just shutdown().
Keeping my fingers crossed, waiting for a notify
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any one have any standards for this.
looking for some help!
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need the shutDown() method, -- this is outside of the requirements and it adds nothing to simplicity, flexibility, and reusability of your design. Better put your energy into MVC.
Eugene.
[ March 19, 2003: Message edited by: Eugene Kononov ]
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Eugene Kononov:
You don't need the shutDown() method, -- this is outside of the requirements and it adds nothing to simplicity, flexibility, and reusability of your design.
Eugene.
[ March 19, 2003: Message edited by: Eugene Kononov ]

thats good to hear. to rephrase, i will give the option to start the server and when he wants to shutdown , i will blindly call unbind, is that right. (equivalent to SHUTDOWN IMMEDIATE in oralce and not shutdown transactional). is that right??

Better put your energy into MVC.

i think , maybe, i have become an expert in MVC after your and Marks valuable guides. finally i have implemented the hook as Mark adviced and using Observer-Observable (a push from model, including the startup values). no hardcoding in the Views, except the hateful ANY. doing fine!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic