use of com.sun.enterprise.deployment.node.PropertiesNode in project Payara by payara.
the class CmpResourceNode method writeDescriptor.
@Override
public Node writeDescriptor(Node parent, String nodeName, ResourceReferenceDescriptor descriptor) {
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;
}
Aggregations