public boolean isPropertyElement(int index) { NameValuePairDescriptor ret = (NameValuePairDescriptor)this.getValue(PROPERTY, index); return ret != null; }
public boolean isPropertyElement(int index) { NameValuePairDescriptor ret = (NameValuePairDescriptor)this.getValue(PROPERTY, index); return ret != null; }
/** * write the descriptor class to a DOM tree and return it * * @param parent node for the DOM tree * @param node name for the descriptor * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor(Node parent, String nodeName, ResourceAdapter descriptor) { Element raNode = (Element) super.writeDescriptor(parent, nodeName, descriptor); appendTextChild(raNode, RuntimeTagNames.DESCRIPTION, descriptor.getDescription()); setAttribute(raNode, RuntimeTagNames.JNDI_NAME, (String) descriptor.getValue(ResourceAdapter.JNDI_NAME)); setAttribute(raNode, RuntimeTagNames.MAX_POOL_SIZE, (String) descriptor.getValue(ResourceAdapter.MAX_POOL_SIZE)); setAttribute(raNode, RuntimeTagNames.STEADY_POOL_SIZE, (String) descriptor.getValue(ResourceAdapter.STEADY_POOL_SIZE)); setAttribute(raNode, RuntimeTagNames.MAX_WAIT_TIME_IN_MILLIS, (String) descriptor.getValue(ResourceAdapter.MAX_WAIT_TIME_IN_MILLIS)); setAttribute(raNode, RuntimeTagNames.IDLE_TIMEOUT_IN_SECONDS, (String) descriptor.getValue(ResourceAdapter.IDLE_TIMEOUT_IN_SECONDS)); // properties... NameValuePairDescriptor[] properties = descriptor.getPropertyElement(); if (properties!=null && properties.length>0) { RuntimeNameValuePairNode subNode = new RuntimeNameValuePairNode(); for (int i=0;i<properties.length;i++) { subNode.writeDescriptor(raNode, RuntimeTagNames.PROPERTY, properties[i]); } } return raNode; } }
/** * write the descriptor class to a DOM tree and return it * * @param parent node for the DOM tree * @param node name for the descriptor * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor(Node parent, String nodeName, ResourceAdapter descriptor) { Element raNode = (Element) super.writeDescriptor(parent, nodeName, descriptor); appendTextChild(raNode, RuntimeTagNames.DESCRIPTION, descriptor.getDescription()); setAttribute(raNode, RuntimeTagNames.JNDI_NAME, (String) descriptor.getValue(ResourceAdapter.JNDI_NAME)); setAttribute(raNode, RuntimeTagNames.MAX_POOL_SIZE, (String) descriptor.getValue(ResourceAdapter.MAX_POOL_SIZE)); setAttribute(raNode, RuntimeTagNames.STEADY_POOL_SIZE, (String) descriptor.getValue(ResourceAdapter.STEADY_POOL_SIZE)); setAttribute(raNode, RuntimeTagNames.MAX_WAIT_TIME_IN_MILLIS, (String) descriptor.getValue(ResourceAdapter.MAX_WAIT_TIME_IN_MILLIS)); setAttribute(raNode, RuntimeTagNames.IDLE_TIMEOUT_IN_SECONDS, (String) descriptor.getValue(ResourceAdapter.IDLE_TIMEOUT_IN_SECONDS)); // properties... NameValuePairDescriptor[] properties = descriptor.getPropertyElement(); if (properties!=null && properties.length>0) { RuntimeNameValuePairNode subNode = new RuntimeNameValuePairNode(); for (int i=0;i<properties.length;i++) { subNode.writeDescriptor(raNode, RuntimeTagNames.PROPERTY, properties[i]); } } return raNode; } }
(String) sunRAXML.getValue(ResourceAdapter.MAX_POOL_SIZE)); connectorPoolObj.setSteadyPoolSize( (String) sunRAXML.getValue(ResourceAdapter.STEADY_POOL_SIZE)); connectorPoolObj.setMaxWaitTimeInMillis((String) sunRAXML.getValue( ResourceAdapter.MAX_WAIT_TIME_IN_MILLIS)); connectorPoolObj.setIdleTimeoutInSeconds((String) sunRAXML.getValue( ResourceAdapter.IDLE_TIMEOUT_IN_SECONDS)); connectorPoolObj.setPoolResizeQuantity((String) "2");
getResourceAdapter().getValue(ResourceAdapter.JNDI_NAME);
/** * Creates connector connection pool pertaining to sun-ra.xml. This is * only for 1.0 complient rars. * * @throws ConnectorRuntimeException Thrown when pool creation fails. */ private void createSunRAConnectionPool() throws ConnectorRuntimeException { String defaultPoolName = connectorRuntime_.getDefaultPoolName( moduleName_, connectionDefs_[0].getConnectionFactoryIntf()); String sunRAPoolName = defaultPoolName + ConnectorConstants.SUN_RA_POOL; PoolInfo poolInfo = new PoolInfo(sunRAPoolName); ConnectorDescriptorInfo connectorDescriptorInfo = ConnectorDDTransformUtils.getConnectorDescriptorInfo(connectionDefs_[0]); connectorDescriptorInfo.setRarName(moduleName_); connectorDescriptorInfo.setResourceAdapterClassName(desc_.getResourceAdapterClass()); ConnectorConnectionPool connectorPoolObj = ConnectionPoolObjectsUtils.createSunRaConnectorPoolObject(poolInfo, desc_, moduleName_); connectorPoolObj.setConnectorDescriptorInfo(connectorDescriptorInfo); connectorRuntime_.createConnectorConnectionPool(connectorPoolObj); if(_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Created SUN-RA connection pool:", poolInfo); } String jndiName = (String) desc_.getSunDescriptor(). getResourceAdapter().getValue(ResourceAdapter.JNDI_NAME); ResourceInfo resourceInfo = new ResourceInfo(jndiName); connectorRuntime_.createConnectorResource(resourceInfo, poolInfo, null); if(_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Created SUN-RA connector resource : ", resourceInfo); } }
/** * Deletes both the default connector connection pools and resources */ protected void destroyAllConnectorResources() { if (!(isSystemRar(moduleName_))) { deleteDefaultConnectorResources(); deleteDefaultConnectorConnectionPools(); // Added to ensure clean-up of the Sun RA connection pool if (desc_.getSunDescriptor() != null && desc_.getSunDescriptor().getResourceAdapter() != null) { // sun-ra.xml exists String jndiName = (String) desc_.getSunDescriptor(). getResourceAdapter().getValue(ResourceAdapter.JNDI_NAME); if (jndiName == null || jndiName.equals("")) { // jndiName is empty, sunRA pool not created, so don't need to delete } else { // jndiName is not empty, need to delete pool deleteSunRAConnectionPool(); } } } }
if (sunraDesc != null) { String sunRAJndiName = (String) sunraDesc.getResourceAdapter(). getValue(ResourceAdapter.JNDI_NAME); if (jndiName.equals(sunRAJndiName)) { app.addResourceAdapter(desc.getName());
if (rar != null) { String sunRAJndiName = (String) rar.getValue(com.sun.enterprise.deployment.runtime.connector.ResourceAdapter.JNDI_NAME); isSunRAResource = resourceInfo.getName().equals(sunRAJndiName);