| | |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message); |
| | | } |
| | | |
| | | |
| | | // Try to load the specified class. |
| | | Class<?> taskClass; |
| | | try |
| | |
| | | message); |
| | | } |
| | | |
| | | |
| | | // Instantiate the class as a task. |
| | | Task task; |
| | | try |
| | |
| | | message); |
| | | } |
| | | |
| | | |
| | | // Perform the necessary internal and external initialization for the task. |
| | | try |
| | | { |
| | |
| | | message); |
| | | } |
| | | |
| | | |
| | | task.setOperation(operation); |
| | | task.initializeTask(); |
| | | |
| | | // Avoid task specific initialization for completed tasks. |
| | | if (!TaskState.isDone(task.getTaskState())) { |
| | | task.initializeTask(); |
| | | } |
| | | task.setOperation(null); |
| | | |
| | | return task; |
| | | } |
| | | |