ConnectionDefNodepublic class ConnectionDefNode extends com.sun.enterprise.deployment.node.DeploymentDescriptorNode This node signifies the connection-definition tag in Connector DTD |
Fields Summary |
---|
com.sun.enterprise.deployment.ConnectionDefDescriptor | descriptor | public static final com.sun.enterprise.deployment.node.XMLElement | tag |
Constructors Summary |
---|
public ConnectionDefNode()
//default constructor...for normal operation in case of 1.5 DTD
register();
| public ConnectionDefNode(com.sun.enterprise.deployment.node.XMLElement element)
this.setXMLRootTag(element);
register();
|
Methods Summary |
---|
public void | addDescriptor(java.lang.Object obj)Adds a new DOL descriptor instance to the descriptor instance associated with
this XMLNode
if (obj instanceof EnvironmentProperty) {
descriptor.addConfigProperty((EnvironmentProperty)obj);
}
| public java.lang.Object | getDescriptor()
if (descriptor==null) {
// the descriptor associated with the ConnectionDefNode is a ConnectionDefDescriptor
// This descriptor is available with the parent node of the ConnectionDefNode
descriptor = (ConnectionDefDescriptor)DescriptorFactory.getDescriptor(getXMLPath());
((OutboundResourceAdapter)(getParentNode().getDescriptor())).addConnectionDefDescriptor(descriptor);
}
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.MANAGED_CONNECTION_FACTORY, "setManagedConnectionFactoryImpl");
table.put(ConnectorTagNames.CONNECTION_FACTORY_INTF, "setConnectionFactoryIntf");
table.put(ConnectorTagNames.CONNECTION_FACTORY_IMPL, "setConnectionFactoryImpl");
table.put(ConnectorTagNames.CONNECTION_INTF, "setConnectionIntf");
table.put(ConnectorTagNames.CONNECTION_IMPL, "setConnectionImpl");
return table;
| private void | register()method for registering the handlers with the various tags
registerElementHandler(new XMLElement(ConnectorTagNames.CONFIG_PROPERTY),
ConfigPropertyNode.class);
| public void | startElement(com.sun.enterprise.deployment.node.XMLElement element, org.xml.sax.Attributes attributes)SAX Parser API implementation, we don't really care for now.
//FIXME : remove the foll line once connector stuff works properly
//((ConnectionDefDescriptor)getDescriptor()).setOutBoundDefined(true);
super.startElement(element, attributes);
| public org.w3c.dom.Node | writeDescriptor(org.w3c.dom.Node parent, com.sun.enterprise.deployment.Descriptor desc)write the descriptor class to a DOM tree and return it
//connection definition info
if (!(desc instanceof OutboundResourceAdapter)) {
throw new IllegalArgumentException(getClass() + " cannot handle descriptors of type " + descriptor.getClass());
}
Iterator connectionDefs = null;
connectionDefs = ((OutboundResourceAdapter)desc).getConnectionDefs().iterator();
//connection-definitions
for (;connectionDefs.hasNext();) {
ConnectionDefDescriptor con = (ConnectionDefDescriptor) connectionDefs.next();
Node conNode = appendChild(parent, ConnectorTagNames.CONNECTION_DEFINITION);
appendTextChild(conNode, ConnectorTagNames.MANAGED_CONNECTION_FACTORY, con.getManagedConnectionFactoryImpl());
ConfigPropertyNode config = new ConfigPropertyNode();
conNode = config.writeDescriptor(conNode, con);
appendTextChild(conNode, ConnectorTagNames.CONNECTION_FACTORY_INTF, con.getConnectionFactoryIntf());
appendTextChild(conNode, ConnectorTagNames.CONNECTION_FACTORY_IMPL, con.getConnectionFactoryImpl());
appendTextChild(conNode, ConnectorTagNames.CONNECTION_INTF, con.getConnectionIntf());
appendTextChild(conNode, ConnectorTagNames.CONNECTION_IMPL, con.getConnectionImpl());
}
return parent;
|
|