| | |
| | | import org.opends.messages.Message; |
| | | |
| | | /** |
| | | * An abstract class used to refactor some code between the start, stop and |
| | | * An abstract class used to re-factor some code between the start, stop and |
| | | * restart tasks. |
| | | * |
| | | */ |
| | |
| | | // To display new status |
| | | try |
| | | { |
| | | getInfo().regenerateDescriptor(); |
| | | getInfo().stopPooling(); |
| | | getInfo().regenerateDescriptor(); |
| | | |
| | | ArrayList<String> arguments = getCommandLineArguments(); |
| | | |
| | |
| | | arguments.toArray(args); |
| | | returnCode = executeCommandLine(getCommandLinePath(), args); |
| | | |
| | | if (returnCode != 0) |
| | | { |
| | | state = State.FINISHED_WITH_ERROR; |
| | | } |
| | | else |
| | | { |
| | | state = State.FINISHED_SUCCESSFULLY; |
| | | } |
| | | postCommandLine(); |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | |
| | | ArrayList<String> args = new ArrayList<String>(); |
| | | return args; |
| | | } |
| | | |
| | | /** |
| | | * Method called just after calling the command-line. To be overwritten |
| | | * by the inheriting classes. |
| | | */ |
| | | protected void postCommandLine() |
| | | { |
| | | if (returnCode != 0) |
| | | { |
| | | state = State.FINISHED_WITH_ERROR; |
| | | } |
| | | else |
| | | { |
| | | state = State.FINISHED_SUCCESSFULLY; |
| | | } |
| | | } |
| | | } |