CmpResourceNodepublic class CmpResourceNode extends RuntimeDescriptorNode This node handles the cmp-resource runtime xml tag |
Fields Summary |
---|
com.sun.enterprise.deployment.ResourceReferenceDescriptor | descriptor |
Constructors Summary |
---|
public CmpResourceNode()Creates new CmpResourceNode
registerElementHandler(new XMLElement(RuntimeTagNames.DEFAULT_RESOURCE_PRINCIPAL),
DefaultResourcePrincipalNode.class, "setResourcePrincipal");
registerElementHandler(new XMLElement(RuntimeTagNames.PROPERTY),
RuntimeNameValuePairNode.class, "addProperty");
registerElementHandler(new XMLElement(RuntimeTagNames.SCHEMA_GENERATOR_PROPERTIES),
PropertiesNode.class, "setSchemaGeneratorProperties");
|
Methods Summary |
---|
public java.lang.Object | getDescriptor()
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.
Map table = super.getDispatchTable();
table.put(RuntimeTagNames.JNDI_NAME, "setJndiName");
table.put(RuntimeTagNames.CREATE_TABLES_AT_DEPLOY, "setCreateTablesAtDeploy");
table.put(RuntimeTagNames.DROP_TABLES_AT_UNDEPLOY, "setDropTablesAtUndeploy");
table.put(RuntimeTagNames.DATABASE_VENDOR_NAME, "setDatabaseVendorName");
return table;
| public void | postParsing()notification of the end of XML parsing for this node
EjbBundleDescriptor bd = (EjbBundleDescriptor) getParentNode().getDescriptor();
if (bd==null) {
DOLUtils.getDefaultLogger().log(Level.SEVERE, "enterprise.deployment.backend.addDescriptorFailure",
new Object[]{descriptor});
return;
}
bd.setCMPResourceReference(descriptor);
| public org.w3c.dom.Node | writeDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.ResourceReferenceDescriptor descriptor)write the descriptor class to a DOM tree and return it
Node cmp = super.writeDescriptor(parent, nodeName, descriptor);
appendTextChild(cmp, RuntimeTagNames.JNDI_NAME, descriptor.getJndiName());
if (descriptor.getResourcePrincipal() != null) {
DefaultResourcePrincipalNode drpNode = new DefaultResourcePrincipalNode();
drpNode.writeDescriptor(cmp, RuntimeTagNames.DEFAULT_RESOURCE_PRINCIPAL,
descriptor.getResourcePrincipal());
}
// properties*
Iterator properties = descriptor.getProperties();
if (properties!=null) {
RuntimeNameValuePairNode propNode = new RuntimeNameValuePairNode();
while (properties.hasNext()) {
NameValuePairDescriptor aProp = (NameValuePairDescriptor) properties.next();
propNode.writeDescriptor(cmp, RuntimeTagNames.PROPERTY, aProp);
}
}
// createTableAtDeploy, dropTableAtUndeploy
if (descriptor.isCreateTablesAtDeploy()) {
appendTextChild(cmp, RuntimeTagNames.CREATE_TABLES_AT_DEPLOY, RuntimeTagNames.TRUE);
}
if (descriptor.isDropTablesAtUndeploy()) {
appendTextChild(cmp, RuntimeTagNames.DROP_TABLES_AT_UNDEPLOY, RuntimeTagNames.TRUE);
}
// database vendor name
appendTextChild(cmp, RuntimeTagNames.DATABASE_VENDOR_NAME, descriptor.getDatabaseVendorName());
// schema-generator-properties?
Properties schemaGeneratorProps = descriptor.getSchemaGeneratorProperties();
if (schemaGeneratorProps!=null) {
PropertiesNode pn = new PropertiesNode();
pn.writeDescriptor(cmp, RuntimeTagNames.SCHEMA_GENERATOR_PROPERTIES, schemaGeneratorProps);
}
return cmp;
|
|