Fields Summary |
---|
private com.sun.enterprise.deployment.ConnectorDescriptor | descriptor |
public static final String | VERSION_10 |
public static final String | VERSION_15 |
private String | specVersion |
public static final String | PUBLIC_DTD_ID_10 |
public static final String | SYSTEM_ID_10 |
public static final String | PUBLIC_DTD_ID |
public static final String | SYSTEM_ID |
public static final String | SCHEMA_ID |
public static final String | SPEC_VERSION |
private static final List | systemIDs |
public static final com.sun.enterprise.deployment.node.XMLElement | tag |
Methods Summary |
---|
public void | addDescriptor(java.lang.Object newDescriptor)Adds a new DOL descriptor instance to the descriptor instance associated with
this XMLNode
|
public java.lang.Object | getDescriptor()
if (descriptor == null) {
descriptor = (ConnectorDescriptor) DescriptorFactory.getDescriptor(getXMLPath());
}
return descriptor;
|
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.
// no need to be synchronized for now
Map table = super.getDispatchTable();
table.put(ConnectorTagNames.VENDOR_NAME, "setVendorName");
table.put(ConnectorTagNames.EIS_TYPE, "setEisType");
// support for 1.0 DTD and 1.5 schema and not 1.5 DTD
table.put(ConnectorTagNames.RESOURCEADAPTER_VERSION, "setResourceAdapterVersion");
return table;
|
public java.lang.String | getDocType()
return null;
|
public com.sun.enterprise.deployment.node.XMLNode | getHandlerFor(com.sun.enterprise.deployment.node.XMLElement element)
if (ConnectorTagNames.RESOURCE_ADAPTER.equals(element.getQName())) {
/** For resourceadapter tag, we need to find out what version of DTD we are handling
* in order to correctly read/write the XML file
*/
if (VERSION_10.equals(specVersion)) {
OutBoundRANode outboundRANode = new OutBoundRANode(element);
outboundRANode.setParentNode(this);
outboundRANode.createConDefDescriptorFor10();
return outboundRANode;
} else {
RANode raNode = new RANode(element);
raNode.setParentNode(this);
return raNode;
}
} else {
return super.getHandlerFor(element);
}
|
protected java.lang.String | getSchemaURL()
return TagNames.J2EE_NAMESPACE + "/" + getSystemID();
|
public java.lang.String | getSpecVersion()
return SPEC_VERSION;
|
public java.lang.String | getSystemID()
return SCHEMA_ID;
|
public java.util.List | getSystemIDs()
return systemIDs;
|
protected com.sun.enterprise.deployment.node.XMLElement | getXMLRootTag()
return tag;
|
public boolean | handlesElement(com.sun.enterprise.deployment.node.XMLElement element)
if (ConnectorTagNames.RESOURCE_ADAPTER.equals(element.getQName())) {
return false;
}
return super.handlesElement(element);
|
private static java.util.List | initSystemIDs()
List<String> systemIDs = new ArrayList<String>();
systemIDs.add(SCHEMA_ID);
return Collections.unmodifiableList(systemIDs);
|
public static java.lang.String | registerBundle(java.util.Map publicIDToDTD)register this node as a root node capable of loading entire DD files
publicIDToDTD.put(PUBLIC_DTD_ID, SYSTEM_ID);
publicIDToDTD.put(PUBLIC_DTD_ID_10, SYSTEM_ID_10);
return tag.getQName();
|
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");
}
// the version attribute value is the spec version we use
// and it's only available from schema based xml
if (attributeName.getQName().equals(ConnectorTagNames.VERSION)) {
descriptor.setSpecVersion(value);
specVersion = value;
return true;
} else if (attributeName.getQName().equals(TagNames.ID)) {
// we do not support id attribute for the moment
return true;
}
return false;
|
public void | setElementValue(com.sun.enterprise.deployment.node.XMLElement element, java.lang.String value)receives notification of the value for a particular tag
getDescriptor();
if (descriptor==null) {
throw new RuntimeException(
"Trying to set values on a null descriptor");
} if (ConnectorTagNames.SPEC_VERSION.equals(element.getQName())) {
descriptor.setSpecVersion(value);
specVersion = value;
// the version element value is the resourve adapter version
// and it's only available from dtd based xml
} else if (ConnectorTagNames.VERSION.equals(element.getQName())) {
descriptor.setResourceAdapterVersion(value);
} else
super.setElementValue(element, value);
|
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)) {
throw new IllegalArgumentException(getClass() + " cannot handle descriptors of type " + descriptor.getClass());
}
ConnectorDescriptor conDesc = (ConnectorDescriptor) descriptor;
conDesc.setSpecVersion(VERSION_15);
Node connectorNode = super.writeDescriptor(parent, conDesc);
appendTextChild(connectorNode, ConnectorTagNames.VENDOR_NAME, conDesc.getVendorName());
appendTextChild(connectorNode, ConnectorTagNames.EIS_TYPE, conDesc.getEisType());
appendTextChild(connectorNode, ConnectorTagNames.RESOURCEADAPTER_VERSION, conDesc.getResourceAdapterVersion());
//license info
LicenseNode licenseNode = new LicenseNode();
connectorNode = licenseNode.writeDescriptor(connectorNode, conDesc);
// resource adapter node
RANode raNode = new RANode();
connectorNode = raNode.writeDescriptor(connectorNode, conDesc);
return connectorNode;
|