| | |
| | | /** The sub-command handler. */ |
| | | private final SubCommandHandler handler; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new sub-command handler call-back. |
| | | * |
| | |
| | | this.handler = handler; |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public MenuResult<Integer> invoke(ConsoleApplication app) |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * The interactive mode sub-menu implementation. |
| | | */ |
| | |
| | | /** The menu. */ |
| | | private final Menu<Integer> menu; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new sub-menu implementation. |
| | | * |
| | |
| | | this.menu = builder.toMenu(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final MenuResult<Integer> invoke(ConsoleApplication app) |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Provides the command-line arguments to the main application for |
| | | * processing and returns the exit code as an integer. |
| | |
| | | OutputStream errStream) |
| | | { |
| | | JDKLogging.disableLogging(); |
| | | DSConfig app = |
| | | new DSConfig(System.in, outStream, errStream); |
| | | final DSConfig app = new DSConfig(System.in, outStream, errStream); |
| | | app.sessionStartTime = System.currentTimeMillis(); |
| | | /* |
| | | * FIXME: obtain path info from system properties. |
| | |
| | | * The factory which the application should use to retrieve its management |
| | | * context. |
| | | */ |
| | | private ManagementContextFactory factory = null; |
| | | private LDAPManagementContextFactory factory = null; |
| | | |
| | | /** |
| | | * Flag indicating whether or not the global arguments have already been |
| | |
| | | retCode = runSubCommand(handler); |
| | | } |
| | | |
| | | try { |
| | | // Close the Management context ==> an LDAP UNBIND is sent |
| | | factory.close(); |
| | | } catch (Exception e) { |
| | | // Nothing to report in this case |
| | | } |
| | | factory.close(); |
| | | |
| | | return retCode; |
| | | } |
| | |
| | | String[] allArgsArray = allArguments.toArray(new String[]{}); |
| | | |
| | | int exitCode = main(allArgsArray, getOutputStream(), getErrorStream()); |
| | | if (exitCode != 0) |
| | | if (exitCode != ReturnCode.SUCCESS.get()) |
| | | { |
| | | System.exit(filterExitCode(exitCode)); |
| | | } |