class NotifyTaskStrategy implements ITaskProcessStrategy {

    @Override
    public void process(final ITaskExecutionState state)
            throws TaskExecutionException, InvalidArgumentException, TaskProcessException {
        try {
            state.getTaskAs(IShutdownAwareTask.class).notifyShuttingDown();
        } catch (ShutdownAwareTaskNotificationException e) {
            throw new TaskProcessException(e);
        }

        state.execute();
    }

}