ConfigPropertyNodepublic class ConfigPropertyNode extends com.sun.enterprise.deployment.node.DeploymentDescriptorNode This node is responsible for handling the Connector DTD related config-property XML tag |
Fields Summary |
---|
private com.sun.enterprise.deployment.EnvironmentProperty | config |
Methods Summary |
---|
public java.lang.Object | getDescriptor()
if (config == null) {
config = (EnvironmentProperty) DescriptorFactory.getDescriptor(getXMLPath());
}
return config;
| protected java.util.Map | getDispatchTable()all sub-implementation of this class can use a dispatch table to map xml element to
method name on the descriptor class for setting the element value.
Map table = super.getDispatchTable();
table.put(ConnectorTagNames.CONFIG_PROPERTY_NAME, "setName");
table.put(ConnectorTagNames.CONFIG_PROPERTY_VALUE, "setValue");
table.put(ConnectorTagNames.CONFIG_PROPERTY_TYPE, "setType");
return table;
| public org.w3c.dom.Node | writeDescriptor(org.w3c.dom.Node parent, com.sun.enterprise.deployment.Descriptor descriptor)write the descriptor class to a DOM tree and return it
if (! (descriptor instanceof ConnectorDescriptor) &&
! (descriptor instanceof AdminObject) &&
! (descriptor instanceof ConnectionDefDescriptor) &&
! (descriptor instanceof OutboundResourceAdapter)) {
throw new IllegalArgumentException(getClass() + " cannot handle descriptors of type " + descriptor.getClass());
}
Iterator configProps = null;
if (descriptor instanceof ConnectorDescriptor) {
configProps = ((ConnectorDescriptor)descriptor).getConfigProperties().iterator();
} else if (descriptor instanceof ConnectionDefDescriptor) {
configProps = ((ConnectionDefDescriptor)descriptor).getConfigProperties().iterator();
} else if (descriptor instanceof AdminObject) {
configProps = ((AdminObject)descriptor).getConfigProperties().iterator();
} else if (descriptor instanceof OutboundResourceAdapter) {
configProps = ((OutboundResourceAdapter)descriptor).getConfigProperties().iterator();
}
//config property info
for (;configProps.hasNext();) {
EnvironmentProperty config = (EnvironmentProperty) configProps.next();
Node configNode = appendChild(parent, ConnectorTagNames.CONFIG_PROPERTY);
writeLocalizedDescriptions(configNode, config);
appendTextChild(configNode, ConnectorTagNames.CONFIG_PROPERTY_NAME, config.getName());
appendTextChild(configNode, ConnectorTagNames.CONFIG_PROPERTY_TYPE, config.getType());
appendTextChild(configNode, ConnectorTagNames.CONFIG_PROPERTY_VALUE, config.getValue());
}
return parent;
|
|