ConfigHelperpublic class ConfigHelper extends Object Utility Class to update the domain xml |
Fields Summary |
---|
private static final Logger | _logger | private static final String | POOL_SUFFIX | private static final String | DEFAULT_JAXR_RAR | private static final String | ignore_ra | public static final String | UDDI_PROPERTYProperty to be set by Resource Adapter to signify it is a UDDI specific Resource Adapter | public static final String | EBXML_PROPERTYProperty to be set by Resource Adapter to signify it is a EBXML specific Resource Adapter | public static final String | APPSERVER_UDDI | public static final String | APPSERVER_EBXML | public static final String | JAXR_REGISTRY_TYPEA RegistryLocation is determined by the type of its connector connection
definition.
The connector-connection-definition-name is of the type
javax.xml.registry.ConnectionFactory
to be qualified as a valid RegistryLocation | private static final String | UDDI_JAXR_REGISTRY_TYPE | private static final String | LifeCycleManagerURL | private static final String | QueryManagerURL | private Map | webServiceInfoMap | private static final String | INSTANCE_PORT_MBEAN_NAME |
Constructors Summary |
---|
private ConfigHelper(Map webServiceInfo)
/*
* Creates a new instance of ConfigHelper.
* This is used to create instances that update the domain.xml
*/
this.webServiceInfoMap = webServiceInfo;
| private ConfigHelper()Creates a instance of ConfigHelper that is used to query domain.xml for
RegistryLocations
|
Methods Summary |
---|
public void | addRegistryConnectionResources(java.lang.String jndiName, java.lang.String description, java.lang.String type, java.util.Map properties)Adds registry specific resources to the domain.
Adds a connector connection pool and then proceeds to add a connector
resource
final DomainConfig dc = getDomainConfig();
String registryType = null;
if (type == WebServiceMgr.UDDI_KEY) {
registryType = this.UDDI_PROPERTY;
} else if (type == WebServiceMgr.EBXML_KEY ){
registryType = this.EBXML_PROPERTY;
}
if (registryType == null) {
Object[] params = {UDDI_PROPERTY, EBXML_PROPERTY};
_logger.log(Level.WARNING, "registry.specify_registry_type", params);
throw new RuntimeException("Registry Type has to be "+
UDDI_PROPERTY + " or "+ EBXML_PROPERTY);
}
// 1. get resource adapter config
Map <String, ResourceAdapterConfig> raConfMap = dc.getResourceAdapterConfigMap();
// 2. get the resourceAdapterName
String resourceAdapterName = null;
for (String ra : raConfMap.keySet()){
ResourceAdapterConfig rac = raConfMap.get(ra);
if (rac.existsProperty(registryType)){
resourceAdapterName = rac.getResourceAdapterName();
break;
}
}
if (resourceAdapterName == null){
// Now look in the system resource adapter.
resourceAdapterName = getSystemConnectorResources(registryType);
if (resourceAdapterName == null){
// could not find any resource adapter that is a jaxr resource adapter type
// log it
String msg =
"Cannot locate JAXR Resource Adapter to add Connection pool" +
" and Connector Resource. Please add connector resource " +
"of type " + registryType;
_logger.log(Level.SEVERE,
"registry.deploy_registry_connector_resource", registryType);
throw new RuntimeException(msg);
}
}
// 3. generate a unique pool name
String poolName = FileUtils.makeFriendlyFileName(jndiName) + POOL_SUFFIX;
// 4. connectorDefinitionName
String connectorDefinitionName = JAXR_REGISTRY_TYPE;
if (registryType.equals(UDDI_PROPERTY)){
// jaxr-ri works only with a "/" appended to the URL
Properties props = new Properties();
for (String property : properties.keySet()){
String propValue = (String)properties.get(property);
if (LifeCycleManagerURL.equals(property) ||
QueryManagerURL.equals(property)){
//jaxr-ri needs a backslash at the end of the URL
if (!propValue.endsWith("/")) {
propValue = propValue + "/";
}
props.put(property, propValue);
} else if (property.equalsIgnoreCase("username")){
props.put("UserName", propValue);
} else if (property.equalsIgnoreCase("password")){
props.put("UserPassword", propValue);
} else
props.put(property, propValue);
}
connectorDefinitionName = UDDI_JAXR_REGISTRY_TYPE;
createConnectorConnectionPoolMBean(resourceAdapterName,
connectorDefinitionName, poolName, props);
} else {
Map<String, String> optional = new HashMap <String, String> ();
for (String property : properties.keySet()){
optional.put(PropertiesAccess.PROPERTY_PREFIX + property,
properties.get(property));
}
dc.createConnectorConnectionPoolConfig( poolName,
resourceAdapterName, connectorDefinitionName, optional );
}
dc.createConnectorResourceConfig(jndiName, poolName, null);
| void | addToConfig(java.lang.String webServiceName, java.util.Map published)Adds the list of RegistryLocations to the domain xml under
webservice-endpoint element, sub element registry-location element//String[] registryLocations) {
if(webServiceInfoMap == null){
_logger.fine("ConfigHelper.addToConfig : Incorrect webServiceName ");
return;
}
final DomainConfig dc = this.getDomainConfig();
String appId = (String)webServiceInfoMap.get(
WebServiceEndpointInfo.APP_ID_KEY);
Boolean isStandAlone = (Boolean)webServiceInfoMap.get(
WebServiceEndpointInfo.IS_STAND_ALONE_MODULE_KEY);
String appName = appId;
String pureWebServiceName = dropAppNameFromWebServiceName(webServiceName);
String underScoredWebServiceName =
convertHashesToUnderScores(webServiceName);
WebServiceEndpointConfig wsec = null;
if(!isStandAlone) {
Map <String, J2EEApplicationConfig> map =
dc.getJ2EEApplicationConfigMap();
J2EEApplicationConfig appConfig = map.get(appName);
if (appConfig == null) {
// this will never happen as this created by deployment
_logger.log(Level.FINE, "Could not find an application with " +
" name = "+appName);
} else {
Map <String, WebServiceEndpointConfig> wsmap =
appConfig.getWebServiceEndpointConfigMap();
wsec = wsmap.get(pureWebServiceName);
if (wsec == null){
wsec = appConfig.createWebServiceEndpointConfig(
pureWebServiceName, null);
wsec.setJBIEnabled(false);
}
for (String jndiname : published.keySet()){
appConfig.createProperty(jndiname+"__"+
underScoredWebServiceName,
published.get(jndiname));
}
}
} else {
String type = (String)webServiceInfoMap.
get(WebServiceEndpointInfo.SERVICE_IMPL_TYPE_KEY);
if(type.equals(WebServiceEndpointInfo.EJB_IMPL)){
Map <String, EJBModuleConfig> map
= dc.getEJBModuleConfigMap();
EJBModuleConfig ejbConfig = map.get(appName);
if (ejbConfig == null) {
// should never happen
_logger.log(Level.FINE, "Could not find a ejb module" +
" with name = "+appName);
} else{
Map <String, WebServiceEndpointConfig> ejbmap =
ejbConfig.getWebServiceEndpointConfigMap();
wsec = ejbmap.get(pureWebServiceName);
if (wsec == null){
wsec = ejbConfig.createWebServiceEndpointConfig(
pureWebServiceName, null);
wsec.setJBIEnabled(false);
}
for (String jndiname : published.keySet()){
ejbConfig.createProperty(jndiname+"__"+
underScoredWebServiceName,
published.get(jndiname));
}
}
} else if(type.equals(WebServiceEndpointInfo.SERVLET_IMPL)){
Map <String, WebModuleConfig> map =
dc.getWebModuleConfigMap();
WebModuleConfig webConfig = map.get(appName);
if (webConfig == null){
// should never happen
_logger.log(Level.FINE, "Could not find a web module" +
" with name = "+appName);
} else{
Map <String, WebServiceEndpointConfig> webmap =
webConfig.getWebServiceEndpointConfigMap();
wsec = webmap.get(pureWebServiceName);
if (wsec == null){
wsec = webConfig.createWebServiceEndpointConfig(
pureWebServiceName, null);
wsec.setJBIEnabled(false);
}
for (String jndiname : published.keySet()){
webConfig.createProperty(jndiname+"__"+
underScoredWebServiceName,
published.get(jndiname));
}
}
}
}
if(wsec != null){
String[] registryLocations = new String[published.size()];
registryLocations = published.keySet().toArray(registryLocations);
populateWebServiceEndpointConfig(wsec, registryLocations);
}
return;
| public java.lang.String[] | checkForDuplicateRegistries(java.lang.String[] jndi)
if (jndi.length <=1)
return null;
// plain comparision to see if the jndi names are duplicates
String[] duplicate = null;
for (int i = 0; i<jndi.length; i++){
for (int j=i+1; j<jndi.length; j++){
if (jndi[i].equals(jndi[j])){
duplicate = new String[1];
duplicate[0] = jndi[i];
this._logger.log(Level.SEVERE,
"Duplicate Registry Jndi Names. Will not" +
" publish the same " +
"web service twice to the same registry. " +
"Remove one jndi name ("+jndi[i]+")");
return duplicate;
}
}
}
if (duplicate == null){
final DomainConfig dc = this.getDomainConfig();
Map<String, ConnectorResourceConfig> crcMap =
dc.getConnectorResourceConfigMap();
for (int i = 0; i<jndi.length; i++){
ConnectorResourceConfig crc = crcMap.get(jndi[i]);
String pool = crc.getPoolName();
for (int j=i+1; j<jndi.length; j++){
ConnectorResourceConfig crcNew = crcMap.get(jndi[j]);
if(pool.equals(crcNew.getPoolName())){
duplicate = new String[2];
duplicate[0] = jndi[i];
duplicate[1] = jndi[j];
this._logger.log(Level.SEVERE,
"Registry Jndi Names point to the same registry. Will not" +
" publish the same " +
"web service twice to the same registry. " +
"Remove one duplicate of ("+jndi[i]+")" +
" or ("+jndi[j]+")");
return duplicate;
}
}
}
}
return null;
| private java.lang.String | convertHashesToUnderScores(java.lang.String hashed)
String returnValue = hashed.replaceAll("#", "__");
return returnValue;
| private void | createConnectorConnectionPoolMBean(java.lang.String resourceAdapterName, java.lang.String connectorDefinitionName, java.lang.String poolName, java.util.Properties props)
try{
// system rars cannot used via AMX :-(
final MBeanServer server = MBeanServerFactory.getMBeanServer();
ObjectName obj = new ObjectName
("com.sun.appserv:type=resources,category=config");
AttributeList attrlist = new AttributeList();
attrlist.add(new Attribute("name", poolName));
attrlist.add(new Attribute("resource-adapter-name", resourceAdapterName));
attrlist.add(new Attribute("connection-definition-name", connectorDefinitionName));
Object[] params = new Object[3];
params[0] = attrlist;
params[1] = props;
params[2] = "server";
String[] signature = new String[3];
signature[0] = "javax.management.AttributeList";
signature[1] = "java.util.Properties";
signature[2] = "java.lang.String";
server.invoke(obj, "createConnectorConnectionPool",
params, signature);
} catch (Exception e) {
_logger.log(Level.WARNING, "cannot create connection pool for " +
"resource adapter ="+resourceAdapterName, e);
}
| void | deleteFromConfig(java.lang.String webServiceName, java.lang.String[] registryLocations)Deletes the mapping of the RegistryLocation under the
web-service-endpoint element. This is called when the user has
unpublished a web service from the registries.
if(webServiceInfoMap == null){
_logger.fine("ConfigHelper.deletFromConfig : Incorrect " +
"webServiceName. Exiting! ");
return;
}
final DomainConfig dc = getDomainConfig();
String appId = (String)webServiceInfoMap.get(
WebServiceEndpointInfo.APP_ID_KEY);
Boolean isStandAlone = (Boolean)webServiceInfoMap.get(
WebServiceEndpointInfo.IS_STAND_ALONE_MODULE_KEY);
String pureWebServiceName = dropAppNameFromWebServiceName(webServiceName);
String underScoredWebServiceName =
convertHashesToUnderScores(webServiceName);
WebServiceEndpointConfig wsec = null;
if (!isStandAlone) {
Map<String, J2EEApplicationConfig> appMap =
dc.getJ2EEApplicationConfigMap();
J2EEApplicationConfig config = appMap.get(appId);
Map<String, WebServiceEndpointConfig> wsecMap =
config.getWebServiceEndpointConfigMap();
wsec = wsecMap.get(pureWebServiceName);
for (int i=0; i<registryLocations.length; i++){
String jndiname = registryLocations[i];
config.removeProperty(jndiname+"__"+
underScoredWebServiceName);
}
} else {
String type = (String)webServiceInfoMap.get(
WebServiceEndpointInfo.SERVICE_IMPL_TYPE_KEY);
if (type.equals(WebServiceEndpointInfo.EJB_IMPL)){
Map<String, EJBModuleConfig> ejbMap =
dc.getEJBModuleConfigMap();
EJBModuleConfig config = ejbMap.get(appId);
Map<String, WebServiceEndpointConfig> wsecMap =
config.getWebServiceEndpointConfigMap();
wsec = wsecMap.get(pureWebServiceName);
for (int i=0; i<registryLocations.length; i++){
String jndiname = registryLocations[i];
config.removeProperty(jndiname+"__"+
underScoredWebServiceName);
}
} else if (type.equals(WebServiceEndpointInfo.SERVLET_IMPL)){
Map<String, WebModuleConfig> webMap =
dc.getWebModuleConfigMap();
WebModuleConfig config = webMap.get(appId);
Map<String, WebServiceEndpointConfig> wsecMap =
config.getWebServiceEndpointConfigMap();
wsec = wsecMap.get(pureWebServiceName);
for (int i=0; i<registryLocations.length; i++){
String jndiname = registryLocations[i];
config.removeProperty(jndiname+"__"+
underScoredWebServiceName);
}
}
}
if (wsec != null){
for (String jndiName : registryLocations )
wsec.removeRegistryLocationConfig(jndiName);
}
| private java.lang.String | dropAppNameFromWebServiceName(java.lang.String webServiceName)
String[] split = webServiceName.split("#");
StringBuffer buf = new StringBuffer();
for (int i=1; i<split.length; i++){
buf.append(split[i]);
if(i<(split.length-1)){
buf.append("#");
}
}
return buf.toString();
| private com.sun.appserv.management.config.DomainConfig | getDomainConfig()
final MBeanServer server = MBeanServerFactory.getMBeanServer();
final DomainRoot domainRoot =
ProxyFactory.getInstance(server).getDomainRoot();
final DomainConfig domainConfig = domainRoot.getDomainConfig();
return domainConfig;
| public java.lang.String | getInstancePort()
final MBeanServer server = MBeanServerFactory.getMBeanServer();
String port = null;
try {
port = (String)server.getAttribute(
new javax.management.ObjectName(INSTANCE_PORT_MBEAN_NAME), "port");
} catch (MalformedObjectNameException ex) {
_logger.log(Level.WARNING, "Incorrect Object name to extract port from" +
" domain xml", ex);
} catch (javax.management.MBeanException mbe){
_logger.log(Level.WARNING, "MBeanServer returned an exception while" +
"being queried for port on http-listener ", mbe);
} catch (javax.management.AttributeNotFoundException anfe){
_logger.log(Level.WARNING, "Cannot find attribute on MBean "+
INSTANCE_PORT_MBEAN_NAME, anfe);
} catch (javax.management.InstanceNotFoundException infe){
_logger.log(Level.WARNING, " Cannot find MBean instance "+
INSTANCE_PORT_MBEAN_NAME, infe);
} catch (javax.management.ReflectionException re){
_logger.log(Level.WARNING, " Cannot invoke MBean instance "+
INSTANCE_PORT_MBEAN_NAME, re);
}
return port;
| public static com.sun.enterprise.admin.wsmgmt.registry.ConfigHelper | getInstanceToDeleteRegistryResources()
return new ConfigHelper();
| public static com.sun.enterprise.admin.wsmgmt.registry.ConfigHelper | getInstanceToQueryRegistryLocations()Creates an instance of ConfigHelper that is used to query domain.xml to
get to RegistryLocations. RegistryLocations are determined by the
JAXR_REGISTRY_TYPE
return new ConfigHelper();
| public static com.sun.enterprise.admin.wsmgmt.registry.ConfigHelper | getInstanceToUpdateConfig(java.util.Map webServiceInfo)Creates an Instance of ConfigHelper that is used to update the domain.xml
return new ConfigHelper(webServiceInfo);
| java.lang.String | getOrganizationName(java.lang.String webServiceName, java.lang.String registryLocation)
String organization = null;
if(webServiceInfoMap == null){
_logger.fine("ConfigHelper.addToConfig : Incorrect webServiceName ");
return null;
}
final DomainConfig dc = this.getDomainConfig();
String appId = (String)webServiceInfoMap.get(
WebServiceEndpointInfo.APP_ID_KEY);
Boolean isStandAlone = (Boolean)webServiceInfoMap.get(
WebServiceEndpointInfo.IS_STAND_ALONE_MODULE_KEY);
String appName = appId;
String underScoredWebServiceName =
convertHashesToUnderScores(webServiceName);
if(!isStandAlone) {
Map <String, J2EEApplicationConfig> map =
dc.getJ2EEApplicationConfigMap();
J2EEApplicationConfig appConfig = map.get(appName);
if (appConfig == null) {
// this will never happen as this created by deployment
_logger.log(Level.FINE, "Could not find an application with " +
" name = "+appName);
} else {
organization =
(String)appConfig.getPropertyValue(registryLocation+"__"+
underScoredWebServiceName);
}
} else {
String type = (String)webServiceInfoMap.
get(WebServiceEndpointInfo.SERVICE_IMPL_TYPE_KEY);
if(type.equals(WebServiceEndpointInfo.EJB_IMPL)){
Map <String, EJBModuleConfig> map
= dc.getEJBModuleConfigMap();
EJBModuleConfig ejbConfig = map.get(appName);
if (ejbConfig == null) {
// should never happen
_logger.log(Level.FINE, "Could not find a ejb module" +
" with name = "+appName);
} else{
organization =
(String)ejbConfig.getPropertyValue(registryLocation+
"__"+ underScoredWebServiceName);
}
} else if(type.equals(WebServiceEndpointInfo.SERVLET_IMPL)){
Map <String, WebModuleConfig> map =
dc.getWebModuleConfigMap();
WebModuleConfig webConfig = map.get(appName);
if (webConfig == null){
// should never happen
_logger.log(Level.FINE, "Could not find a web module" +
" with name = "+appName);
} else{
organization =
(String)webConfig.getPropertyValue(registryLocation+
"__"+ underScoredWebServiceName);
}
}
}
return organization;
| private java.lang.String | getSystemConnectorResources(java.lang.String type)
String[] systemResources = null;
final MBeanServer server = MBeanServerFactory.getMBeanServer();
try {
ObjectName objName =
new ObjectName("com.sun.appserv:type=resources,category=config");
systemResources = (String[])server.invoke( objName,
"getSystemConnectorsAllowingPoolCreation", null, null);
for (int i =0; i< systemResources.length; i++){
if (ignore_ra.equals(systemResources[i]))// dont look at jms ra
continue;
AttributeList attrList = new AttributeList();
attrList.add(new Attribute("resource-adapter-name",
systemResources[i]));
if (UDDI_PROPERTY.equals(type))
attrList.add(new Attribute("connection-definition-name",
UDDI_JAXR_REGISTRY_TYPE));
else
attrList.add(new Attribute("connection-definition-name",
JAXR_REGISTRY_TYPE));
Object[] params = new Object[]{attrList};
String[] types = new String[]{"javax.management.AttributeList"};
Properties properties =
(Properties)server.invoke(new ObjectName
("com.sun.appserv:type=resources,category=config"),
"getMCFConfigProps",
params, types );
Enumeration propertyNames = properties.propertyNames();
while(propertyNames.hasMoreElements()){
String name = (String)propertyNames.nextElement();
if (UDDI_PROPERTY.equals(type)){
if (name.equals(APPSERVER_UDDI))
return systemResources[i];
} else if (EBXML_PROPERTY.equals(type)) { // we do not have this yet.
// Kept incase soar-rar goes as a system adapter in the
// futurre
if (name.equals(APPSERVER_EBXML))
return systemResources[i];
}
}
}
} catch (Exception e) {
_logger.log(Level.FINE, "Cannot locate system connector resources");
}
return null;
| public java.lang.String[] | listAlreadyPublishedRegistryLocations(java.lang.String webServiceName, java.lang.String[] registryLocations)
String[] prePublished = null;
if(webServiceInfoMap == null){
_logger.fine("ConfigHelper.addToConfig : Incorrect webServiceName ");
return prePublished;
}
final DomainConfig dc = this.getDomainConfig();
String appId = (String)webServiceInfoMap.get(
WebServiceEndpointInfo.APP_ID_KEY);
Boolean isStandAlone = (Boolean)webServiceInfoMap.get(
WebServiceEndpointInfo.IS_STAND_ALONE_MODULE_KEY);
String appName = appId;
String pureWebServiceName = dropAppNameFromWebServiceName(webServiceName);
WebServiceEndpointConfig wsec = null;
if(!isStandAlone) {
Map <String, J2EEApplicationConfig> map =
dc.getJ2EEApplicationConfigMap();
J2EEApplicationConfig appConfig = map.get(appName);
if (appConfig == null) {
// this will never happen as this created by deployment
_logger.log(Level.FINE, "Could not find an application with " +
" name = "+appName);
} else {
Map <String, WebServiceEndpointConfig> wsmap =
appConfig.getWebServiceEndpointConfigMap();
wsec = wsmap.get(pureWebServiceName);
}
} else {
String type = (String)webServiceInfoMap.
get(WebServiceEndpointInfo.SERVICE_IMPL_TYPE_KEY);
if(type.equals(WebServiceEndpointInfo.EJB_IMPL)){
Map <String, EJBModuleConfig> map
= dc.getEJBModuleConfigMap();
EJBModuleConfig ejbConfig = map.get(appName);
if (ejbConfig == null) {
// should never happen
_logger.log(Level.FINE, "Could not find a ejb module" +
" with name = "+appName);
} else{
Map <String, WebServiceEndpointConfig> ejbmap =
ejbConfig.getWebServiceEndpointConfigMap();
wsec = ejbmap.get(pureWebServiceName);
}
} else if(type.equals(WebServiceEndpointInfo.SERVLET_IMPL)){
Map <String, WebModuleConfig> map =
dc.getWebModuleConfigMap();
WebModuleConfig webConfig = map.get(appName);
if (webConfig == null){
// should never happen
_logger.log(Level.FINE, "Could not find a web module" +
" with name = "+appName);
} else{
Map <String, WebServiceEndpointConfig> webmap =
webConfig.getWebServiceEndpointConfigMap();
wsec = webmap.get(pureWebServiceName);
}
}
}
if(wsec != null){
Map <String, RegistryLocationConfig> regMap =
wsec.getRegistryLocationConfigMap();
prePublished = new String[regMap.size()];
int i = 0;
for (String regLoc : regMap.keySet()){
RegistryLocationConfig rlc = regMap.get(regLoc);
prePublished [i++] =
new String(rlc.getConnectorResourceJNDIName());
}
}
return prePublished;
| java.lang.String[] | listRegistryLocations()List the RegistryLocations. A registry location is the jndi name of a
connection pool that points to a registry determined by the
connector connection definition of the type JAXR_REGISTRY_TYPE
final DomainConfig dc = this.getDomainConfig();
List<String> jndinames = new ArrayList<String>();
/**
* Get the names of resource-adapters for connection-pool of the type
* JAXR_REGISTRY_TYPE. Peek into the ResourceAdapterConfig to get the
* jndi name.
*/
Map<String, ConnectorConnectionPoolConfig> ccpcMap =
dc.getConnectorConnectionPoolConfigMap();
Map<String, ConnectorResourceConfig> crcMap =
dc.getConnectorResourceConfigMap();
for (String poolName : ccpcMap.keySet() ){
ConnectorConnectionPoolConfig ccpc = ccpcMap.get(poolName);
String connectionDefnName = ccpc.getConnectionDefinitionName();
if (JAXR_REGISTRY_TYPE.equals(connectionDefnName) ||
UDDI_JAXR_REGISTRY_TYPE.equals(connectionDefnName)){
for (String resourceName:crcMap.keySet()){
ConnectorResourceConfig crc = crcMap.get(resourceName);
if (poolName.equals(crc.getPoolName()))
jndinames.add(crc.getJNDIName());
}
}
}
String[] retValue = new String[jndinames.size()];
retValue = jndinames.toArray(retValue);
return retValue;
| void | populateWebServiceEndpointConfig(com.sun.appserv.management.config.WebServiceEndpointConfig wsec, java.lang.String[] registryLocations)
for (String jndi : registryLocations){
wsec.createRegistryLocationConfig(jndi);
}
| public void | removeRegistryConnectionResources(java.lang.String jndiNameOfRegistry)Removes the registry specific resources from the domain.
Peeks at the connector-resource element to obtain the
connector-connection-pool name. Using this pool name, removes the
connector-connection-pool, proceeds further to remove the
connector-resource
final DomainConfig dc = getDomainConfig();
Map<String, ConnectorResourceConfig> crcMap =
dc.getConnectorResourceConfigMap();
ConnectorResourceConfig crc = crcMap.get(jndiNameOfRegistry);
String poolName = (crc != null)? crc.getPoolName(): null;
dc.removeConnectorResourceConfig(jndiNameOfRegistry);
if (poolName != null){
dc.removeConnectorConnectionPoolConfig(poolName);
}
|
|