Best practices for shutting down workers

Is there anything I should do to cleanly shutdown a workflow or activity worker?

I believe the following should work:

workerFactory.shutdown();
workerFactory.awaitTermination(terminationTimeout, TimeUnit.SECONDS);