Search in sources :

Example 6 with ConfigConfig

use of com.sun.appserv.management.config.ConfigConfig in project Payara by payara.

the class AMXTestBase method getModuleMonitoringLevelsConfig.

protected ModuleMonitoringLevelsConfig getModuleMonitoringLevelsConfig(final String configName) {
    final ConfigConfig cc = configName == null ? getConfigConfig() : getConfigConfig(configName);
    assert (cc != null);
    final ModuleMonitoringLevelsConfig mon = cc.getMonitoringServiceConfig().getModuleMonitoringLevelsConfig();
    return (mon);
}
Also used : ConfigConfig(com.sun.appserv.management.config.ConfigConfig) ModuleMonitoringLevelsConfig(com.sun.appserv.management.config.ModuleMonitoringLevelsConfig)

Example 7 with ConfigConfig

use of com.sun.appserv.management.config.ConfigConfig in project Payara by payara.

the class RunMeFirstTest method initCoverageInfos.

private void initCoverageInfos() {
    final Set<AMX> all = getAllAMX();
    // set the AMX-DEBUG flags on
    final String AMX_DEBUG = "-DAMX-DEBUG.enabled=true";
    final String AMX_DEBUG2 = "-DAMX-DEBUG=true";
    // set AMX-DEBUG.enabled=true in all ConfigConfig JVM options
    final Map<String, ConfigConfig> configs = getDomainConfig().getConfigsConfig().getConfigConfigMap();
    for (final ConfigConfig config : configs.values()) {
        final JavaConfig jc = config.getJavaConfig();
        final String[] opt = jc.getJVMOptions();
        final Set<String> jvmOptions = GSetUtil.newStringSet(opt == null ? new String[0] : opt);
        if (!(jvmOptions.contains(AMX_DEBUG) || jvmOptions.contains(AMX_DEBUG2))) {
            jvmOptions.add(AMX_DEBUG);
            jc.setJVMOptions(GSetUtil.toStringArray(jvmOptions));
            // don't warn for default-config; it's not used by a running server
            if (!config.getName().equals("default-config")) {
                warning("Enabled AMX-DEBUG for config " + config.getName() + " (restart required)");
            }
        }
    }
    // setup default stuff
    final AMXDebugSupportMBean debug = getAMXDebugSupportMBean();
    debug.setAll(true);
    debug.setDefaultDebug(true);
    debug.getOutputIDs();
    for (final AMX amx : all) {
        final AMXDebugStuff debugStuff = getTestUtil().asAMXDebugStuff(amx);
        if (debugStuff == null) {
            continue;
        }
        try {
            debugStuff.enableAMXDebug(true);
        } catch (Throwable t) {
            warning("Couldn't enableAMXDebug() for " + amx.getJ2EEType());
        }
        try {
            debugStuff.enableCoverageInfo(true);
            debugStuff.clearCoverageInfo();
        } catch (Throwable t) {
            warning("Couldn't enableCoverageInfo for " + amx.getJ2EEType());
        }
    }
}
Also used : JavaConfig(com.sun.appserv.management.config.JavaConfig) AMXDebugSupportMBean(com.sun.appserv.management.base.AMXDebugSupportMBean) AMXDebugStuff(org.glassfish.admin.amx.util.AMXDebugStuff) ConfigConfig(com.sun.appserv.management.config.ConfigConfig) AMX(com.sun.appserv.management.base.AMX)

Example 8 with ConfigConfig

use of com.sun.appserv.management.config.ConfigConfig in project Payara by payara.

the class ConfigConfigTest method ensureDefaultInstance.

public static ConfigConfig ensureDefaultInstance(final DomainRoot domainRoot) {
    ConfigConfig config = null;
    final DomainConfig domainConfig = domainRoot.getDomainConfig();
    final Map<String, ConfigConfig> existing = domainConfig.getConfigsConfig().getConfigConfigMap();
    if (supportsMultipleServers(domainRoot)) {
        config = existing.get(getDefaultInstanceName(domainRoot));
        if (config == null) {
            final ConfigSetup setup = new ConfigSetup(domainRoot);
            config = setup.createConfig(getDefaultInstanceName(domainRoot));
        }
    } else {
        config = existing.get(PE_CONFIG_NAME);
        assert (config != null) : "No config named " + StringUtil.quote(PE_CONFIG_NAME);
    }
    return config;
}
Also used : ConfigConfig(com.sun.appserv.management.config.ConfigConfig) DomainConfig(com.sun.appserv.management.config.DomainConfig)

Example 9 with ConfigConfig

use of com.sun.appserv.management.config.ConfigConfig in project Payara by payara.

the class ConfigConfigTest method testCreateRemove.

public void testCreateRemove() throws Throwable {
    if (!checkNotOffline("testCreateRemove")) {
        return;
    }
    final String NAME = "ConfigConfigTest.testCreateRemove";
    final Map<String, ConfigConfig> before = getDomainConfig().getConfigsConfig().getConfigConfigMap();
    final int NUM = 2;
    final ConfigConfig[] configs = new ConfigConfig[NUM];
    for (int i = 0; i < NUM; ++i) {
        configs[i] = create(NAME + i);
    }
    final ConfigSetup setup = new ConfigSetup(getDomainRoot());
    for (final ConfigConfig config : configs) {
        setup.removeConfig(config.getName());
        // verify that the config is gone
        try {
            Util.getExtra(config).getAllAttributes();
            fail("Config " + config.getName() + " should no longer exist");
        } catch (Exception e) {
        // good, we expected to be here
        }
    }
    final Map<String, ConfigConfig> after = getDomainConfig().getConfigsConfig().getConfigConfigMap();
    assert (before.keySet().equals(after.keySet()));
}
Also used : ConfigConfig(com.sun.appserv.management.config.ConfigConfig)

Example 10 with ConfigConfig

use of com.sun.appserv.management.config.ConfigConfig in project Payara by payara.

the class ConfigRunMeFirstTest method setupConfig.

private void setupConfig() {
    final DomainConfig dc = getDomainConfig();
    final ConfigConfig cc = getConfigConfig();
    final SecurityServiceConfig ss = cc.getSecurityServiceConfig();
    final AdminServiceConfig as = cc.getAdminServiceConfig();
    AuditModuleConfigTest.ensureDefaultInstance(ss);
    AuthRealmConfigTest.ensureDefaultInstance(ss);
    ConnectorConnectionPoolConfigTest.ensureDefaultInstance(dc);
    JMXConnectorConfigTest.ensureDefaultInstance(as);
    ResourceAdapterConfigTest.ensureDefaultInstance(dc);
    AdminObjectResourceConfigTest.ensureDefaultInstance(dc);
    JDBCConnectionPoolConfigTest.ensureDefaultInstance(dc);
    JDBCResourceConfigTest.ensureDefaultInstance(dc);
    JNDIResourceConfigTest.ensureDefaultInstance(dc);
    ConnectorResourceConfigTest.ensureDefaultInstance(dc);
    CustomMBeanConfigTest.ensureDefaultInstance(dc);
    JACCProviderConfigTest.ensureDefaultInstance(ss);
    MailResourceConfigTest.ensureDefaultInstance(dc);
    ThreadPoolConfigTest.ensureDefaultInstance(cc);
    PersistenceManagerFactoryResourceConfigTest.ensureDefaultInstance(dc);
    CustomResourceConfigTest.ensureDefaultInstance(dc);
    ProfilerConfigTest.ensureDefaultInstance(cc.getJavaConfig());
}
Also used : AdminServiceConfig(com.sun.appserv.management.config.AdminServiceConfig) ConfigConfig(com.sun.appserv.management.config.ConfigConfig) SecurityServiceConfig(com.sun.appserv.management.config.SecurityServiceConfig) DomainConfig(com.sun.appserv.management.config.DomainConfig)

Aggregations

ConfigConfig (com.sun.appserv.management.config.ConfigConfig)12 DomainConfig (com.sun.appserv.management.config.DomainConfig)2 SecurityServiceConfig (com.sun.appserv.management.config.SecurityServiceConfig)2 StandaloneServerConfig (com.sun.appserv.management.config.StandaloneServerConfig)2 AMX (com.sun.appserv.management.base.AMX)1 AMXDebugSupportMBean (com.sun.appserv.management.base.AMXDebugSupportMBean)1 AppserverConnectionSource (com.sun.appserv.management.client.AppserverConnectionSource)1 AdminServiceConfig (com.sun.appserv.management.config.AdminServiceConfig)1 DiagnosticServiceConfig (com.sun.appserv.management.config.DiagnosticServiceConfig)1 JavaConfig (com.sun.appserv.management.config.JavaConfig)1 ModuleMonitoringLevelsConfig (com.sun.appserv.management.config.ModuleMonitoringLevelsConfig)1 NodeAgentConfig (com.sun.appserv.management.config.NodeAgentConfig)1 ResourceRefConfig (com.sun.appserv.management.config.ResourceRefConfig)1 HashMap (java.util.HashMap)1 AMXDebugStuff (org.glassfish.admin.amx.util.AMXDebugStuff)1