PatchOperationTarget createPatchOperationTarget(CommandContext ctx) throws CommandException { final PatchOperationTarget target; final ParsedCommandLine args = ctx.getParsedCommandLine(); if (ctx.getModelControllerClient() != null) { if (distribution != null) { throw new CommandException("--distribution is not allowed when connected to the controller."); } if (modulePath != null) { throw new CommandException("--module-path is not allowed when connected to the controller."); } if (bundlePath != null) { throw new CommandException("--bundle-path is not allowed when connected to the controller."); } if (ctx.isDomainMode()) { target = PatchOperationTarget.createHost(host, ctx.getModelControllerClient()); } else { target = PatchOperationTarget.createStandalone(ctx.getModelControllerClient()); } } else { final File root = getJBossHome(); final List<File> modules = getFSArgument(modulePath, args, root, "modules"); final List<File> bundles = getFSArgument(bundlePath, args, root, "bundles"); try { target = PatchOperationTarget.createLocal(root, modules, bundles); } catch (Exception e) { throw new CommandException("Unable to apply patch to local JBOSS_HOME=" + root, e); } } return target; }
PatchOperationTarget createPatchOperationTarget(CommandContext ctx) throws CommandException { final PatchOperationTarget target; final ParsedCommandLine args = ctx.getParsedCommandLine(); if (ctx.getModelControllerClient() != null) { if (distribution != null) { throw new CommandException("--distribution is not allowed when connected to the controller."); } if (modulePath != null) { throw new CommandException("--module-path is not allowed when connected to the controller."); } if (bundlePath != null) { throw new CommandException("--bundle-path is not allowed when connected to the controller."); } if (ctx.isDomainMode()) { target = PatchOperationTarget.createHost(host, ctx.getModelControllerClient()); } else { target = PatchOperationTarget.createStandalone(ctx.getModelControllerClient()); } } else { final File root = getJBossHome(); final List<File> modules = getFSArgument(modulePath, args, root, "modules"); final List<File> bundles = getFSArgument(bundlePath, args, root, "bundles"); try { target = PatchOperationTarget.createLocal(root, modules, bundles); } catch (Exception e) { throw new CommandException("Unable to apply patch to local JBOSS_HOME=" + root, e); } } return target; }
final List<File> bundles = getFSArgument(bundlePath, args, root, "bundles"); try { target = PatchOperationTarget.createLocal(root, modules, bundles); } catch (Exception e) { throw new CommandLineException("Unable to apply patch to local JBOSS_HOME=" + jbossHome, e);
final List<File> bundles = getFSArgument(bundlePath, args, root, "bundles"); try { target = PatchOperationTarget.createLocal(root, modules, bundles); } catch (Exception e) { throw new CommandLineException("Unable to apply patch to local JBOSS_HOME=" + jbossHome, e);