@Override public boolean preAuthorization(AdminCommandContext context) { config = CLIUtil.updateConfigIfNeeded(config, targetService, target); jc = config.getJavaConfig(); return true; }
/** * Report the JavaConfig beans for each config. <p> Lets the caller command * prepare access checks for security authorization. * * @return */ public Collection<JavaConfig> getJavaConfigs() { final Collection<JavaConfig> result = new ArrayList<JavaConfig>(); for (Config c : configs.getConfig()) { if (c.getJavaConfig() != null) { result.add(c.getJavaConfig()); } } return result; }
@Override public boolean preAuthorization(AdminCommandContext context) { config = CLIUtil.updateConfigIfNeeded(config, targetService, target); jc = config.getJavaConfig(); return true; }
@Override public boolean preAuthorization(AdminCommandContext context) { config = CLIUtil.chooseConfig(targetService, config, target); javaConfig = config.getJavaConfig(); return true; }
@Override public boolean preAuthorization(AdminCommandContext context) { config = CLIUtil.updateConfigIfNeeded(config, targetService, target); jc = config.getJavaConfig(); return true; }
@Override public boolean preAuthorization(AdminCommandContext context) { config = CLIUtil.chooseConfig(targetService, config, target); javaConfig = config.getJavaConfig(); return true; }
@Override public void postConstruct() { // the 'prevent' defense if (configs == null || configs.getConfig() == null || configs.getConfig().isEmpty()) { return; } try { for (Config c : configs.getConfig()) { JavaConfig jc = c.getJavaConfig(); if (jc == null) { continue; } // fix issues where each new config gets 2x, 3x, 4x the data newJvmOptions.clear(); oldJvmOptions = Collections.unmodifiableList(jc.getJvmOptions()); doAdditions("server-config".equals(c.getName())); doRemovals(); ConfigSupport.apply(new JavaConfigChanger(), jc); } } catch (Exception e) { getLogger().log(Level.SEVERE, JVM_OPTION_UPGRADE_FAILURE, e); throw new RuntimeException(e); } }
logger = context.getLogger(); javaEnabledOnCmd = Boolean.parseBoolean(ctx.getArguments().getProperty("-debug")); javaConfig = config.getJavaConfig(); jpdaEnabled = javaEnabledOnCmd || Boolean.parseBoolean(javaConfig.getDebugEnabled()); int debugPort = parsePort(javaConfig.getDebugOptions());
@Override public void postConstruct() { domain = habitat.getService(Domain.class); cluster = habitat.getService(Cluster.class, ServerEnvironment.DEFAULT_INSTANCE_NAME); config = habitat.getService(Config.class, ServerEnvironment.DEFAULT_INSTANCE_NAME); server = habitat.getService(Server.class, ServerEnvironment.DEFAULT_INSTANCE_NAME); jc = config.getJavaConfig(); if (jc != null) { // register to listen for config events on the JavaConfig ((ObservableBean)ConfigSupport.getImpl(jc)).addListener(this); } if (jc != null && jc.getJvmOptions() != null) { oldProps = new ArrayList<String>(jc.getJvmOptions()); //defensive copy oldAttrs = collectAttrs(jc); } transactions.addListenerForType(SystemProperty.class, this); }
public static void addIndex(Config c, ServiceLocator habitat, String name) { ServiceLocatorUtilities.addOneDescriptor(habitat, BuilderHelper.createConstantDescriptor(c, name, Config.class)); // directly referenced objects ConfigBeanProxy dirref[] = { c.getAdminService(), c.getAvailabilityService(), c.getDiagnosticService(), c.getHttpService(), c.getJavaConfig(), c.getLogService(), c.getNetworkConfig(), c.getSecurityService(), c.getThreadPools(), c.getMonitoringService(), }; for (ConfigBeanProxy cbp : dirref) { if (cbp != null) { ServiceLocatorUtilities.addOneDescriptor(habitat, BuilderHelper.createConstantDescriptor(cbp, name, ConfigSupport.getImpl(cbp).getProxyType())); } } // containers for (Container extension : c.getContainers()) { ServiceLocatorUtilities.addOneDescriptor(habitat, BuilderHelper.createConstantDescriptor(extension, name, ConfigSupport.getImpl(extension).getProxyType())); } }