ModeShape/modeshape — pull request #833 by albertdev (2013-05-29 14:03:40+00:00)
Title: MODE-1948 Fix resource adapter shutdown procedure

The resource adapter used to make 2 instance and close one which wasn't used
anyway. The code has only one engine now, and it is shut down when the resource
adapter's stop() method is called.

Since the RA's stop() method can be called from a shutdown hook, new background threads will be forcibly halted before their work completes. The stop code now waits for 30 seconds on the background thread, but when the shutdown takes more than 30 seconds, it will simply log the time out exception as a warning for the user.

This commit also adds some extra debug logging to know when the shutdown method
gets called. I could see how this is useful for someone embedding Modeshape to check if their shutdown procedure works.

Oh, and one last note: I recycled some I18N constants because they matched 99%. If anyone wants to make more specific error messages, please do so.