ResourceAdapterNodepublic class ResourceAdapterNode extends com.sun.enterprise.deployment.node.runtime.RuntimeDescriptorNode This node handles the resource-adapter runtime deployment descriptors |
Fields Summary |
---|
protected com.sun.enterprise.deployment.runtime.RuntimeDescriptor | descriptor |
Constructors Summary |
---|
public ResourceAdapterNode()Initialize the child handlers
// we do not care about our standard DDS handles
handlers = null;
registerElementHandler(new XMLElement(RuntimeTagNames.PROPERTY),
RuntimeNameValuePairNode.class, "addPropertyElement");
|
Methods Summary |
---|
public java.lang.Object | getDescriptor()
if (descriptor==null) {
descriptor = (RuntimeDescriptor) super.getDescriptor();
descriptor.setValue(ResourceAdapter.MAX_POOL_SIZE, "32");
descriptor.setValue(ResourceAdapter.STEADY_POOL_SIZE, "4");
descriptor.setValue(ResourceAdapter.MAX_WAIT_TIME_IN_MILLIS, "10000");
descriptor.setValue(ResourceAdapter.IDLE_TIMEOUT_IN_SECONDS, "1000");
}
return descriptor;
| protected boolean | setAttributeValue(com.sun.enterprise.deployment.node.XMLElement elementName, com.sun.enterprise.deployment.node.XMLElement attributeName, java.lang.String value)parsed an attribute of an element
getDescriptor();
if (descriptor==null) {
throw new RuntimeException("Trying to set values on a null descriptor");
}
if (attributeName.getQName().equals(RuntimeTagNames.JNDI_NAME)) {
descriptor.setAttributeValue(ResourceAdapter.JNDI_NAME, value);
return true;
}
if (attributeName.getQName().equals(RuntimeTagNames.MAX_POOL_SIZE)) {
descriptor.setAttributeValue(ResourceAdapter.MAX_POOL_SIZE, value);
return true;
}
if (attributeName.getQName().equals(RuntimeTagNames.STEADY_POOL_SIZE)) {
descriptor.setAttributeValue(ResourceAdapter.STEADY_POOL_SIZE, value);
return true;
}
if (attributeName.getQName().equals(RuntimeTagNames.MAX_WAIT_TIME_IN_MILLIS)) {
descriptor.setAttributeValue(ResourceAdapter.MAX_WAIT_TIME_IN_MILLIS, value);
return true;
}
if (attributeName.getQName().equals(RuntimeTagNames.IDLE_TIMEOUT_IN_SECONDS)) {
descriptor.setAttributeValue(ResourceAdapter.IDLE_TIMEOUT_IN_SECONDS, value);
return true;
}
return false;
| public org.w3c.dom.Node | writeDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.runtime.connector.ResourceAdapter descriptor)write the descriptor class to a DOM tree and return it
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;
|
|