static Config updateConfigIfNeeded(final Config initConfig, final Target targetUtil, final String target) { Config result = initConfig; Config newConfig = targetUtil.getConfig(target); if (newConfig!=null) { result = newConfig; } return result; }
static Config chooseConfig(final Target targetService, Config config, final String target) { Config targetConfig = targetService.getConfig(target); if (targetConfig != null) { config = targetConfig; } return config; }
@Override public boolean preAuthorization(AdminCommandContext context) { final ActionReport report = context.getActionReport(); try { targetConfig = targetService.getConfig(target); if (targetConfig != null) { ms = targetConfig.getMonitoringService(); return true; } fail(report, "unknown.target", "Could not find target {0}", target); return false; } catch (Exception e) { fail(report, "target.service.exception", "Encountered exception trying to locate the MonitoringService element " + "in the target ({0}) configuration: {1}", target, e.getMessage()); return false; } }
@Override public boolean preAuthorization(AdminCommandContext context) { final ActionReport report = context.getActionReport(); try { targetConfig = targetService.getConfig(target); if (targetConfig != null) { ms = targetConfig.getMonitoringService(); return true; } fail(report, "unknown.target", "Could not find target {0}", target); return false; } catch (Exception e) { fail(report, "target.service.exception", "Encountered exception trying to locate the MonitoringService element " + "in the target ({0}) configuration: {1}", target, e.getMessage()); return false; } }
/** * Executes the command with the command parameters passed as Properties where the keys are the paramter names and * the values the parameter values * * @param context information */ @Override public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); Target targetUtil = habitat.getService(Target.class); Config newConfig = targetUtil.getConfig(target); if (newConfig!=null) { config = newConfig; } if (!"iiop-service".equals(type)) { if (listenerId == null) { report.setMessage(localStrings.getLocalString("create.ssl.listenerid.missing", "Listener id needs to be specified")); report.setActionExitCode(ActionReport.ExitCode.FAILURE); return; } } SslConfigHandler configHandler = habitat.getService(SslConfigHandler.class, type); if (configHandler!=null) { configHandler.create(this, report); } else if ("jmx-connector".equals(type)) { addSslToJMXConnector(config, report); } }
@Override protected void executeCommand(AdminCommandContext context, Properties extraProps) { Config config = targetUtil.getConfig(target); if (config == null) { context.getActionReport().setMessage("No such config named: " + target);
Config config = targetUtil.getConfig(target); System.out.println("** EXECUTING -d " + dataSourceLookupName + " -x " + executorServiceLookupName);
public void execute(AdminCommandContext context) { final Target targetUtil = habitat.getComponent(Target.class ) ; final Config config = targetUtil.getConfig(target ) ; final ActionReport report = context.getActionReport();
ActionReport report = context.getActionReport(); Target targetUtil = habitat.getService(Target.class); Config newConfig = targetUtil.getConfig(target); if (newConfig!=null) { config = newConfig;
/** * Executes the command * * @param context information */ @Override public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); final Target targetUtil = habitat.getComponent(Target.class ) ; final Config config = targetUtil.getConfig(target) ; final IiopService iiopService = config.getIiopService(); try { List<IiopListener> listenerList = iiopService.getIiopListener(); for (IiopListener listener : listenerList) { final ActionReport.MessagePart part = report.getTopMessagePart() .addChild(); part.setMessage(listener.getId()); } report.setActionExitCode(ActionReport.ExitCode.SUCCESS); } catch (Exception e) { report.setMessage(localStrings.getLocalString("list.iiop.listener" + ".fail", "List IIOP listeners failed.")); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(e); } } }
public void execute(AdminCommandContext context) { final Target targetUtil = habitat.getComponent(Target.class ) ; final Config config = targetUtil.getConfig(target) ; ActionReport report = context.getActionReport(); IiopService iiopService = config.getIiopService();