Close the connection that is created for the task, once the task is over. This is required when we are using the Tool classes in embedded mode.
| | |
| | | } |
| | | } |
| | | |
| | | LDAPConnection conn = null; |
| | | try { |
| | | LDAPConnection conn = argParser.connect(out, err); |
| | | conn = argParser.connect(out, err); |
| | | TaskClient tc = new TaskClient(conn); |
| | | TaskEntry taskEntry = tc.schedule(this); |
| | | Message startTime = taskEntry.getScheduledStartTime(); |
| | |
| | | Message message = e.getMessageObject(); |
| | | if (err != null) err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | ret = 1; |
| | | } finally |
| | | { |
| | | if (conn != null) |
| | | { |
| | | try |
| | | { |
| | | conn.close(null); |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | // Ignore. |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | ret = processLocal(initializeServer, out, err); |