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);
}
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;
}
Aggregations