Search in sources :

Example 1 with ConnectorResourceConfig

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

the class ConnectorResourceConfigTest method createProgeny.

protected final AMXConfig createProgeny(final String name, final Map<String, String> options) {
    final String poolName = ConnectorConnectionPoolConfigTest.ensureDefaultInstance(getDomainConfig()).getName();
    assert (getDomainConfig().getResourcesConfig().getConnectorResourceConfigMap().get(name) == null) : "A resource already exists with name: " + name;
    final Set<ResourceRefConfig> resourceRefs = getQueryMgr().queryJ2EETypeNameSet(XTypes.RESOURCE_REF_CONFIG, name);
    ConnectorResourceConfig config = null;
    final Set<ObjectName> resourceRefObjectNames = Util.toObjectNames(resourceRefs);
    if (resourceRefs.size() != 0) {
        assert (false);
        warning("A DANGLING resource ref already exists with name: " + name + ", {" + CollectionUtil.toString(resourceRefObjectNames) + "} (SKIPPING TEST)");
    } else {
        config = getDomainConfig().getResourcesConfig().createConnectorResourceConfig(name, poolName, options);
        final Set<ResourceRefConfig> refs = getQueryMgr().queryJ2EETypeNameSet(XTypes.RESOURCE_REF_CONFIG, name);
        if (resourceRefs.size() != 0) {
            final ResourceRefConfig ref = refs.iterator().next();
            warning("A resource ref within " + Util.getObjectName(ref.getContainer()) + " was automatically created when creating the ConnectorResourceConfig ");
        }
    }
    addReference(config);
    return (config);
}
Also used : ConnectorResourceConfig(com.sun.appserv.management.config.ConnectorResourceConfig) ResourceRefConfig(com.sun.appserv.management.config.ResourceRefConfig) ObjectName(javax.management.ObjectName)

Example 2 with ConnectorResourceConfig

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

the class ConnectorResourceConfigTest method ensureDefaultInstance.

public static ConnectorResourceConfig ensureDefaultInstance(final DomainConfig domainConfig) {
    ConnectorResourceConfig result = domainConfig.getResourcesConfig().getConnectorResourceConfigMap().get(getDefaultInstanceName());
    final ConnectorConnectionPoolConfig connectorConnectionPool = ConnectorConnectionPoolConfigTest.ensureDefaultInstance(domainConfig);
    if (result == null) {
        result = createInstance(domainConfig, getDefaultInstanceName(), connectorConnectionPool.getName(), null);
    }
    return result;
}
Also used : ConnectorConnectionPoolConfig(com.sun.appserv.management.config.ConnectorConnectionPoolConfig) ConnectorResourceConfig(com.sun.appserv.management.config.ConnectorResourceConfig)

Aggregations

ConnectorResourceConfig (com.sun.appserv.management.config.ConnectorResourceConfig)2 ConnectorConnectionPoolConfig (com.sun.appserv.management.config.ConnectorConnectionPoolConfig)1 ResourceRefConfig (com.sun.appserv.management.config.ResourceRefConfig)1 ObjectName (javax.management.ObjectName)1