SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Sean Keane wrote:
Surely you would not want to allow the client running in network mode to write the cache back to the file. In order to prevent this, you would need to introduce a test somewhere in the client to either check what mode the client is running in, or check the underlying class of the instance of the business service you have. Neither which seem nice:
Roel De Nijs wrote:That's an easy one: Runtime.addShutdownHook to the rescue
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Roel De Nijs wrote:
Sean Keane wrote:Where in your code did you actually add the shut down hook Roel?
Data class constructor (so no need to expose the method in the business service)
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
OCPJP 6, OCMJD 6
Oladeji Oluwasayo wrote:What happens when a toddler of one of URLyBird workers manages to get to the system and pushes the power-off button, no shutdown hook will be executed!
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD