SCJP, SCJD, SCWCD, SCBCD
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
SCJP, SCJD, SCWCD, SCBCD
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
SCJP, SCJD, SCWCD, SCBCD
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
SCJP, SCJD, SCWCD, SCBCD
SCJP, SCJD, SCWCD, SCBCD
Nope, under Unix it is SIG-INT which can be triggered in many ways, Ctrl-C being one of them. More importantly (from a server application perspective), SIG-INT can be triggered by UPS monitoring software or by server shutdown, or by another application (e.g. a command center application controlling all server processes). Which, in my personal opinion is a very good thing - we could have a clean B&S server shutdown if the power goes out, rather than having someone try and shut down via a server gui (that wont even be viewable because the screens wont have power :roll: )You are right. Under Unix it's Ctrl+D isn't it?
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
There is some discussion and sample code here.I have no clue what to do with the Runtime.addShutDownHook .
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
... - my reading of them seems to imply that a GUI is required for server startup, in which case you can use the same GUI for shutdown - ...
Also big note: this is getting a bit beyond the requirements of the assignments you have been given. Shutting down cleanly is something you really should do, and I offered this as a suggestion if you did have your users hitting Ctrl-C to exit the server. However if you have a GUI with an exit button, then you can save yourself a lot of work
SCJP, SCJD, SCWCD, SCBCD
I would say don't bother with graceful server shutdown, or server GUI, or calling lock(-1), or dead users. Those are the bells and whistles that are beyond your requirements and they add nothing to the clarity/reusability of the design. I did none of them, and got a maximum score for my server design. ...
SCJP, SCJD, SCWCD, SCBCD
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
SCJP, SCJD, SCWCD, SCBCD
Consider Paul's rocket mass heater. |